Transfer Users
-
Monday, May 07, 2012 4:05 PMI'm transferring users from one OU to another
I was able to write this
$OuGang = "cd1.ds1.bcu.edu/users"
$Target = Get-QADUser -searchroot $OuGang -searchScope 'OneLevel'
foreach ($Person in $Target) {
add-QADGroupMember -identity "CN=Academic Affairs,OU=Users,DC=CD1,DC=BCU,DC=EDU" -member $Person.dn}
but when I run i get this
bradley Wyatt
All Replies
-
Monday, May 07, 2012 4:40 PMI run similar code, and no errors. Your problem lies with the DN of the target group, specifically those that start with "DC=".
Grant Ward, a.k.a. Bigteddy
-
Monday, May 07, 2012 4:48 PM
You don't need to enumerate. The AR CmdLets will do it for you.
$Target=Get-QADUser -searchroot $OuGang -searchScope 'OneLevel' add-QADGroupMember -identity "CN=Academic Affairs,OU=Users,DC=CD1,DC=BCU,DC=EDU" -member $target
Be sure you have the latest version of the AR CMdLets. Earlier versions had a bug in this CmdLet.
ActiveRoles Management Shell 1.5.1 or later is required.
¯\_(ツ)_/¯
- Edited by jrvMicrosoft Community Contributor Monday, May 07, 2012 4:50 PM
-
Monday, May 07, 2012 4:58 PM
I'm transferring users from one OU to another
bradley Wyatt
Your code is not doing that. It is using the members of an OU to populate a security group. It is not moving users from one OU to another. (Unless this is part of a bigger plan)?Grant Ward, a.k.a. Bigteddy
-
Monday, May 07, 2012 6:08 PM
This is the script to list all users
$OU = "cd1.bcu.siu.edu/users"
Get-QADUser -SearchRoot $OU `
| format-Table FirstName, LastName, DisplayName -autobradley Wyatt
-
Monday, May 07, 2012 6:12 PM
It is a script to list all users in that one container(Users). It does not list all users. The following lists all users:
Get-QADUser | format-Table FirstName, LastName, DisplayName -auto
¯\_(ツ)_/¯
- Marked As Answer by Bradley Wyatt Tuesday, May 08, 2012 6:03 PM

