4

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?

4
  • I'm curious as to why you'd disable WMI? Commented May 20, 2011 at 0:41
  • I don't know how's done that. Maybe it's a customer-wish or it's a policy. Commented May 20, 2011 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. Commented May 23, 2011 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. Commented May 26, 2011 at 3:25

4 Answers 4

3
+50

/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.

5
  • 2
    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. Commented May 25, 2011 at 12:32
  • re: VMWare != magic see: vMotion DRS see also: Any sufficiently advanced technology is indistinguishable from magic. Commented May 27, 2011 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. Commented May 29, 2011 at 18:24
  • 3
    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 ;) Commented May 31, 2011 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. Commented May 31, 2011 at 22:37
2

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.

1
  • 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. Commented May 31, 2011 at 20:55
1

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.

2
  • psexec doesn't work because admin$ is not enabled or blocked. Commented May 25, 2011 at 11:49
  • voted up because this usually works ;) Commented May 31, 2011 at 20:51
0

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?

1
  • 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. Commented May 31, 2011 at 20:44

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.