![]() ![]() New-ADUser $samaccountname -DisplayName "$displayname" -GivenName "$givenName" -Surname "$sn" -UserPrincipalName -EmailAddress "$mail" -EmployeeID "$employeeID" -AccountPassword(convertTo-SecureString -AsPlainText "Pa$$w0rd5" -Force) -Enabled $True -PassThruĪdd-ADGroupMember -Members "$samaccountname" G_NewGroup $Searcher.Filter = "(distinguishedName=$userdn)" $users = | Select-Object -Property "Path") $OUbind = (cd AD:'\OU=New_users,DC=NewDomain,DC=net') $Searcher.Filter = "(&(memberOf=CN=Global_group,OU=Security Groups,DC=OldDomain,DC=net))" ![]() $domain = New-Object DirectoryServices.DirectoryEntry( Heres what i Have so far: Import-Module activedirectory I hoping its really simple, or that someone can comment on my work so far, as im fairly new to this and all feedback is good. What i need help with is, to query the same group members, and remove user accounts from the new domain that are no longer members of it. I have a script that connects via ldap and queries a group for it's member users, then looks up each users attributes and converts it into new user accounts in a new domain and adds them to a security group. I was determined to figure this out for myself, but my deadline has been brought forward, any help would be greatly appreciate. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |