add_admin
Description
Add a provided account as a site server admin. This is useful for the scripts module where SCCM is configured to require a secondary account for script approval (default setting). The account type is not limited to a traditional user account and can be a machine.Usage
Example
delete_admin
Description
Remove a target administrator account from SCCM. Note: cannot be performed against itself.Usage
show_admins
Description
Show the current SCCM admin accounts.Usage
Example
show_rbac
Description
List users and their roles within the SCCM RBAC system.Usage
show_consoleconnections
Description
List console sessions and their source connections.Usage
Script Management Commands
script
Description
Execute a provided PowerShell script on a target host. The script is intended to be self-deleting from the remote host as well as from the site database. If the hierarchy is configured to require script approval (default) alternate credentials must be specified to approve the script. Alternate credentials can be obtained by using theadd_admin command to add a secondary account as an administrator.
Usage
Examples
Script approval not required
When script approval is not required, scripts execute directly.Script approval required
When script approval is required, you need alternate credentials. Script execution fails without alternate credentials:list_scripts
Description
List scripts stored on the SCCM server.Usage
delete_script
Description
Delete a script from the SCCM server using its GUID.Usage
CMPivot Script Management Commands
backup
Description
Performs a backup of the existing built-in CMPivot script. Required prior to any manipulation of the CMPivot script.Usage
Example
backdoor
Description
Replace the built-in CMPivot script stored in the site server database with a user supplied script. This command will not run unless a backup exists for the script to ensure the operator is able to undo/restore the backdoored script.Usage
Example
restore
Description
Restore a modified CMPivot script to its previous state.Usage
Example
Administrative tasks require appropriate SCCM permissions. Script operations may require alternate approval credentials depending on your SCCM hierarchy configuration.