PowerShell drive alias for ConfigMgr only remembered for administrative users

Viewed 11

I have a Windows Server 2022 host running ConfigMgr 2207 where several accounts use PowerShell to manage ConfigMgr. As per Import the Configuration Manager PowerShell module, we import the module as follows:

Import-Module (Join-Path $env:SMS_ADMIN_UI_PATH '..\ConfigurationManager.psd1')

and then create the PSDrive:

New-PSDrive -Name XYZ -PSProvider CMSite -Root host.domain.com -Description 'Primary site'

Accounts that have local administrator rights on the server only need to create the PSDrive once. Subsequent PowerShell sessions remember the drive after importing the module.

However, accounts that do not have local administrator rights do not remember the PSDrive after creating it when importing the module in a new session. The PSDrive must be recreated every time PowerShell is restarted.

What is the cause of this and can it be fixed?

0 Answers
Related