やり方
ActiveDirectory上でPowerShellを起動して下記コマンド。
Get-ADComputer -Filter * -Properties * | Export-Csv 出力先csvパス
取得できるcsvのカラム一覧
AccountExpirationDate
accountExpires
AccountLockoutTime
AccountNotDelegated
AllowReversiblePasswordEncryption
AuthenticationPolicy
AuthenticationPolicySilo
BadLogonCount
badPasswordTime
badPwdCount
CannotChangePassword
CanonicalName
Certificates
CN
codePage
CompoundIdentitySupported
countryCode
Created
createTimeStamp
Deleted
Description
DisplayName
DistinguishedName
DNSHostName
DoesNotRequirePreAuth
dSCorePropagationData
Enabled
frsComputerReferenceBL
HomedirRequired
HomePage
instanceType
IPv4Address
IPv6Address
isCriticalSystemObject
isDeleted
KerberosEncryptionType
LastBadPasswordAttempt
LastKnownParent
lastLogoff
lastLogon
LastLogonDate
lastLogonTimestamp
localPolicyFlags
Location
LockedOut
logonCount
ManagedBy
MemberOf
MNSLogonAccount
Modified
modifyTimeStamp
msDS-SupportedEncryptionTypes
msDS-User-Account-Control-Computed
Name
nTSecurityDescriptor
ObjectCategory
ObjectClass
ObjectGUID
objectSid
OperatingSystem
OperatingSystemHotfix
OperatingSystemServicePack
OperatingSystemVersion
PasswordExpired
PasswordLastSet
PasswordNeverExpires
PasswordNotRequired
PrimaryGroup
primaryGroupID
PrincipalsAllowedToDelegateToAccount
ProtectedFromAccidentalDeletion
pwdLastSet
rIDSetReferences
SamAccountName
sAMAccountType
sDRightsEffective
serverReferenceBL
ServiceAccount
servicePrincipalName
ServicePrincipalNames
SID
SIDHistory
TrustedForDelegation
TrustedToAuthForDelegation
UseDESKeyOnly
userAccountControl
userCertificate
UserPrincipalName
uSNChanged
uSNCreated
whenChanged
whenCreated
1行目はカラム名になっていない
csvの1行目は
#TYPE Microsoft.ActiveDirectory.Management.ADComputer
という文字列になっています。
2行目がカラム名になっています。
蛇足
LastLogonDate
OperatingSystemVersion
PasswordLastSet
IPv4Address
IPv6Address
あたりの情報が棚卸で役立ちます。
これらのActiveDirectoryが持っている情報の更新タイミングについて…
- クライアントPCの再起動&サインインをすると更新されました。
- クライアントPC側の設定変更直後やサインアウト&サインインだけでは更新されなかったです。
リアルタイムに情報が更新される訳ではないことに注意。