Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have several view-desktops and I need a script to be performed once on all desktops. Sadly, WMI is disabled. These desktop are all running Windows XP SP3

I thought I read about the possibility to execute commands in a guest-vm via VMwares PowerCLI. Can anyone confirm if that is possible or can even provide a link?

share|improve this question
I'm curious as to why you'd disable WMI? – ThatGraemeGuy May 20 '11 at 0:41
I don't know how's done that. Maybe it's a customer-wish or it's a policy. – wullxz May 20 '11 at 11:20
I mean: I don't know who has done that. But there must be any policy from our customer that requires us to disable or block WMI over network. – wullxz May 23 '11 at 21:24
You are probably thinking Powershell, of which PowerCLI is an extra module of cmdlets that help you interact with your virtual hosts/vCenter. A lot of the Powershell cmdlets make WMI calls so, with it disabled, this won't be using that of course. Hopefully the invoke-vmscript noted down on Mfinni's response will do what you need. – Chadddada May 26 '11 at 3:25
up vote 4 down vote accepted

/See edit below

You cannot. PowerCLI just lets you do things that you can do through the vSphere GUI, like add/remove drives, power on/off guests, migrate machines, etc. Read the docs, that's a really good thing to do before coming to a technical forum with a question. If you read over the list of cmdlets included in PowerCLI, you'd see this for yourself.

PowerCLI does not get you any hooks into the guest machines themselves. If you have left yourself no remote-management options because you disabled admin$ and WMI on the guests, you're stuck doing everything manually.

VMware != magic. You still have to administer the guest machines using the same methods you'd use on physical machines.

/edit - OK, good catch for finding invoke-vmscript. So, my answer above is not quite accurate.

share|improve this answer
I found invoke-vmscript. That requires VMware Tools in the quest-VM. I'll test that when my PowerCLI-Installation finished. Thanks for remembering me of that cmdlet-list. – wullxz May 25 '11 at 12:32
re: VMWare != magic see: vMotion DRS see also: Any sufficiently advanced technology is indistinguishable from magic. – JamesBarnett May 27 '11 at 13:01
@James - certainly. A VM lets you divorce the OS from the real hardware, and that lets you do a lot of new things. I'm just saying that it doesn't let you do anything you want. – mfinni May 29 '11 at 18:24
invoke-vmscript worked like a charm. We were able to run a few commands to troubleshoot our view-desktops very quickly through vCLI. Thanks for pointing me at this list. Because this is the answer that fits the best and not giving the rep-points away would be a waste of reputation, I'll give it to you. Just think about your answers the next time (or do some research) - vCLI has a few magical commands ;) – wullxz May 31 '11 at 21:01
It apparently does. Looking through that list, all I was seeing was get-* and set-*, and none of them involved poking inside the guests. The single invoke- entry slipped right past my eyes. – mfinni May 31 '11 at 22:37

Considering your remote administration options look to be used up, are these VMs in a domain? If so, you could run your script via Group Policy.

share|improve this answer
Yeah, that would work. But for some scripts that have to be run spontaneously on a subset of VMs, this would be too long-winded. However, voting you up because this also would work. – wullxz May 31 '11 at 20:55

I've no idea about doing this through PowerCLI, but have you looked at PsExec? It can quite easily be used to run commands against a number of remote computers.

share|improve this answer
psexec doesn't work because admin$ is not enabled or blocked. – wullxz May 25 '11 at 11:49
voted up because this usually works ;) – wullxz May 31 '11 at 20:51

These are Windows-XP-Boxes - so why don't you use simple cmd-scripts on a network share that get executed by an xp-scheduler?

share|improve this answer
Because I would have to configure it and wait for the scheduler to execute the script. Apart from that it isn't as flexible as a powershell/vCLI-script. – wullxz May 31 '11 at 20:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.