SCCM Powershell module not importing

Biswajeet Kumar 116 Reputation points
2021-04-02T15:50:15.32+00:00

Hi,

I am trying to import sccm module to powershell using the cmdlets:

cd 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager'; 
Import-Module .\ConfigurationManager.psd1; CD ING:

'ING' is the site code. But its giving error "A drive with the name ING does not exist".

So I tried to create it by using

New-PSDrive -Name "ING" -PSProvider "AdminUI.PS.Provider\CMSite" -Root "contoso" -Description "Primary site"
CD ING:

But nothing happens, still gives the same error.

Thanks

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,363 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,651 Reputation points Microsoft Vendor
    2021-04-05T02:12:51.75+00:00

    Hi,

    Did the New-PSDrive cmdlet return the ING drive? You can list the drives using Get-PSDrive.

    You can also try "Connect via Windows Powershell" from the Configuration Manager console. It should set the location to the drive supported by the CMSite provider.

    84260-image.png

    Please refer to this link for more details
    https://learn.microsoft.com/en-us/powershell/sccm/overview?view=sccm-ps

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Biswajeet Kumar 116 Reputation points
    2021-04-05T03:59:51.057+00:00