title: How to export Hyper-V VM remotely
body: <p>I'm trying to write a powershell script that will allow users to export a VM from a Hyper-V host to a network share without allowing users access to the Hyper-V host server.  The script would be run from a 2008/2012 R2 server or perhaps a windows workstation, against a 2012 R2 Hyper-V host that will export a VM off to a share on another 2012 R2 server.  Exporting to the host itself first is not an option due to lack of available disk space.  </p>
  
  <p>From the host server, running powershell as administrator, I am able to successfully run the export command: <em>Export-VM -Name My_VM -Path "\Server\Share"</em>  and everything 'just works.'  </p>
  
  <p>​However trying to run this from a script or shell on another server with Invoke-Command or a PSSession​ results in "Failed to create export directory with error 'General access denied error '(0x80070005)..." 
  All the solutions I've found so far are only applicable to running the command directly from the host, not remotely.</p>
  
  <p>Has anyone been able to remotely export a Hyper-V VM to a network share?</p>