SCCM Module for PowerShell

In a post a few days ago I mentioned “some slightly modified functions from Michael Niehaus“.

Well… Why not share them.

Save this as a module, load it and play around.

2010-03-26 – Moved to http://www.snowland.se/sccm-posh/

Some examples on what you can do:

# List all available SCCM commands
Get-SCCMCommands

# Create an SCCM-Connection to the local server
$sccm = Connect-SCCMServer -Verbose

# Create a new collection with a collection rule
$newCollection = New-SCCMCollection -SccmServer $sccm -name "Some Collection Name" -Verbose
Add-SCCMCollectionRule -Server $sccm -collectionID $newRoot.CollectionId -queryExpression "SELECT * FROM SMS_R_System" -queryRuleName "All Systems" -Verbose

# Count files in the inboxes
$sccm | Get-SCCMInboxes

# Get a package
$MyPackage = Get-SCCMPackage -server $sccm -filter "Name = 'Some Package Name'" 

If you have some comments, ideas and things to add… Comment this post or shoot me an email.

7 comments

  1. riro

    Update: Fixed some small bugs and added limitToCollectionId in Add-SCCMCollectionRule

  2. Pingback: SCCM 2007 PowerShell Module | MajhiAai
  3. Pingback: SCCM 2007 PowerShell Module | LookYP
  4. francisco

    do you know how to run a deployment package with powershell?
    thanks

  5. riro

    Hi francisco, Im not sure I understand what you want to do…

    Do you, from a client, want to run all available programs (advertisements)?

  6. Pingback: Stefan Ringler’s SystemCenter Blog! - » SCCM Powershell Modules
  7. Pingback: Some PowerShell SCCM links « The Wiert Corner – irregular stream of Wiert stuff

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>