Matyb2k Posted June 14, 2012 Posted June 14, 2012 Hello, Been haveing some troubles with the script below i was wondering if anyone had any ideas? When it runs it completes with an error 66, the gatway and dns change to the entered one but not the IP or subnet $IP = Read-Host "Enter IP address (10.10.10.2)" $MASK = Read-Host "Enter Subnet address (255.255.255.0)" $GATEWAY = Read-Host "Enter Gateway address (10.10.10.254)" $DNS = Read-Host "Enter DNS address (10.10.10.2)" $wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" $wmi.EnableStatic($IP, $MASK) $wmi.SetGateways($GATEWAY) $wmi.SetDNSServerSearchOrder($DNS)
mac_shinobi Posted June 14, 2012 Posted June 14, 2012 not sure if this will help PowerShell Code Repository - Set-IPAddress
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now