title: Add-ADGroupMember cannot find an object with identity
body: <p>I'm working on a PowerShell script to import a large number of users into AD.</p>
  
  <p>One of the items is to add the users to AD security groups according to their program number. Mostly, this is working well, unless I misspell something, or other simple human errors. However, we have 2 security groups everyone must be added to, and while the <code>Add-ADGroupMember</code> works perfectly on one, it can't find the other group. This is the the script I'm using:</p>
  
  <pre><code>$Users = Import-Csv "C:\PSScripts\Create\users.csv"  
  foreach ($User in $Users) 
  {  
      $AccountName = $User.firstname + "." + $User.lastname
      $Program = $User.Program
      $HomeDrive = 'H:'
      $UserRoot = '\\twgeneral\homedrive\'
      $HomeDirectory = $UserRoot+$AccountName
      Set-ADUser $AccountName -HomeDrive $HomeDrive -HomeDirectory $HomeDirectory
      If ($AccountName -eq $AccountName)
      {
          Add-ADGroupMember -Identity "ALL_USERS" -Member $Accountname
      } 
      If ($AccountName -eq $AccountName)
      {
          Add-ADGroupMember -Identity "000-All users" -Member $Accountname
      }
  }
  </code></pre>
  
  <p>And I get this error returned:</p>
  
  <pre><code>Add-ADGroupMember : Cannot find an object with identity: '000-All users' under:     'DC=*****,CD=local'.
  At C:\psscripts\create\Groups.ps1:15 char:23
  +     {ADD-ADGroupMember &lt;&lt;&lt;&lt;  -Identity "000-All users" -Member $Accountname
      + CategoryInfo          : ObjectNotFound: &lt;000-All users:ADGroup&gt; [Add-ADGroupMember], ADIdentityNotFoundException
      + FullyQualifiedErrorId : Cannot find an object with identity: '000-All users' under: 'DC=*****,DC=local'.,Microsoft.ActiveDirectory.Management.Commands.AddADGroupMember
  </code></pre>
  
  <p>Yet I can add users to the 000-All users group using the ADUC graphic interface. </p>
  
  <p>Similarly, I'm running a script prior to this one, creating users with SAM; Display Name; Exch. E-mail Account; Password; and specific OU within the domain, and it executes without errors, I can go into the graphic interface and see the user right where they are supposed to be with all pertinent details configured, yet some of the users return the same 'object not found' error when I try to execute the part of the groups script that DOES work, the ALL_USERS group. Specifically, it's users who have a hyphenated last name, ex: Markiem-Chalmers, or Tatem-Brown. </p>
  
  <p>I know that the syntax for the <code>Add-ADGroupMember</code> is correct, because I copied and pasted from the prior string, which does execute properly, only changing the name of the group from ALL_USERS to 000-All users, and I've double, triple, quadruple checked that the spelling is correct. Any help would be GREATLY appreciated!</p>