Last active
April 30, 2017 02:21
-
-
Save techthoughts2/483f43010c8b46b2c19db8f475b10f7b to your computer and use it in GitHub Desktop.
Basic Configuration of a device. Assign IP to adapter, set DNS ip and gateway, rename, and join to a domain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$compname = "20161" | |
$ip = "10.0.2.4" | |
#find a way to get the interfaceindex | |
$index = Get-NetAdapter | Select-Object -ExpandProperty ifIndex | |
#now set the ip of that index adapter | |
New-NetIPAddress -InterfaceIndex $index -IPAddress $ip -PrefixLength 16 -DefaultGateway 10.0.0.1 | |
#now set the DNS for that index adapter | |
Set-DnsClientServerAddress -InterfaceIndex $index -ServerAddresses 10.0.3.190 | |
$cred = Get-Credential -UserName domain\user -Message "Enter domain creds" | |
Add-Computer -DomainName ark.local -Credential $cred -NewName $compname -Restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment