P S
asked on
Need to move selected user with a specific attribute to an OU from their existing OU
My requirement is to move few users from an OU to a different OU. All users are currently under "SAMPLE" OU and all of them have an attribute "xyz" set with a value '3'.
ex: user "Test" is located in OU=Sample,DC=Contoso,DC=co m. He's got an attribute named "xyz" set with value '3'. I would like to move this user to OU=Sample1,DC=Contoso,DC=c om
My requirement is to move user accounts with attribute name "xyz" of value 3 from an OU for ex: OU=Sample,DC=COntoso,DC=co m to OU=Sapmple1,DC=Contoso,DC= com
Additionally, all those accounts which are supposed to be moved are disabled and i need to enable them as well.
Let me know if any other information is required
Thanks in advance
ex: user "Test" is located in OU=Sample,DC=Contoso,DC=co
My requirement is to move user accounts with attribute name "xyz" of value 3 from an OU for ex: OU=Sample,DC=COntoso,DC=co
Additionally, all those accounts which are supposed to be moved are disabled and i need to enable them as well.
Let me know if any other information is required
Thanks in advance
ASKER
Thanks oBdA. I'll test the script. Maybe I should have mentioned to move all users from "SAMPLE" OU to "SAMPLE1" only if they are disabled and have an attribute "xyz" set with value "3" and later enable them as well.
Can you add "enable" part to the script?
Can you add "enable" part to the script?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks oBdA. This worked perfectly.
Open in new window