Error connecting to the Primary Site

Error connecting to the Primary Site

When using a service account to run for instance my “cleaning ConfigMgr” Powershell script you may run in to an error. When trying to access the Windows PowerShell drive that is mapped to your Primary Site you will receive the following error: “set-location : Cannot find drive. A drive with the name <primary site> does not exist.” (see figure on the left) I see the same behavior when for instance running a Powershell script from System Center Orchestrator 2012 to change settings in Configuration Manager 2012 SP1.

After some troubleshooting I found out that for some reason the mapping does not exist when using the service account. In my case the service account had sufficient permissions on the Primary Site Server and within the Configuration Manager 2012 Primary Site. So that couldn’t be an issue but to be sure I started the Configuration Manager 2012 Console with the permissions of the service account.

Run the console as a different user (Service Account)

Run the console as a different user (Service Account)

Steps to workaround this issue:

  1. Create a brand new service account
  2. Give the Service Account the permissions you want in Configuration Manager 2012
  3. Use Run As Different User with the Service Account when starting the Configuration Manager 2012 Console
  4. Close the console
  5. Run the script using the service account permissions

 

Connecting to the Primary Site using the Service Account

Connecting to the Primary Site using the Service Account

 

I requested more information about this issue, so I will keep you posted.

Comments