web analytics

Blog

Configuration Manager 2012 SP1 and R2 PowerShell Provider

Posted by:

As you might have already noticed that Configuration Manager PowerShell Provider is lot like Active Directory, Registry etc. provider. To run a cmdlet you need to be inside CMSITE.

If you are still using SP1+, then:

1. you can´t use New-Item cmdlet to create folders

2. you can´t set the location to sub folders

3. Get-ChildItem does not work at all

If you are using R2+, then

1. You can use New-Item to create folders

2. You can change the location i.e. sub folders etc.

3. Get-ChildItem only prints out folder objects but not collections, applications etc. inside the folder

Here are the different versions of Configuration Manager 2012

Configuration Manager version 
New-Item  Set-Location  Get-ChildItem 
Configuration Manager 2012 Service Pack 1  N/A  N/A  N/A 
Configuration Manager 2012 Service Pack 1 with CU1  N/A  N/A  N/A 
Configuration Manager 2012 Service Pack 1 with CU2  N/A  N/A  N/A 
Configuration Manager 2012 Service Pack 1 with CU3  N/A  N/A  N/A 
Configuration Manager 2012 Service Pack 1 with CU4  N/A  N/A  N/A 
Configuration Manager 2012 R2  Yes  Yes  Yes 
Configuration Manager 2012 R2 with CU1  Yes  Yes  Yes 
Configuration Manager 2012 R2 with CU2  Yes  Yes  Yes 
Configuration Manager 2012 R2 with CU3  Yes  Yes  Yes 
Configuration Manager 2012 R2 with CU4 Yes  Yes  Yes 

 

If do automation against the Configuration Manager and you are using Configuration Manager PowerShell module cmdlets, then I recommend that you upgrade to latest version with CU´s. Last four Cumulative Updates for R2 release has been really good for Configuration Manager PowerShell module.

Configuration Manager 2012 SP1

New-Item cmdlet

New-Item cmdlet just fails

clip_image002

Set-Location cmdlet

You can´t set the location to sub folders

clip_image004

Configuration Manager 2012 R2

New-Item works

You can create admin console folders

clip_image006

Get-ChildItem works partially

Get-ChildItem only prints out folders but not the folder content

clip_image007

Set-Location

Intellisense in R2 version is much better. You can see the root folders and also sub folders.

clip_image008



About the Author:

Kaido Järvemets is a developer, consultant, trainer specializing in Microsoft System Center Configuration Manager and PowerShell Solutions at Coretech. Kaido frequently speaks at European conferences and had his US debut as speaker at MMS April 2013. Kaido is well-known in the Configuration Manager communities where he’s a key player in the PowerShell game. Kaido host one of the most complete Configuration Manager PowerShell library’s in the world with hundreds of free code samples ready to download and implement – www.cm12sdk.net. Kaido has been awarded Microsoft Most Valuable Professional (MVP) in Microsoft Enterprise Client Management for his work with Configuration Manager from 2011 – to present. Kaido is the founder of System Center User Group Estonia in 2011.

Add a Comment