Just for future reference to myself.
- Install Server Core 2012 as usual.
- Login. Change the IP address thus:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# list the adapters; can also use Get-NetIPInterfacePS> Get-NetAdapterName InterfaceDescription ifIndex Status MacAddress LinkSpeed---- -------------------- ------- ------ ---------- ---------Ethernet3 Intel(R) 82574L Gigabit Network Co...#4 15 Up 00-0C-29-C8-94-0E 1 GbpsEthernet1 Intel(R) 82574L Gigabit Network Co...#3 14 Up 00-0C-29-C8-94-FA 1 GbpsEthernet2 Intel(R) 82574L Gigabit Network Co...#2 13 Up 00-0C-29-C8-94-04 1 GbpsEthernet0 Intel(R) 82574L Gigabit Network Conn... 12 Up 00-0C-29-C8-94-F0 1 Gbps# view existing IP addressesPS> Get-NetIPAddress | ftifIndex IPAddress PrefixLength PrefixOrigin SuffixOrigin AddressState PolicyStore------- --------- ------------ ------------ ------------ ------------ -----------15 fe80::c9a5:bb28:708d:6cb7%15 64 WellKnown Link Preferred ActiveStore14 fe80::cde0:7188:3a80:8f13%14 64 WellKnown Link Preferred ActiveStore13 fe80::6cfd:132:6e05:7789%13 64 WellKnown Link Preferred ActiveStore12 fe80::60f6:b4c:d5fe:6d71%12 64 WellKnown Link Preferred ActiveStore38 fe80::5efe:169.254.109.113%38 128 WellKnown Link Deprecated ActiveStore37 fe80::5efe:169.254.143.19%37 128 WellKnown Link Deprecated ActiveStore18 fe80::5efe:169.254.108.183%18 128 WellKnown Link Deprecated ActiveStore17 fe80::5efe:169.254.119.137%17 128 WellKnown Link Deprecated ActiveStore1 ::1 128 WellKnown WellKnown Preferred ActiveStore15 169.254.108.183 16 WellKnown Link Preferred ActiveStore14 169.254.143.19 16 WellKnown Link Preferred ActiveStore13 169.254.119.137 16 WellKnown Link Preferred ActiveStore12 169.254.109.113 16 WellKnown Link Preferred ActiveStore1 127.0.0.1 8 WellKnown WellKnown Preferred ActiveStore# use Set-NetIPInterface to enable/ disable DHCP.# in my case I want to set an IP address and that will automatically disable DHCP.PS> New-NetIPAddress -InterfaceIndex 12 -IPAddress 10.50.0.25 -DefaultGateway 10.50.0.1 -PrefixLength 24IPAddress : 10.50.0.25InterfaceIndex : 12InterfaceAlias : Ethernet0AddressFamily : IPv4Type : UnicastPrefixLength : 24PrefixOrigin : ManualSuffixOrigin : ManualAddressState : TentativeValidLifetime : Infinite ([TimeSpan]::MaxValue)PreferredLifetime : Infinite ([TimeSpan]::MaxValue)SkipAsSource : FalsePolicyStore : ActiveStoreIPAddress : 10.50.0.25InterfaceIndex : 12InterfaceAlias : Ethernet0AddressFamily : IPv4Type : UnicastPrefixLength : 24PrefixOrigin : ManualSuffixOrigin : ManualAddressState : InvalidValidLifetime : Infinite ([TimeSpan]::MaxValue)PreferredLifetime : Infinite ([TimeSpan]::MaxValue)SkipAsSource : FalsePolicyStore : PersistentStore - Specify DNS server addresses:
123PS> Set-DnsClientServerAddress -InterfaceIndex 12 -ServerAddresses {10.50.0.20,10.50.0.21}# use Get-DnsClientServerAddress if you want to verify Rename the computer:
1234567891011121314151617# no cmdlet to rename, so use WMIPS> $comp = Get-WmiObject Win32_ComputerSystemPS> $comp.Rename("WIN-DATA01")__GENUS : 2__CLASS : __PARAMETERS__SUPERCLASS :__DYNASTY : __PARAMETERS__RELPATH :__PROPERTY_COUNT : 1__DERIVATION : {}__SERVER :__NAMESPACE :__PATH :ReturnValue : 0PSComputerName :Restart the computer so the name change takes effect.- Update: Rename the computer & join the domain (thanks to Daniel Streefkerf (check out his blog, if you like my blog posts you’ll surely enjoy his!) for pointing this out – since PowerShell 3.0 the
Add-Computer
cmdlet has a-NewName
switch that lets you rename and add/ move a computer):
12345PS> Add-Computer -Credential (Get-Credential) -DomainName RAXNET -OUPath "OU=Servers,DC=rakhesh,DC=local" -Restart -NewName "WIN-DATA01"cmdlet Get-Credential at command pipeline position 1Supply values for the following parameters:Credential
Update: If you want to do NIC teaming, do the following after step 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# create a new team, called Team0, with adapters Ethernet0 & Ethernet1 # team mode is switch independent (i.e. not using LACP or static teaming) # using the dynamic algorithm for load balancing PS> New-NetLbfoTeam -Name Team0 -TeamMembers Ethernet0,Ethernet1 -TeamingMode SwitchIndependent -LoadBalancingAlgorithm Dynamic Confirm Are you sure you want to perform this action? Creates Team:'Team0' with TeamMembers:{'Ethernet0', 'Ethernet1'}, TeamNicName:'Team0', TeamingMode:'SwitchIndependent' and LoadBalancingAlgorithm:'Dynamic'. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y Name : Team0 Members : {Ethernet0, Ethernet1} TeamNics : Team0 TeamingMode : SwitchIndependent LoadBalancingAlgorithm : Dynamic Status : Down PS> Get-NetAdapter Name InterfaceDescription ifIndex Status MacAddress LinkSpeed ---- -------------------- ------- ------ ---------- --------- Team0 Microsoft Network Adapter Multiplexo... 33 Up 00-0C-29-C8-94-FA 2 Gbps Ethernet3 Intel(R) 82574L Gigabit Network Co...#4 15 Up 00-0C-29-C8-94-0E 1 Gbps Ethernet1 Intel(R) 82574L Gigabit Network Co...#3 14 Up 00-0C-29-C8-94-FA 1 Gbps Ethernet2 Intel(R) 82574L Gigabit Network Co...#2 13 Up 00-0C-29-C8-94-04 1 Gbps Ethernet0 Intel(R) 82574L Gigabit Network Conn... 12 Up 00-0C-29-C8-94-F0 1 Gbps |
Now continue with assigning IP address etc, but use the newly created Team adapter instead.