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

Re: looking for the help on the PowercLI script.

$
0
0

Please use the below script and let me know if any issues.

 

clear

 

$logfile = "result.txt"

 

$vms = ""

 

$output = ""

 

$temp =""

 

$vm=""

 

Connect to vcenter server

 

$vcenter = read-host "Enter the vCenter Instance"

 

connect-viserver -Server $vcenter -WarningAction SilentlyContinue

 

Get-Date | out-file $logfile

 

echo "============ Details ===============" | out-file $logfile -Append

 

 

 

$vms = Get-Content .\list.txt

 

$output = get-vm $vms | select name, vmhost, PowerState, version, toolsversion, toolsversionstatus,Guest `

 

     |Sort-Object -Property toolsversionstatus | FT -AutoSize -GroupBy toolsversionstatus -wrap

 

 

 

$output

 

$output | Out-File $logfile -append

 

Disconnect-VIServer * -confirm:$false 


Viewing all articles
Browse latest Browse all 168455

Trending Articles



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