Created
October 15, 2018 08:06
-
-
Save ferdinandosimonetti/97ecb7c6ef206ce6f619e52cbcdd4b42 to your computer and use it in GitHub Desktop.
function to add AD users to AD groups from a CSV input file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addUsersToGroup { | |
Param( | |
[parameter(Mandatory=$true)] | |
[String] | |
$InputFile | |
) | |
$a = import-csv -header utente,gruppo -path $InputFile | |
foreach ($row in $a) { | |
Add-ADGroupMember -members $row.utente -identity $row.gruppo | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment