cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

I have been getting a lot of mileage out of this script template

RBaconJC
Community Manager Community Manager
Community Manager

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)"

	}

}
2 REPLIES 2

dagryph
Novitiate III

YES!!!! Community can definitely get some mileage out of this too, I know I can. Thank you Ryan!!!

BScott
Community Manager Community Manager
Community Manager

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.