Answer the question
In order to leave comments, you need to log in
How to edit an attribute in Active Directory for each user?
The task is to change the organization of all Active Directory users. There is an organization - "a" and an organization - "in". You need to change the name of the organization only for all users of the organization "a". Please share a script.
Answer the question
In order to leave comments, you need to log in
Get-ADUser -Filter * -Properties * | where Company -eq "a" | Set-ADUser -Company "b"
Here's the simplest one:
$a = "Organization a" \\old
$b = "Organization b" \\to change
$Users = Get-ADUser -Filter *
foreach ($u in $Users){
if ($u =$a){
Set-ADUser $u -Replace @{company=$b}
}
}
Then wind up the conditions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question