title: drive mapped with powershell system user not accessible to others
body: <p>I'm trying to map a drive to another server using a "system" account in powershell.  I am successful but then the server is only accessible if logged in as system, but not as administrator or regular user.</p>
  
  <p>If I map it using an administrator powershell or dos command shell, then it is available to everyone.  Unfortunately I cannot do that because I am using Amazon Web Service (AWS) SendCommand feature to do the mapping and it only uses the system level powershell.  Even if I put the mapping command within a batch file and have it run that, the mapped drive still is only available to system powershell user.</p>
  
  <p>Here is an example of the two commands that are sent via AWS SendCommand:</p>
  
  <pre><code>cd "C:/Program Files/Enventive/EnCOM Listener 1.0/lib/"
  start-process "cmd.exe" "/c MapNetworkDrive 172.31.26.59"
  </code></pre>
  
  <p>The batch file does a net use command like this:</p>
  
  <pre><code>net use D: \\%1\Company /USER:Administrator /PERSISTENT:YES "&lt;password&gt;"
  </code></pre>
  
  <p>Is there any way to have a drive mapped by a system level powershell be available to all users?</p>
  
  <p>I have also tried the following method from within a system level powershell but got the same result:</p>
  
  <pre><code>$user = "Administrator"
  $pass = ConvertTo-SecureString -String '&lt;password&gt;' -AsPlainText -Force
  $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$pass
  New-PSDrive -Name D -PSProvider FileSystem -Root \\172.31.26.59\Company -Credential $cred -Persist
  </code></pre>
  
  <p>After doing this the D: drive was available from within the system level powershell, but not from a DOS command shell or Administrator level powershell</p>