Hello
Could you please help to get the powerCLI script to modify the VMs Configured OS name matched with Guest running OS.
I would advise you to first check if the discovered guest OS id and the discovered guest OS ID match in all cases.
You can do like this
@{N='Configured';E={$_.Guest.ConfiguredGuestId}},
@{N='Runtime';E={$_.Guest.RuntimeGuestId}},
@{N='GuestOS';E={$_.Guest.OSFullName}} | ft -AutoSize
Once you verified this, you can change the ones that do not correspond with something like this
where{$_.Guest.ConfiguredGuestId -ne $_.Guest.RuntimeGuestId -and $_.Guest.RuntimeGuestId -ne $null} |
Set-VM -GuestId $_.Guest.RuntimeGuestId -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello Luc,
I am trying to change the configuredGuestId for single VM, the script will work correct?
Get-VM -Name "vmname" | where{$_.Guest.ConfiguredGuestId -ne $_.Guest.RuntimeGuestId -and $_.Guest.RuntimeGuestId -ne $null} |
Set-VM -Name "vmname" -GuestId $_.Guest.RuntimeGuestId -Confirm:$false
seems the guestID value value is not changing..
Is that VM powered off?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello Luc,
No, the VM was running status while executing the script.
Does it require to be powered off to do the changes?
Yes, the VM needs to be powered off to be able to make this change.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference