โ04-25-2022 02:06 PM
I have had to populate a lot of user groups lately. It has been for a number of reasons: a new SSO app, LDAP group, etc. The one common thing has been that HR or another department gives me a list of people that need to be added to the group. That is what lead to me knocking together this little PowerShell script. All I do is make sure the CSV has the employee emails on it and update the script with the CSV name and JC user group name. It has saved me a ton of time:
$employeeList = Import-Csv "<CSV FILE>"
ForEach ($employee in $employeeList){
Try {
$user = Get-JCUser -email $employee.email
Add-JCUserGroupMember -GroupName "<USER GROUP NAME>" -username $user.username
}Catch{
Write-Output "No username found for $($employee.email)"
}
}
โ04-25-2022 02:12 PM
YES!!!! Community can definitely get some mileage out of this too, I know I can. Thank you Ryan!!!
โ04-28-2022 12:58 PM
So great! Thanks for sharing, Ryan.
Like someone's post? Give them a kudo!
Did someone's answer help you? Please mark it as a solution.
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.