ConfigMgr PowerShell Cmdlet Library - September 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.
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 utilize:
19 Sep 2015
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.
Get-CMSiteSystemServer -SiteSystemServerName dp.contoso.com | Add-CMMulticastServicePoint
Add-CMObjectSecurityScopeThis 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.
Get-CMApplication -Name ContosoApp | Add-CMObjectSecurityScope -Name Staff
$app = (Get-CMApplication | Convert-CMApplication) $resultObject = ($app | Convert-CMApplication)
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.
Get-CMMulticastServicePoint -SiteSystemServerName dp.contoso.com | Remove-CMMulticastServicePoint -Force -RemoveWds
Remove-CMObjectSecurityScopeThis 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.
Get-CMApplication -Name ContosoApp | Remove-CMObjectSecurityScope -Name Staff -Force
Remove-CMSiteRoleThis 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.
Get-CMSiteRole -SiteSystemServerName MySite.contoso.com -RoleName "Contoso Special Role" | Remove-CMSiteRole -Force
Get-CMMulticastServicePoint -SiteSystemServerName dp.contoso.com | Set-CMMulticastServicePoint -StartUdpPort 64000 -EndUdpPort 64999We look forward to seeing what you can do with the new Cmdlets but again make sure you go over your old scripts 🙂
Keep Up To Date - Join The Mailing List
The team are here to help
If there are any questions and want to learn more about PowerON’s services or Solutions, please get in touch and a member of the team will be in touch shortly.