Add Users To a Group by PowerShell Script
- Purpose – Add users to a group from an input file – PowerShell V2 Script.
- Input file – Input file (Users.csv) contains samAccountName in the following format:
# Users.csv UserName polin.wei jack.wei
PowerShell Code:
# # Add User to a Group - PowerShell Script # Import-module ActiveDirectory Import-CSV "C:\Scripts\Users.csv" | % { Add-ADGroupMember -Identity testGroup -Member $_.UserName }
Ref: http://portal.sivarajan.com/2011/07/add-users-to-grouppowershell-script.html
你必須 登入 才能發表評論。