Thêm Computer Accounts trên CUI
Chạy PowerShell hoặc Command Prompt và sừ dụng lệnh dsadd computer
# show current computer list
PS C:\Users\Administrator> dsquery computer -name *
"CN=FD3S,OU=Domain Controllers,DC=srv,DC=world"
"CN=RX-5,CN=Computers,DC=srv,DC=world"
# for example, add a computer [RX-7] under the [Computers]
PS C:\Users\Administrator> dsadd computer CN=RX-7,CN=Computers,DC=srv,DC=world
dsadd succeeded:CN=RX-7,CN=Computers,DC=srv,DC=world
PS C:\Users\Administrator> dsquery computer -name RX-7
"CN=RX-7,CN=Computers,DC=srv,DC=world"
# options for [dsadd computer]
PS C:\Users\Administrator> dsadd computer /?
Description: Adds a computer to the directory.
Syntax: dsadd computer [-samid ] [-desc ]
[-loc ] [-memberof ]
[{-s | -d }] [-u ]
[-p { | *}] [-q] [{-uc | -uco | -uci}]
.....
.....
Nếu bạn muốn xóa Computer Accounts, sử dụng lệnh dsrm
# for example, delete a computer [RX-7]
PS C:\Users\Administrator> dsquery computer -name RX-7
"CN=RX-7,CN=Computers,DC=srv,DC=world"
PS C:\Users\Administrator> dsrm "CN=RX-7,CN=Computers,DC=srv,DC=world"
Are you sure you wish to delete CN=RX-7,CN=Computers,DC=srv,DC=world (Y/N)? y
dsrm succeeded:CN=RX-7,CN=Computers,DC=srv,DC=world
Nếu bạn sử dụng PowerShell, bạn có thể sử dụng Cmdlet cho PowerShell.
# show current computer list
PS C:\Users\Administrator> Get-ADComputer -Filter * | Format-Table DistinguishedName
DistinguishedName
-----------------
CN=FD3S,OU=Domain Controllers,DC=srv,DC=world
CN=RX-7,CN=Computers,DC=srv,DC=world
# for example, add a computer [RX-9]
PS C:\Users\Administrator> New-ADComputer -Name RX-9
# verify
PS C:\Users\Administrator> Get-ADComputer -Filter * | Format-Table DistinguishedName
DistinguishedName
-----------------
CN=FD3S,OU=Domain Controllers,DC=srv,DC=world
CN=RX-7,CN=Computers,DC=srv,DC=world
CN=RX-9,CN=Computers,DC=srv,DC=world
# for adding computer with some parameters like OU or admin account
PS C:\Users\Administrator> New-ADComputer -Name RX-8 `
-Path "OU=Computers,OU=Hiroshima,DC=srv,DC=world" `
-ManagedBy "CN=Serverworld,CN=Users,DC=srv,DC=world"
# if delete, do like follows
PS C:\Users\Administrator> Remove-ADComputer -Identity "CN=RX-9,CN=Computers,DC=srv,DC=world"
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove" on target "CN=RX-9,CN=Computers,DC=srv,DC=world".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
# options for [New-ADComputer]
PS C:\Users\Administrator> Get-Help New-ADComputer
NAME
New-ADComputer
SYNOPSIS
Creates a new Active Directory computer.
SYNTAX
New-ADComputer [-Name] [-AccountExpirationDate ] [-AccountNotDelegated ] [-AccountPassw
ord ] [-AllowReversiblePasswordEncryption ] [-AuthenticationPolicy ]
[-AuthenticationPolicySilo ] [-AuthType {Negotiate | Basic}] [-CannotChangePassword ] [-Certificates ] [-ChangePasswordAtLogon ] [-CompoundIdentitySupported ] [-Credential ] [-Description ] [-DisplayName ] [-DNSHostName ] [-Enabled
] [-HomePage ] [-Instance ] [-KerberosEncryptionType {None | DES | RC4 | AES128 | AES2
56}] [-Location ] [-ManagedBy ] [-OperatingSystem ] [-OperatingSystemHotfix ]
[-OperatingSystemServicePack ] [-OperatingSystemVersion ] [-OtherAttributes ] [-PassThru
] [-PasswordNeverExpires ] [-PasswordNotRequired ] [-Path ] [-PrincipalsAllowedToDelegate
ToAccount ] [-SAMAccountName ] [-Server ] [-ServicePrincipalNames ] [-Trus
tedForDelegation ] [-UserPrincipalName ] [-Confirm] [-WhatIf] []
.....
.....
Thêm Computer Accounts trên GUI
Mở Server Manager và chọn Tools – Active Directory Users and Conputers, tiếp theo bấm chuột phải vào Computers – New – Computer.
Nhập tên máy tính mà bạn muốn đặt.
theo mặc định, người dùng khi sử dụng để tham gia vào domain được thêm vào theo nhóm người dùng là [domain admin], nếu bạn muốn thay đổi thì có thể thay đổi trong user or group
Vậy là một máy tính mới vừa được thêm vào.