Mark Minasi's Tech Forum
Register Calendar Latest Topics Chat
 
 
 


Reply
  Author   Comment  
JouniJ

Still Checking the Forum Out
Registered:
Posts: 1
Reply with quote  #1 

What i am trying to do is to import an exported Hyper-v machine from network share using Powershell command:

invoke-command -ComputerName MACHINETOIMPORT -Credential admin@domain.local -ScriptBlock {Import-VM -Path "\\FILESERVER\SHARE$\machinetoimport\Virtual MAchines\xxxxxxx.vmcx" -Copy -GenerateNewID

As you can see i try to use PSRemoting functions for importing. Above command produces Access is Denied error. I have allready modified share and ntfs permissions Full Control for target Computer Accounts im am going to import Virtual Machine to.

If I copy exported machine to local disk, it can be imported with no problems. I would prefer to import form Network share becouse that way i save hours of copying files to local disk first.

0
donoli

Senior Member
Registered:
Posts: 505
Reply with quote  #2 
http://hyper-v-backup.backupchain.com/how-to-easily-move-vhd-vhdx-to-new-server-disk-nas-cloud/

I'm not sure if that will help.
0
Infradeploy

Avatar / Picture

Senior Member
Registered:
Posts: 166
Reply with quote  #3 
The problem with that approach is that in a remote powershell session you can't use resources from other servers because the season by default does not allow you to forward the authentication. http://powershell.org/wp/kb/the-double-hop-authentication-problem/
__________________
Have SpaceSuit, Will Travel

0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 226
Reply with quote  #4 
...so basically, you will need to pass appropriate admin credentials to the Import-VM cmdlet as well. Create an account, give it permissions to access the shares, set the password to not expire if you wish, then capture the credentials into a secure string and the use that secure string in the script block.
__________________
Evgenij Smirnov

My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.