Share via


Win7使用指令加入網域範例

一、假設您要從Server上下NETDOM指令讓Client 加入Domain,可以參考:

netdom join client /Domain:eric\dc1 /Userd:eric\administrator /Passwordd:* /UserO:administrator /PasswordO:*

其中

Domain name為eric

DC名稱為DC1

Client的名稱為client

/Userd: 後面接的是domain 帳戶

/UserO:後面接的是該client的本機administrator帳戶

輸入後,會跳出二次需要輸入密碼的地方,第一次為輸入domain 帳戶的密碼,第二次是輸入該電腦本機admin的密碼。

clip_image002

Client的防火牆上至少要開「檔案及印表機共用」,才能從DC連到該 Client,否則會出現「找不到網路路徑」的錯誤。

clip_image004

clip_image006

以上的做法是參考以下的文件。

Using Netdom 2.0 to create computer accounts on admin-specified domain controllers

https://support.microsoft.com/kb/266651/en-us

For example, if you want to join a \\Windows2000Pro workgroup computer on the \\NA-DC-01 domain controller in the NORTHAMERICA.COM domain, the full netdom join command line is:

netdom join windows2000pro /Domain:NA\NA-DC-01 /Userd:NA\administrator /Passwordd:* /UserO:administrator /PasswordO:*

Note Always prepend the domain name to the user that is passed in the /userd parameter.

二、如果要從Client上下Netdom的指令加入Domain,可以這樣做:

1. Windows 7預設沒有netdom,要另外安裝RSAT並且啟動功能才會有這個指令。

2. 指令的下法為:

netdom join %computername% /Domain:domainname /UserD:administrator /PasswordD:12345

三、如果要以Power Shell 的方式加入Doamin,請用這個語法

Add-Computer –DomainName <網域名稱> -Credential <網域名稱\網域帳戶>

clip_image008