Get-VM | FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }}
Showing posts with label PowerCLI. Show all posts
Showing posts with label PowerCLI. Show all posts
Monday, November 13, 2017
Use PowerCLI to find all VMs with a mounted ISO file as a CD/DVD drive
Tuesday, December 1, 2015
Run this PowerCLI script to map the .naa disk name to the datastore name on an ESXi host
Connect-VIServer -Server "server_name" -User "user_name" -Password "password"
Get-Datastore |
Where-Object {$_.ExtensionData.Info.GetType().Name -eq "VmfsDatastoreInfo"} |
ForEach-Object {
if ($_)
{
$Datastore = $_
$Datastore.ExtensionData.Info.Vmfs.Extent |
Select-Object -Property @{Name="Name";Expression={$Datastore.Name}},
DiskName
}
}
Connect-VIServer -Server "server_name" -User "user_name" -Password "password"
Get-Datastore |
Where-Object {$_.ExtensionData.Info.GetType().Name -eq "VmfsDatastoreInfo"} |
ForEach-Object {
if ($_)
{
$Datastore = $_
$Datastore.ExtensionData.Info.Vmfs.Extent |
Select-Object -Property @{Name="Name";Expression={$Datastore.Name}},
DiskName
}
}
Subscribe to:
Posts (Atom)