cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.

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.

You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.