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
------- -------------- ------------- ------------ --------------- ---- --------------- -----------
3 Ethernet0 IPv4 1500 25 Enabled Connected ActiveStore
1 Loopback Pseudo-Interface 1 IPv4 4294967295 75 Disabled Connected ActiveStore
# change DNS setting to refer to AD DS
PS C:\Users\serverworld> Set-DnsClientServerAddress -InterfaceIndex 3 -ServerAddresses "10.0.0.100" -PassThru
InterfaceAlias Interface Address ServerAddresses
Index Family
-------------- --------- ------- ---------------
Ethernet0 3 IPv4 {10.0.0.100}
Ethernet0 3 IPv6 {}
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-78-3.
# restart computer
PS C:\Users\serverworld> Restart-Computer -Force
# after restarting, verify to logon as a domain user
PS C:\Users\Serverworld.FD3S01> whoami
fd3s01\serverworld
# make sure domain info (the command needs local administrative privilege)
PS C:\Users\Serverworld.FD3S01> Get-WmiObject Win32_NTDomain
ClientSiteName :
DcSiteName :
Description : RX-78-3
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
|