Opening/Upgrading SCCM 2012 R2 PowerShell
Nothing truly new here, but it is a new year and a new environment for me. I’ve just sat down at my seat at a customer’s location and wanted to inventory a bunch of things inside their System Center Configuration Manager 2012 R2 CU3 environment. Regardless it’s older and we’re in the process of migrating to Configuration Manager 2016! Exciting times ahead! In any case, I installed the Configuration Manager 2012 R2 console on my Windows 7 laptop (64-bit). See where things are going. We’re not running the latest and greatest… yet 😉
I am glad blogs aren’t real time! I had to come back up and add this paragraph. I highly suggest if you’re not able to work on a Windows 10 or Server 2016 machine that you upgrade your PowerShell to version 5! Two simple upgrades to the Windows Management Framework will get you there. Yes, they do require reboots.
- Windows Management Framework 4.0 – https://www.microsoft.com/en-ca/download/details.aspx?id=40855
- Windows Management Framework 5.0 – https://www.microsoft.com/en-us/download/details.aspx?id=54616 and some info if installing on downlevel OSes – https://blogs.msdn.microsoft.com/powershell/2017/01/19/windows-management-framework-wmf-5-1-released/
Normally when I’m wanting to work with PowerShell and SCCM, I already have the SCCM Console open, so the easiest way to get into PowerShell with access to the SCCM module is to click the blue drop down arrow at the top of the SCCM console and click Connect via Windows PowerShell.
For some reason, this wasn’t working for me. So I ended up going the long winded way. This entails opening PowerShell and manually importing the SCCM module.
Import-Module “C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1”
Upon doing that, I was notified that there were some updated System Center Configuration Manager Cmdlets, so off to the suggested link and
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.8373.1189
I closed, PowerShell, updated the PowerShell CmdLets via the download above, reimported the module and off to the races I went!