I am trying to add a list of users to an AD Security group using the below Powershell script and I am getting the following error. Add-ADGroupMember : Cannot find an object with identity:
Can anoybody advise on what I am doing wrong. The user names do exist in AD
Import-Module ActiveDirectory
$comps=Get-Content names.txt
foreach ($comp in $comps)
{$dns=get-aduser $comp
$b=$dns.distinguishedname
Add-ADGroupMember -Identity $b GIT_GS_AMU_Windows7_Object
}