Introduction
If you are using PowerShell to automate tasks in ConfigMgr (and you should be) you may receive a warning when running a ConfigMgr cmdlet (in a script) such as the one below if you had previously installed the Configuration Manager CmdLet Library.
WARNING: An update to the System Center 2012 Configuration Manager Cmdlet Library is available. Please go to ‘http://go.microsoft.com/fwlink/?LinkId=528947’ to download the latest version. Running cmdlet version: 5.0.8231.1004 Latest cmdlet version: 5.0.8249.1128
The script used above is pasted below
# windows-noob.com September 2015
#
# Connect to ConfigMgr
#
$CMDrive=”C:”
$SiteCode=”P01:\”
Import-Module $CMDrive’\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1′
#Set-Location $SiteCode
cd $SiteCode
# get info about the site..
Get-CMSite
Problem
When the PowerShell cmdlets library was removed from Cumulative Updates in ConfigMgr (CM12 R2 CU5) in it’s place the System Center Configuration Manager Cmdlet Library was released on April 13th, 2015 and it has the ability to check for new updates and inform you that they are available (daily).
The warning above is simply informing you that an update is available and you should install it to keep current. If you are curious about how many cmdlets you have currently try running the below PowerShell code after connecting to ConfigMgr. The result I got on my CM12R2SP1CU1 site was 622.
get-command -module ConfigurationManager | measure-object
Solution
To install the new update and get the new cmdlets go to https://www.microsoft.com/en-us/download/details.aspx?id=46681 and download the latest version.
Select the files you want to download and run the MSI once downloaded.
When you see the welcome to the System Center Configuration Manager Cmdlet Library Setup Wizard click next.
After clicking next, you’ll see an Important Installation Information window (shown below) about Usage Data being collected (this option is enabled by default). There is no option in the wizard to change this.
If you are concerned about the data being automatically collected then set the following reg keys on every computer you intend to use the Cmdlets on, prior to running. The first key opts out of Usage Data for the drive provider the second one opts out of Usage Data for the cmdlets.
To fully opt out you need to set these two registry key values, one for each of the Event Tracing for Windows (ETW) providers:
- HKLM\Software\Microsoft\ConfigMgr10\PowerShell\Microsoft.ConfigurationManagement.PowerShell.Provider:CeipLevel=0
- HKLM\Software\Microsoft\ConfigMgr10\PowerShell\Microsoft.ConfigurationManagement.PowerShell.Cmdlets:CeipLevel=0
and close PowerShell ISE before continuing,
Once it is complete you can start using the updated Cmdlet library. But before doing so check the count of cmdlets
get-command -module ConfigurationManager | measure-object
The result after the upgrade is 634 !
well that’s all for now, until next time, adios !
Related reading
- https://www.niallbrady.com/2015/04/15/system-center-2012-configuration-manager-cmdlet-library-has-been-released/
- The System Center Configuration Manager Cmdlet Library – https://technet.microsoft.com/en-us/library/dn958404
cheers
niall
Pingback: New PowerShell update available for the System Center Configuration Manager Cmdlet Library | just another windows noob ?
Pingback: Turn off CM PowerShell update warnings | Keith's Consulting Blog