Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# display network interfaces
PS C:\Users\serverworld> Get-NetIPInterface -AddressFamily IPv4
ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore
------- -------------- ------------- ------------ --------------- ---- --------------- -----------
8 Ethernet0 2 IPv4 1500 15 Enabled Connected ActiveStore
1 Loopback Pseudo-Interface 1 IPv4 4294967295 75 Disabled Connected ActiveStore
# add AD DS to DNS references
PS C:\Users\serverworld> Set-DnsClientServerAddress -InterfaceIndex 8 -ServerAddresses @("10.0.0.100","10.0.0.10") -PassThru
InterfaceAlias Interface Address ServerAddresses
Index Family
-------------- --------- ------- ---------------
Ethernet0 2 8 IPv6 {}
Ethernet0 2 8 IPv4 {10.0.0.100, 10.0.0.10}
PS C:\Users\serverworld> ipconfig /all | Select-String -Pattern "DNS"
Primary Dns Suffix . . . . . . . :
DNS Suffix Search List. . . . . . : srv.world
Connection-specific DNS Suffix . : srv.world
DNS Servers . . . . . . . . . . . : 10.0.0.100
# join in domaon
# for [Serverworld] word, it's a domain user, replace to yours
# for [UserP@ssw0rd01] word, it's the password of the user specified above
PS C:\Users\serverworld> Add-Computer -DomainName srv.world -Credential (New-Object PSCredential("Serverworld", (ConvertTo-SecureString -AsPlainText "UserP@ssw0rd01" -Force)))
WARNING: The changes will take effect after you restart the computer RX-0.
# restart computer
PS C:\Users\serverworld> Restart-Computer -Force
# after restarting, verify to logon as a domain user
PS C:\Users\serverworld> whoami
fd3s01\serverworld
# make sure domain info (the command needs local administrative privilege)
PS C:\Users\serverworld> Get-WmiObject Win32_NTDomain
ClientSiteName :
DcSiteName :
Description : RX-0
DnsForestName :
DomainControllerAddress :
DomainControllerName :
DomainName :
Roles :
Status : Unknown
ClientSiteName : Default-First-Site-Name
DcSiteName : Default-First-Site-Name
Description : FD3S01
DnsForestName : srv.world
DomainControllerAddress : \\10.0.0.100
DomainControllerName : \\FD3S
DomainName : FD3S01
Roles :
Status : OK
|