All,
I am trying to add multiple users to an AD security group using AddRange method but no luck.
Reason why I am using AddRange method is, the memberlist is pretty big (30K users) and Quest or MSFT AD Cmdlets taking plenty of time to add them.
I am following the instruction per http://msdn.microsoft.com/en-in/library/ms180904(v=vs.80).aspx but no luck.
Code snippet:
$groupmembers = Get-Content C:\Temp\MemberDN.txt
$getgroup = [ADSI]"LDAP://CN=MYADGROUP,OU=GROUPS,DC=CONTOSO,DC=COM"
$getgroup.properties.member.AddRange($groupmembers)
#$getgroup.properties["member"].AddRange($groupmembers)
$getgroup.CommitChanges()
#$getgroup.SetInfo()
I tried using ADSPATH as well but no luck.
Any help or pointers are appreciated.
Thanks.