paulwetter / DocumentConfigMgrCB

This script attempts to document your entire Configuration Manager (MEMCM/SCCM) environment
https://wetterssource.com/documentconfigmgrcb
174 stars 45 forks source link

Abort script on PSDrive #65

Closed dokh closed 3 years ago

dokh commented 3 years ago

Tried the script, but it aborts at the #CM12 cmdlets need to be run from the CM12 drive section. I must admit I did not set up SCCM v1910 that we have, so not sure why it does not find that PSDrive. $SiteCode was found correctly.

Any suggestions?

ChadSimmons commented 3 years ago

If you open a PowerShell console, can you change to the ConfigMgr Site drive? If not, try running this, then run the script again.

Import-Module ($Env:SMS_ADMIN_UI_PATH.Substring(0, $Env:SMS_ADMIN_UI_PATH.Length - 5) + '\ConfigurationManager.psd1') New-PSDrive -Name -PSProvider cmsite -Root

dokh commented 3 years ago

Thanks Chad. That did it. Hopefully without to much impact on the whole SCCM system. Just added the after -Name .

Regards, Koen