Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<#
.SYNOPSIS
This script will remove all IP information from the system
.NOTES
For more info please visit http://www.dominikbritz.com/2015/09/08/pvs-targets-with-multiple-ip-addresses/
#>
#Requires -Version 3
#Requires -RunAsAdministrator
$Items = @('DhcpDefaultGateway','DhcpDomain','DhcpIPAddress','DhcpNameServer','DhcpServer','DhcpSubnetMask','DhcpSubnetMaskOpt')
Foreach ($Item in $Items){
Get-ChildItem -Path HKLM:\SYSTEM -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Property -eq $Item } | Get-ItemProperty -Name $Item | Set-ItemProperty -Name $Item -Value $null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.