Transfer Users
-
07 Mayıs 2012 Pazartesi 16:05I'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
Tüm Yanıtlar
-
07 Mayıs 2012 Pazartesi 16:40I 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
-
07 Mayıs 2012 Pazartesi 16:48
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.
¯\_(ツ)_/¯
- Düzenleyen jrvMicrosoft Community Contributor 07 Mayıs 2012 Pazartesi 16:50
-
07 Mayıs 2012 Pazartesi 16:58
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
-
07 Mayıs 2012 Pazartesi 18:08
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
-
07 Mayıs 2012 Pazartesi 18:12
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
¯\_(ツ)_/¯
- Yanıt Olarak İşaretleyen Bradley Wyatt 08 Mayıs 2012 Salı 18:03