This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $JCAPIKey = '' # Enter API Key here | |
| $StartDate = (Get-Date(Get-Date).AddDays(-1) -Format s) | |
| $EndDate = (Get-Date -Format s) | |
| $hdrs = @{"X-API-KEY" = "$JCAPIKey"} | |
| $EventsAPI = "https://events.jumpcloud.com/events?startDate=$StartDate`Z&endDate=$EndDate`Z" | |
| $events = Invoke-RestMethod -Method GET -Uri $EventsAPI -Header $hdrs | |
| # To output to a file run the below command | |
| $events | ConvertTo-Json | Out-File EventsData.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $UserGroups = @( | |
| "All Users", | |
| "Default Admin", | |
| "Developers", | |
| "Sales", | |
| "Accounting" | |
| ) | |
| $UserGroups | % { New-JCUserGroup -GroupName $_} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Ensures that script is run as ROOT | |
| if [[ "${UID}" != 0 ]]; then | |
| (echo >&2 "Error: $0 script must be run as root") | |
| exit 1 | |
| fi | |
| # Ensures that the system is not domain bound | |
| readonly domainBoundCheck=$(dsconfigad -show) | |
| if [[ "${domainBoundCheck}" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| : ' | |
| Script to rename the username of a user account on MacOS | |
| The script updates the users record name (username), RealName (displayName), and home directory | |
| If the user receiving the name change is signed in they will be signed out. | |
| Example usage: sudo sh RenameMacUserNameAndHomeDirectory.sh cat dog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Change 'Students' to the JumpCloud User Group you want to query | |
| #Outputs the membership in 'FirstName LastName' syntax instead of the 'Username' | |
| #An API call is done for each group member so this may take some time depenindg on the size of the group | |
| #Tested on PowerShell core version 6.0.1 | |
| Get-JCUserGroupMember -GroupName 'Students' | Select-Object GroupName, @{name = 'FullName'; Expression = {(Get-JCUser -Username $_.Username | Select-Object @{Name ='FullName'; Expression = {"$($_.Firstname) $($_.LastName)"}})}} | Select-Object GroupName, @{Name = 'FullName'; Expression={ ($_.FullName.FullName)}} |
NewerOlder