Connect to Vcenter
Connect-VIServer vmwareenterprise.com -WarningAction 0
####### Shutdown all VMs from the list “C:\temp\vm.txt“###########
foreach($vmlist in (Get-Content -Path C:\TEMP\vm.txt))
{
$vm = Get-VM -Name $vmlist
Shutdown-VMGuest -VM $vm -Confirm:$false
}
####### Generate CSV report with powerstate of listed vm’s ##########
$powerstate = @()
foreach($vmlist in (Get-Content -Path C:\temp\vm.txt)){
$vm = Get-VM -Name $vmlist
$powerstate += (Get-VM $vm |
Select Name,PowerState,
@{N=’VMHost’;E={$_.VMHost.Name}})
}
$powerstate | Export-Csv -Path C:\temp\powerstate_report.csv -NoTypeInformation -UseCulture
6iajas
lfi4c7
4um0f6
After examine a number of of the weblog posts in your web site now, and I truly like your method of blogging. I bookmarked it to my bookmark web site list and will be checking again soon. Pls take a look at my web site as properly and let me know what you think.
Good day! This is my first visit to your blog! We are a team of volunteers and starting a new project in a community in the same niche. Your blog provided us valuable information to work on. You have done a extraordinary job!
You can definitely see your enthusiasm in the work you write. The world hopes for more passionate writers like you who aren’t afraid to say how they believe. Always follow your heart.
Some really nice and useful info on this website, likewise I conceive the layout has got fantastic features.
v1a66v
5rx0w9
icuirr
mvmssr