Jump to content

change ip


Recommended Posts

Something like this using netsh.exe

$userName = "User"
$domain = @ComputerName
$password = "password"
$netname = "Local Area Connection"
$newIP = "192.168.2.12"
$newSubnetMask = "255.255.255.0"
$newDG = "192.168.2.1"


RunAs($userName,$domain,$password,0,'netsh interface ip set address name=' & '"' & $netname & '" static ' & $newIP & ' ' & $newSubnetMask & ' ' & $newDG & ' 1')
Link to comment
Share on other sites

Something like this using netsh.exe

$userName = "User"
$domain = @ComputerName
$password = "password"
$netname = "Local Area Connection"
$newIP = "192.168.2.12"
$newSubnetMask = "255.255.255.0"
$newDG = "192.168.2.1"


RunAs($userName,$domain,$password,0,'netsh interface ip set address name=' & '"' & $netname & '" static ' & $newIP & ' ' & $newSubnetMask & ' ' & $newDG & ' 1')

tnx :)

Edited by Mistake
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...