export vm from powershell

Hi

I am trying to export VM from my powershell to a shre on server 2008 r2

I run the command from a remote server 2008 r2

My Virtual machine is server 2008 r2 core hyper-v role

the command:

Export-VM -server "hv1" -vm "sql01" -path \\wsus\vhdexport -force -wait

the HV1 server have full control permishon over \\wsus\vhdexport

the error I get:

Test-WMIResult : Attempt to export sql01 to \\wsus\vhdexport failed. Failed to create export directory with error 'Gene
ral access denied error'(0x80070005): sql01 (3B5B2EFD-0B7D-4EF1-BA30-22DBCD78267E)
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\hyperv\VM.ps1:27 char:113
+                 if ( ($VSMgtSvc.ExportVirtualSystem($VM.__path,($CopyState.Ispresent),$path)    | Test-wmiResult <<<<
  -wait:($wait -or $preserve) -JobWaitText ($lstr_ExportOfVm -f $vm.elementName)`
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-WMIResult

Any Idea?

Tanks

October 7th, 2010 12:14pm

Hi, are you running this from your host, or remotely ?

Are your computers in the same domain, or stand alone ?

Please check Ben`s post: http://blogs.msdn.com/b/virtual_pc_guy/archive/2010/03/15/exporting-to-importing-from-a-network-share-hyper-v.aspx

 

Free Windows Admin Tool Kit Click here and download it now
October 7th, 2010 1:57pm

Hi

 

I checked this post

all hyper-v hosts are in one domain.

I cant export nor hyper-v manager & ps as well only to a network share

Failed to create export directory with error 'Gene
ral access denied error'(0x80070005

October 8th, 2010 11:06am

To the claster shared volume (c:\claster) I can export with no problem

Is there any way to export to a network share ro debug this?

 

thanks

Free Windows Admin Tool Kit Click here and download it now
October 9th, 2010 5:34pm

Hi,

 

If you want to export Hyper-V VMs to a network share, they should be both in the same domain, you can’t export it to a network share in workgroup directly.

 

 

Best Regards,

Vincent Hu

 

  • Marked as answer by Omer Yfhar Monday, October 11, 2010 5:30 PM
  • Unmarked as answer by Omer Yfhar Monday, October 11, 2010 5:32 PM
October 11th, 2010 2:10am

Hi

as i mention before,

all my hosts and guests machine are in the same domain as well as the share computer

the hosts and the remote share computer are 2008r2

domain 2003

I am tring to export from a remote computer powershell 2008r2  to share on this computer.

tryed two of my VM and the same 'Gene
ral access denied error'

 

Free Windows Admin Tool Kit Click here and download it now
October 11th, 2010 5:34pm

Have you turned your vm off before running this script ?

Does your (Hyper-V) computer account have full access to the network share?

October 11th, 2010 5:45pm

yes.

the guests are turned off

I gave the host (HV$) full access to the network share.

BUT(!!!) the icon of the acount, where I make the share permision, seems to be a user acount icon and not a computer acount icon.

if I select a standard I det a computer acount icon.

Any idea?

Free Windows Admin Tool Kit Click here and download it now
October 12th, 2010 4:38pm

Hi

 

Just tested with another hyper-v host

the same error

October 12th, 2010 5:35pm

Please verify that the Hyper-V-Virtual Machine Management service is running under the 'LocalSystem' account on your host, and that you have added the computer account to have full permission on your share.

On your shared folder, select properties, sharing, and advanced sharing. select Permissions,  Add the object type 'computers' and find your host. You should then have "Domain\machinename$" added to you share permissions, and give it full control.

 

Free Windows Admin Tool Kit Click here and download it now
October 12th, 2010 6:18pm

Checked it again. and dobule cecked.

the service and the share are configured as you asked

is there any way it can be debuged?

October 12th, 2010 6:35pm

On your shared folder, select properties,  select security, and add your Hyper-V host here as well, and assign full control

Thanks,

Free Windows Admin Tool Kit Click here and download it now
October 12th, 2010 6:51pm

even give everyone full controll:-) no luck

on the event viewer:

An account was successfully logged on.

Subject:

Security ID: NULL SID

Account Name: -

Account Domain: -

Logon ID: 0x0

Logon Type: 3

New Logon:

Security ID: ANONYMOUS LOGON

Account Name: ANONYMOUS LOGON

Account Domain: NT AUTHORITY

Logon ID: 0x627385

Logon GUID: {00000000-0000-0000-0000-000000000000}

Process Information:

Process ID: 0x0

Process Name: -

Network Information:

Workstation Name: HV1

Source Network Address: xxx.xxx.xxx.xxx

Source Port: 55515

Detailed Authentication Information:

Logon Process: NtLmSsp

Authentication Package: NTLM

Transited Services: -

Package Name (NTLM only): NTLM V1

Key Length: 128

This event is generated when a logon session is created. It is generated on the computer that was accessed.

The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.

The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).

The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.

The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.

The authentication information fields provide detailed information about this specific logon request.

- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.

- Transited services indicate which intermediate services have participated in this logon request.

- Package name indicates which sub-protocol was used among the NTLM protocols.

October 12th, 2010 7:52pm

Hi,

I get the exact same problem on a 2008R2 core edition server. Did you find a solution ?

Regards.

Free Windows Admin Tool Kit Click here and download it now
March 12th, 2012 6:01pm

I get the same problem on a Windows server 2008 R2 core.

The core server seems to logon to the remote server using the anonymous account instead of the machinename$ account.

How to fix this problem?

August 15th, 2013 7:58am

I don't think Server 2008 was able to export to a network share. That is a added feature of Server 2012.
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2015 10:19pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics