New-ADGroup Esacping special characters

Welcome Forums General PowerShell Q&A New-ADGroup Esacping special characters

This topic contains 3 replies, has 3 voices, and was last updated by

11 months, 1 week ago.

  • Author
  • #96330

    Points: -17
    Rank: Member

    Hi all

    I am trying to create a few AD groups with PowerShell and I can't seem to escape special characters. One group I am trying to create -==My Group
    I have tried "-\=\=My group" "-\`=`\=My Group" and neither seem to work, I get New-ADGroup : The name provided is not a properly formed account name error

    Any help would be appreciated

  • #96332

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    That's... an odd name.

    The backtick is PowerShell's escape character; you wouldn't use a backslash. But that's only PowerShell; there may be additional checking in the code of that command which is causing the rejection. PowerShell wouldn't normally need you to escape – or =, so it's AD most likely causing the error.

    But backslashes are definitely not allowed. So they may be your problem source.

    • #96342

      Points: -17
      Rank: Member

      Thanks Don

      I am replacing an old Small Business Server 2011 that is bad shape. I was using PowerShell to get the ADgroup listing and recreate them on the new server. I am not going to worry about creating the exact groups. Just going to replace them with something more sane.

      Thanks again.

  • #96362

    Points: 0
    Rank: Member

    There's an IBM post that says = isn't allowed in user, group and computer names

    The standard AD escape character \ doesn't work with = nor does the trick of using the ASCII code

    Given the form of a distinguished name

    I could understand = not being allowed

    implies that = is allowed

    BUT this

    states that = NOT allowed in AD names.

    AD administrative center just fails with a = in the name

    AD Users and Computers says that nay of these

    /\[]:;|=,+*?" are illegal characters for the pre-Windows 2000 group name and will be replaced by a underscore _

    My opinion at the moment is that you're not going to be able to create groups with = in the name

The topic ‘New-ADGroup Esacping special characters’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort