web analytics

How to start Configuration Manager PowerShell session

Prerequisites:

  1. Windows Server 2012 or Windows Server 2008 R2 with Windows Management Framework 3.0
  2. System Center 2012 Configuration Manager SP1 RTM

To start Configuration Manager PowerShell session using Configuration Manager Console

  1. Run the Configuration Manager Console
  2. In the Configuration Manager Console, click on the blue rectangle and select Connect via Windows PowerShell
  3. Configuration Manager imports the PowerShell module automatically
  4. Now you are ready to manage your Configuration Manager infrastructure

To start Configuration Manager session from PowerShell

Start the 32-bit PowerShell Console. If you have Windows Server 2008 R2 server, then click on Start and type into search box: Windows PowerShell and run the Windows PowerShell(x86).

If you have Windows Server 2012, then press Windows Key + F and search Windows PowerShell and choose Apps. From the search list select the Windows PowerShell(x86)

To import the Configuration Manager PowerShell module, we need to change the location to Configuration Manager Console installation folder. In this example I have installed it to C:\Program Files(x86).

Type the following commands in PowerShell Console

  1. C:
  2. cd ‘.\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin’
  3. Import-Module .\ConfigurationManager.psd1
  4. Set-Location XXX:
  5. Now you are ready to manage your Configuration Manager infrastructure

PowerShell Drive Provider

The Configuration Manager PowerShell module includes also PowerShell Driver Provider for Configuration Manager Sites. For example, if you have a Central Site Administration Site CAS and two Primary sites PR1 and PR2, then you can change the connection context like this:

  • CD CAS:
  • CD PR1:
  • CD PR2:

If you don´t change the connection context, then you can´t manage the Configuration Manager Site also.