JamfPSPro is a PowerShell module that aims to bring cli tools for the Jamf API, can use both Classic API and Jamf Pro API.
Most things seem to be working most of the time.
# how to install JamfPSPro
Install-Module -Name JamfPSPro -Repository PSGallery -Scope CurrentUser
PS > Connect-JamfPro -Server server.jamfcloud.com -Credential $PSCredential
Account Access Server Build Expires
------- ------ ------ ----- -------
UserName FullAccess trusty.jamfcloud.com 10.69.420 19/9/2023 4:20:00 pm
PS > Get-Jamf -Component computers -Select NAME -Params 'macbookpro'
general : @{...}
location : @{...}
peripherals : {}
hardware : @{...}
certificates : {...}
security : @{...}
software : @{...}
extension_attributes : {...}
groups_accounts : @{...}
iphones : {}
configuration_profiles : {...}
Connects to JamfPro
Retrieve data from Jamf Pro.
Get-Jamf -Component computers -Select all
Retrieves all available information for computers in Jamf Pro.
Create a new resource or record in Jamf Pro.
New-Jamf -Component computers -Select 'ID/recalculate-smart-groups' -Param 420
Recalculates the smart group for the given computer id and then returns the count of
smart groups the computer falls into.
$NewScript = [PSCustomObject]@{
'script' = @{
'name' = 'Supa script';
'category' = 'Testing';
'info' = 'Script information';
'notes' = 'Created 20230420';
'priority' = 'Before';
'parameters' = @{
'parameter4' = 'Some input';
}
'os_requirements' = '10.15';
'script_contents' = '#!/bin/
echo "Are you there?'
}
}
New-Jamf -Component scripts -Select ID -Params 999 -Content $NewScript
Creates a script 'Supa script', an ID must be supplied but will use next ID.
Remove an existing resource or record from Jamf Pro.
Remove-Jamf -Component computers -Select ID -Params 69
Removes the computer with the ID 69
Update or modify an existing resource or record in Jamf Pro.
<name>Blazing Script</name></script>"
Set-Jamf -Component scripts -Select ID -Param 420 -Content $UpdatedScript
Changes the name of the script with the ID 420
$Update = [PSCustomObject]@{
'computer_group' = @{
'name' = 'The Plastics';
}
}
Set-Jamf -Component computergroups -Select ID -Param 69 -Content $Update
Changes the name of the computer group with the ID of 69
- Get schema... would ideally get the schema for post/put in PSObject format.
If you'd like to contribute to JamfPSPro, please see the contribution guidelines.
JamfPSPro is licensed under the MIT license.
Tristan Brazier