Maybe this already exisits somewhere, has someone done a top 10 list of "best VIToolkit commands"? People could submit, rate etc and push out a list? Thought it would be useful.
I think this list is waiting for you to write it. 🙂
[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum moderator
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
No problem, this is a request to everyone, please post your top 10 VI Toolkit comands (ones you find the most useful everday admin commands you couldn't live without). Depending on the feedback from this post, I will compile the list.
If folks can provide a list of 20 or so I can create a community poll, might easier to track in real time. Let me know.
Regards,
Pablo
Sounds easier to me Pablo let's do it.
Here are my inputs in order of use for me:
Get-Credentials
Connect-VIServer
Disconnect-VIServer
Get-VM
Get-VMHost
Get-Content
Get-Cluster
Get-Snapshot
Get-HardDisk
Add-VMHost
Get-VirtualSwitch
Get-VirtualPortGroup
Set-VirtualSwitch
New-VirtualPortGroup
New-VirtualSwitch
Get-VMHostNetwork
Get-VMHostFirewallException
Set-VMHostFirewallException
Get-NetworkAdapter
Start-VMHostService
Thanks Smitty for your input. I was thinking along the lines of functional commands, for example here is one I use all the time to rescan all my HBA's across my ESX farm when I add new luns:
Get-VMHost | Get-VMHostStorage -RescanAllHba
Sorry, misunderstood. Guess that leaves me out. I don't tend to do single command groups but instead write multifunction scripts (with much help from this forum of course).
So you really mean "TOP 10 VI Toolkit Oneliners"?
My 2 cents:
To get all errors from the past 24 hours, enter:
Get-VIEvent -Start (Get-Date).AddHours(-24) -Type Error | Format-Table CreatedTime, FullFormattedMessage -AutoSize
A printed overview of the top-twenty volumes on your virtual servers with the least free disk space:
Get-VM | Where { $_.PowerState -eq “PoweredOn” } | Get-VMGuest | Select VmName -ExpandProperty Disks | Select VmName, Path, @{N=”MBFree”;E={[math]::Round((($_.FreeSpace)/1MB),2)}} | Sort MBFree | Select -First 20 | Format-Table -AutoSize | Out-Printer
Setting VM descriptions:
Get-VM | ForEach { Set-VM -VM $_ -Description (Get-QADComputer $_.Name).Description }
Finally:
Get-VMHost | Sort Name | Get-View | Select Name, @{N=”MemoryGB”;E={[math]::Round((($_.Summary.Hardware.MemorySize)/1GB),0)}}, @{N=”MemoryUsageGB”;E={[math]::Round((($_.summary.quickstats.overallmemoryusage)*1MB/1GB),2)}}, @{N=”Percentage”;E={[Math]::Round(100*(($_.Summary.QuickStats.OverallMemoryUsage*1MB/1GB)/($_.Summary.Hardware.MemorySize/1GB)),0)}}
(Search my website if you cannot figure out what it does )
Hugo Peeters
http://halr9000.com/article/tag/vi-toolkit-one-liner
[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum moderator
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Yep thats more appropriate I imagine, I updated the subject to reflect.