Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 234493

Re: batch script to start VMs

$
0
0

I suppose you are connected to the vCenter ?

If yes, you can find the name of the vCenter in the $global:defaultVIServer variable.

Then it is a matter of doing

Get-VM -Name $global:defaultViServer.Name |

Select -ExpandProperty VMHost |

Select -ExpandProperty Name

 

Not quite sure what you mean with question 2).

You can try to access the datastore and when that fails, assume the NFS mount isn't ok.

Use the vimdatastore provider to do this.

 

To restart a service under Windows with PowerShell, you can use the Restart-Service cmdlet.

If your script is not running on the server where you have the Update Manager service running, you can use the Invoke-VMScript cmdlet to send the line to the server.


Viewing all articles
Browse latest Browse all 234493

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>