Skip to content

JamfPSPro is a PowerShell module that aims to bring cli tools for the Jamf API.

License

Notifications You must be signed in to change notification settings

TrustyTristan/JamfPSPro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JamfPSPro

Minimum Supported PowerShell Version Cross Platform License

Build Status Windows PowerShell Core
Build Status Linux
Build Status MacOS

Description

JamfPSPro is a PowerShell module that aims to bring cli tools for the Jamf API, can use both Classic API and Jamf Pro API.

Warning

Most things seem to be working most of the time.

Getting Started

Installation

# how to install JamfPSPro
Install-Module -Name JamfPSPro -Repository PSGallery -Scope CurrentUser

Quick start

Example

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 : {...}

JamfPSPro Cmdlets

Connects to JamfPro

Retrieve data from Jamf Pro.

EXAMPLE

Get-Jamf -Component computers -Select all
Retrieves all available information for computers in Jamf Pro.

Create a new resource or record in Jamf Pro.

EXAMPLE 1

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.

EXAMPLE 2

$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.

EXAMPLE

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.

EXAMPLE 1

<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

EXAMPLE 2

$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

To Do

  • Get schema... would ideally get the schema for post/put in PSObject format.

Contributing

If you'd like to contribute to JamfPSPro, please see the contribution guidelines.

License

JamfPSPro is licensed under the MIT license.

Author

Tristan Brazier

About

JamfPSPro is a PowerShell module that aims to bring cli tools for the Jamf API.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published