How to add multiple users to multiple groups using PowerShell
PowerShell Command
Import-Csv "C:\Users\Administrator\Desktop\bulkuserandgroup.csv"
| Group-Object
Group |
% {
$users
= $_.Group | % { Get-ADUser $_.Accountname
}
Add-ADGroupMember
-Identity $_.Name -Member $users
}
No comments:
Post a Comment