ConfigMgr PowerShell Cmdlet Library – Update

Microsoft Just announced there is an update to the System Center Configuration Manager PowerShell Cmdlets, see original announcement.

This week, we were going through some of our System Center Configuration Manager PowerShell code which was working perfectly. Although after the update the same code was putting up a few unexpected errors or warning messages,  this was because after the update to the PowerShell Cmdlets some of the parameters have changed. This can be simple to troubleshoot, we found that these changes however, were not represented within the help as most of the CM cmdlet help documents are at least a year old.

For example the Cmdlet New-CMSiteSystemServer parameters have changed, a line of code for New-CMSiteSystemServer would look like the following:

New-CMSiteSystemServer -ServerName SCCM02 -SiteCode PON

However, since this was written the parameter “-ServerName” has changed to “-SiteSystemServerName” meaning the line of code is now the following:

New-CMSiteSystemServer -SiteSystemServerName SCCM02 -SiteCode PON

So we recommend after installing the PowerShell Cmdlets to test your old scripts to make sure they are functioning as you expect.

Download the Cmdlets

The following versions of Configuration Manager are supported in this release:

  • System Center 2012 Configuration Manager SP2
  • System Center 2012 R2 Configuration Manager
  • System Center 2012 R2 Configuration Manager SP1

To install the System Center Configuration Manager Cmdlet Library:

  • Download ConfigMgr2012PowerShellCmdlets.msi from the Microsoft Download Center.
  • After the download completes, double-click ConfigMgr2012PowerShellCmdlets.msi to run the setup wizard.
  • Follow the instructions in the setup wizard to install the System Center Configuration Manager Cmdlet Library.
  • After the installation completes, you are ready to use the PowerShell cmdlets in the System Center Configuration Manager Cmdlet Library.

I recommend downloading both files ConfigMgr2012PowerShellCmdlets.msi and ConfigurationManagerCmdletLibraryReleaseNotes.docx as the release notes will give you valuable information regarding the updated Cmdlet library release. The type of information within the notes is:

  • Known Issues
  • New Cmdlets
  • Cmdlet changes

Throughout the document, it will also discuss Bug fixes, deprecations, and non-breaking changes.

Here is an extract of the new Cmdlets you can start to utilise:

New cmdlets

These are newly added cmdlets for this release that add new functionality or enhance the functionality of existing cmdlets.


Add-CMMulticastServicePoint

This cmdlet adds a multicast service point role to a distribution point. This is the equivalent of enabling Multicast options for a distribution point in the administrator console. This cmdlet will fail if there is not already a distribution point present on the targeted site server.

Example

Get-CMSiteSystemServer -SiteSystemServerName dp.contoso.com | Add-CMMulticastServicePoint

Add-CMObjectSecurityScope

This cmdlet adds one or more security scopes to an existing object. This cmdlet supersedes the Set-CMObjectSecurityScope cmdlet and any cmdlets that support SecurityScopeName/SecurityScopeAction parameters.

Example

Get-CMApplication -Name ContosoApp | Add-CMObjectSecurityScope -Name Staff

Convert-CMApplication

This cmdlet can perform the functionality of ConvertTo-CMApplication or ConvertFrom-CMApplication.
Example

$app = (Get-CMApplication | Convert-CMApplication)
$resultObject = ($app | Convert-CMApplication)

Get-CMMulticastServicePoint

Gets multicast service point roles for the site. 

Get-CMObjectLockDetails

Gets the details about a locked object, including the owner and other details.


Remove-CMMulticastServicePoint

Removes a multicast service point role from a distribution point. Note that Windows Deployment Services is not removed unless the RemoveWds parameter is specified. This is the equivalent of disabling Multicast options for a distribution point in the administrator console.

Example

Get-CMMulticastServicePoint -SiteSystemServerName dp.contoso.com | Remove-CMMulticastServicePoint -Force -RemoveWds

Remove-CMObjectSecurityScope

This cmdlet removes one or more security scopes from an existing object. This cmdlet supersedes the Set-CMObjectSecurityScope cmdlet and any cmdlets that support SecurityScopeName/SecurityScopeAction parameters.

Example

Get-CMApplication -Name ContosoApp | Remove-CMObjectSecurityScope -Name Staff -Force

Remove-CMSiteRole

This cmdlet can be used to remove any site role from a site server. This cmdlet should be used with great care as it may remove critical site roles.

Example

Get-CMSiteRole -SiteSystemServerName MySite.contoso.com -RoleName "Contoso Special Role" | Remove-CMSiteRole -Force

Set-CMMulticastServicePoint

Configures multicast service point options.

Example

Get-CMMulticastServicePoint -SiteSystemServerName dp.contoso.com | Set-CMMulticastServicePoint -StartUdpPort 64000 -EndUdpPort 64999

We look forward to seeing what you can do with the new Cmdlets but again make sure you go over your old scripts 🙂

Share on Facebook
Share on Twitter
Share on LinkedIn

Related blogs