PowerShell Module Cheat Sheet
PowerShell Module Cheat Sheet
PowerShell Module Cheat Sheet
Working With Users Working with Systems Working with Groups Import & Backup
Add a single user Get all systems in JumpCloud Get system and user groups Backup all users to a CSV
New-JCUser -firstname Get-JCSystem Get-JCGroup Get-JCBackup -Users
Clarence -lastname
Clemons -username Add a standard user to a Get all system groups Create a CSV Import
cclemons -email Get-JCGroup Template
system by ID
[email protected] -Type System New-JCImportTemplate
Set-JCSystemUser
-SystemID
Update a user by username 5n0795a712704la4eve154r Get all user groups Import users from CSV
Set-JCUser -username -Username cclemons Get-JCGroup Import-JCUsersFromCSV
cclemons -email -Administrator $False -Type User -CSVFilePath ~/users.csv
[email protected]
Add an administrator user to a Add a JumpCloud user to a
Unlock a locked user account system by ID user group Help and Tips
Set-JCUser -Username Set-JCSystemUser Add-JCUserGroupMember
cclemons -account_locked -SystemID -Username cclemons Need Help? Typing “help”
$false 5n0795a712704la4eve154r -GroupName 'The Band' before any command will
-Username cclemons display contextual help.
Delete a user by username -Administrator $True Add a JumpCloud system to a Help New-JCUser
Remove-JCUser cclemons system group Help Set-JCUser
Rename a system’s display Add-JCSystemGroupMember Help Get-JCSystem
Enforce MFA by username name by ID -GroupName 'win_systems’
and set enrollment timeout to Set-JCSystem -SystemID -SystemID Access online help
14 days 5n0795a712704la4eve154r 59dad305383roc7k369sf7s2 Help New-JCUser -Online
Set-JCUser -Username -displayName
cclemons Clemons-macBook
-enable_user_portal_multi Command Gallery:
factor $True The JumpCloud Command Gallery contains pre-built and
-enrollmentdays 14 importable commands for Linux, Mac and Windows systems.
In PowerShell, the Pipeline operator sends the output of one Get active systems and add those system to the
command to the next command. “ActiveSystems” system group
Command-1 | Command-2 | Command-3 Get-JCSystem -active $true | Add-JCSystemGroupMember
Command-1’s output is sent to Command-2 and finally, -GroupName ActiveSystems
Command-2’s output is sent to Command-3. The JumpCloud
Powershell Module allows admins to use the pipeline operator Create two new system groups with the foreach command
to automate complex management tasks. 'MarketingMachines', 'SalesMachines' | Foreach
{New-JCSystemGroup $_}
Advanced User Commands Get all Mac systems and enable MFA on each system
Get-JCSystem -os *Mac* | Select-Object _id |
Get all locked user accounts and unlock them Set-JCSystem -allowMultiFactorAuthentication $true
Get-JCUser -account_locked $true |
Set-JCUser -account_locked $false Get all systems with duplicated serial numbers
Get-JCSystem | Group-object serialNumber |
List all users not bound to a user group Where-Object Count -GT 1
Get-JCUser |
Where-Object {$_.Id -notin (Get-JCAssociation Get all systems where username cclemons is bound as a user
-Type:('user') -Id:($_.Id) Get-JCSystem | Get-JCSystemUser | ? Username -EQ
-TargetType:('user_group')).id} | cclemons
Select-Object username
Export a list of systems created in the last 30 days to a .CSV file
Get all users who have their Department attribute set to Sales, Get-JCSystem -filterDateProperty created -dateFilter
select their usernames and add those users to the Sales user after -date (Get-Date).AddDays(-30) -returnProperties
group hostname, os, version | Export-CSV
Get-JCUser -department Sales | Select-Object username NewSystemsPast30.csv
| Add-JCUserGroupMember -GroupName Sales