I have been getting a lot of mileage out of this script template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ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)"
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ04-25-2022 02:12 PM
YES!!!! Community can definitely get some mileage out of this too, I know I can. Thank you Ryan!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ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.
![](/skins/images/C210B62239BAF37B0AB0FAEB086BB5F1/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/C210B62239BAF37B0AB0FAEB086BB5F1/responsive_peak/images/icon_anonymous_message.png)