Table of Contents
Introduction
If you want to run scripts in Powershell for managing your SCCM environment, you will find that they are not available by default on your client.
This blog post covers how to import the Configuration Manager module for Powershell.
What is the Powershell module in SCCM (MEMCM)
The Powershell module for SCCM contains many CMDlets, which lets you manage your environment through Powershell.
If you wish to create scripts to automate your daily tasks, the Powershell CMDlets is a must.
How to import the SCCM (MEMCM) Powershell module
To use the Powershell CMDlets, you need to import the Configuration Manager Powershell module.
Run this command from an elevated Powershell prompt on the server where SCCM is installed. Search for Powershell in Windows -> Right-click -> Run as administrator
Import-Module (Join-Path $(Split-Path $env:SMS_ADMIN_UI_PATH) ConfigurationManager.psd1)
You can also browse to the SCCM installation directory, which by default is C:\Program Files (x86)\Microsoft Endpoint Manager\AdminConsole\bin
Enter the below command:
Import-Module Confiugurationmanager.psd1
How to run cmdlets from the SCCM Powershell module
Once you have imported the module in Powershell, you will need to set the location to the Powershell drive of the MEMCM (SCCM) site server. This is the site code of the primary site.
The easiest way to do this is by running the below commands, either manually or in a script:
$SiteCode = Get-PSDrive -PSProvider CMSITE
Set-Location -Path "$($SiteCode.Name):\"
How to start Powershell from the SCCM Console
Another alternative that you can use is to run Powershell from the Configuration Manager console.
Press the down arrow and Connect via Windows Powershell.

Once the Powershell window is open, it will automatically set the location to the MEMCM (SCCM) site.

Conclusion
Using Powershell to manage MEMCM (SCCM) is a must in most cases. When doing anything in bulk, it is simply not possible to use the console.
I hope this blog post was informative to you. Please leave any suggestions for improvements in the comments section.
Thanks!
Suggested Resources
- Pluralsight – Administering SCCM Current Branch and Intune integration
- Get started with ConfigMgr cmdlets
Easier way to do that is this:
Import-Module (Join-Path $(Split-Path $env:SMS_ADMIN_UI_PATH) ConfigurationManager.psd1)
This way I don’t care and need to know where my console is installed.
Thanks David! I updated the post 🙂
Thank You David
Than You David Çok Güzl
this is very very good david