Hey everyone,
I found this script: Add Vmtools vShield Drivers for Endpoint Protection on ESX VM - Bonus Bits Wiki
$ComputerName = <vm-name>
$vCenter = <vcenter-hostname>
Connect-ViServer $vCenter
Mount-Tools -VM $ComputerName
$DriveLetter = Get-WmiObject Win32_CDROMDrive -ComputerName $ComputerName | Where-Object {$_.VolumeName -match "VMware Tools"} | Select-Object -ExpandProperty Drive
$ScriptText = "$DriveLetter\setup64.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
Invoke-VMScript -VM $ComputerName -ScriptText $ScriptText -ScriptType bat
When I execute the script, the autoplay box comes up on my VM but the powerCLI script fails. With an error of:
"Get-WmiObject : The RPC server is unavailable. 0x800706BA"
Any help is much appreciated.
$ComputerName = <vm-name>
$vCenter = <vcenter-hostname>
Connect-ViServer $vCenter
Mount-Tools -VM $ComputerName
$ScriptText = "D:\setup64.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
Invoke-VMScript -VM $ComputerName -ScriptText $ScriptText -ScriptType bat
Running this script, there are no errors but the autoplay box just hangs and nothing happens.
Did you already try turning autoplay off before mounting the ISO image ?
You can use an Invoke-VMScript to run this inside the guest.
$path ='HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer'
Set-ItemProperty $path -Name NoDriveTypeAutorun -Type DWord -Value 0xFF
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It throws a "Requested registry access is not allowed"
Would that be the easiest workaround? I would like to not mess with the registry.
Could you not pass the "/S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`"" parameter with the Update-tools cmdlet?
Just a thought, but if you want to avoid the autoplay (and messing with the registry), why not store the content of the ISO file to a network share.
And then invoke the install from that network share.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Tried it with the same result..
It is able to execute this script locally and work just fine : "D:\setup64.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
But when run through powerCLI it executes everything just fine but no results.
Is there a reason why this script won't execute properly?
$ComputerName = "VM"
Mount-Tools -VM $ComputerName
$ScriptText = "D:\setup64.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
Invoke-VMScript -VM $ComputerName -ScriptText $ScriptText -ScriptType bat
Does the account you run the script with, have sufficient permissions in the guest OS ?
You can try passing an explicit account on the Invoke-VMScript with the GuestUser/GuestPassword parameters.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I was able to get the script to work for setup64.exe on my 2008 servers but now when I try to do the same with my 32bit 2003 servers it won't accept "D:\setup32.exe"
Is there a 32bit vmTools mount?
Any ideas how to workaround this?
I tried to run the script locally: D:\setup32.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
and it returned "The device is not ready" Windows - No Disk
But, both the 32 and 64 bit ISO is in the same file
Hey Luc,
Just read your post about 'Will invoke-vmscript work?'
I saw that some people got their 2003 sp2 servers to work... So i'm guessing that if it is a regular 32bit Windows 2003 server (not SP2) will invoke-vmscript not work?
Thanks for all the help so far.
That could be the reason it fails.
Can't you try on another OS, just to make sure the logic works ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can use PsExec tool to install drivers remotely on windows servers.
I've tried using PsExec with the following script but still no luck..
$ComputerName = "VM"
Mount-Tools -VM $ComputerName
C:\PSTools\psexec.exe \\VM "D:\setup.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
I found out that it was a 2003 SP2 server so Invoke-VMscript should have worked but the only way it works is by doing it manually.