VMware Cloud Community
RonRosenkoetter
Contributor
Contributor

Powercli - change custom spec network back to default settings

I've used Set-OSCustomizationNicMapping to change a custom spec's IP settings to a static IP address.

But how can I change it back to default instead of custom settings using Powercli?

Thanks

Reply
0 Kudos
2 Replies
ScreamingSilenc

Have you tried "Remove-OSCustomizationNicMapping" and check whether it reverts to default.

Please consider marking this answer "correct" or "helpful" if you found it useful.
RonRosenkoetter
Contributor
Contributor

That was a good suggestion, but it doesn't revert the Network settings inside the Customization Specification to "Typical". Instead, it's still set at "Custom", but everything is blank.

Here's what I did:

Get-OSCustomizationSpec <CustomSpecName> | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -ipmode usestaticip -ipaddress x.x.x.x -subnetmask 255.255.255.0 -defaultgateway x.x.x.x -dns x.x.x.x

Then afterwards I want to clear that out...

Using your suggestion, I tried this...

Get-OSCustomizationSpec <CustomeSpecName> | Get-OSCustomizationNicMapping | Remove-OSCustomizationNicMapping

Command completed, but it didn't change it back to Typical. Just left it Custom, with nothing specified.

Reply
0 Kudos