PowerCLI has a great cmdlet called Update-Tools and even allows you to upgrade the tools without rebooting. Get-VM | Update-Tools -NoReboot http://www.vmware.com/support/developer/PowerCLI/...
See more...
PowerCLI has a great cmdlet called Update-Tools and even allows you to upgrade the tools without rebooting. Get-VM | Update-Tools -NoReboot http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Update-Tools.html
Pretty sure this will do what you need: $report = @() Foreach($cluster in Get-Cluster){ $datastores = $cluster | Get-VMHost | Get-Datastore foreach($datastore in $datastores){ ...
See more...
Pretty sure this will do what you need: $report = @() Foreach($cluster in Get-Cluster){ $datastores = $cluster | Get-VMHost | Get-Datastore foreach($datastore in $datastores){ $vms = $datastore | Get-VM If ($vms.count -ge 1){ foreach($VM in $vms){ $object = New-Object -TypeName PSObject -Property @{ Datastore = $datastore.Name VM = $VM.Name HostName = $VM.VMhost Cluster = $cluster } $report += $object } } } } $report | Export-Csv C:\Temp\VMs.csv -NoTypeInformation -UseCulture If you only want Shared datastores then you could use $datastores = $cluster | Get-VMHost | Get-Datastore | Where {$_.Extensiondata.Summary.MultipleHostAccess -eq $True} Hope this helps
It definitely makes you appreciate the work behind something like SDRS though, that's for sure. This script may not be right for your needs but I wouldn't say it's worth totally abandoning since...
See more...
It definitely makes you appreciate the work behind something like SDRS though, that's for sure. This script may not be right for your needs but I wouldn't say it's worth totally abandoning since i'm sure many folks out there could benefit who don't have Ent+ licensing. Backburner perhaps for your environment though.
Check your Powershell console size and see if there is a horizontal scroll bar. I tried it on mine and did not see the expected result and then realized that the PowerState was right-aligned. ...
See more...
Check your Powershell console size and see if there is a horizontal scroll bar. I tried it on mine and did not see the expected result and then realized that the PowerState was right-aligned. You can fix this by using -AutoSize which will put the two columns together. If this is your issue you can also adjust the horizontal buffer size. Right click on PowerCLI window Title bar Select properties Select Layout Tab Reduce Width under Buffer (mine set to 150) Keep in mind that anytime your Buffer size is greater than your Window Size width you'll have the scrollbar.
Have you considered converting the date you get from the attribute. Try this $currentdate = Get-Date Get-VM | Get-Annotation -CustomAttribute "Expires" | ?{(Get-Date $_.Value) -le $currentda...
See more...
Have you considered converting the date you get from the attribute. Try this $currentdate = Get-Date Get-VM | Get-Annotation -CustomAttribute "Expires" | ?{(Get-Date $_.Value) -le $currentdate}
You get this from the Created Property Get-Snapshot -VM (Get-VM -Name "VMName") -Name 'SnapshotName' | Select Name, Created or $CreateTime = (Get-Snapshot -VM (Get-VM -Name "VM...
See more...
You get this from the Created Property Get-Snapshot -VM (Get-VM -Name "VMName") -Name 'SnapshotName' | Select Name, Created or $CreateTime = (Get-Snapshot -VM (Get-VM -Name "VMName") -Name 'SnapshotName').Created Josh Atwell http://day2dayadmin.blogspot.com