# 現在のコンピューターアカウント リストを表示
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
# 例として コンピューターアカウント [RX-9] を追加
PS C:\Users\Administrator> New-ADComputer -Name RX-9
# 確認
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
# OU や管理者アカウントを指定して追加する場合は以下
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"
# コンピューターアカウントを削除する場合は以下
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
# [New-ADComputer] オプション一覧
PS C:\Users\Administrator> Get-Help New-ADComputer
NAME
New-ADComputer
SYNOPSIS
Creates a new Active Directory computer.
SYNTAX
New-ADComputer [-Name] <String> [-AccountExpirationDate <DateTime>] [-AccountNotDelegated <Boolean>] [-AccountPassw
ord <SecureString>] [-AllowReversiblePasswordEncryption <Boolean>] [-AuthenticationPolicy <ADAuthenticationPolicy>]
[-AuthenticationPolicySilo <ADAuthenticationPolicySilo>] [-AuthType {Negotiate | Basic}] [-CannotChangePassword <B
oolean>] [-Certificates <X509Certificate[]>] [-ChangePasswordAtLogon <Boolean>] [-CompoundIdentitySupported <Boolea
n>] [-Credential <PSCredential>] [-Description <String>] [-DisplayName <String>] [-DNSHostName <String>] [-Enabled
<Boolean>] [-HomePage <String>] [-Instance <ADComputer>] [-KerberosEncryptionType {None | DES | RC4 | AES128 | AES2
56}] [-Location <String>] [-ManagedBy <ADPrincipal>] [-OperatingSystem <String>] [-OperatingSystemHotfix <String>]
[-OperatingSystemServicePack <String>] [-OperatingSystemVersion <String>] [-OtherAttributes <Hashtable>] [-PassThru
] [-PasswordNeverExpires <Boolean>] [-PasswordNotRequired <Boolean>] [-Path <String>] [-PrincipalsAllowedToDelegate
ToAccount <ADPrincipal[]>] [-SAMAccountName <String>] [-Server <String>] [-ServicePrincipalNames <String[]>] [-Trus
tedForDelegation <Boolean>] [-UserPrincipalName <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
.....
.....
|