a) LDAP filter:
Get-ADComputer -LDAPFilter "(&(objectCategory=computer)userAccountControl:1.2.840.113556.1.4.803:=8192))"
ex:-
c) Get-ADDomainController cmdlet:
ex:-
Get-ADComputer -LDAPFilter "(&(objectCategory=computer)userAccountControl:1.2.840.113556.1.4.803:=8192))"
ex:-
PS C:\Users> Get-ADComputer -LDAPFilter "(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=8192))"
DistinguishedName : CN=IHM-CAM-DC-1,OU=Domain Controllers,DC=example,DC=local
DNSHostName : IHM-CAM-DC-1.example.local
Enabled : True
Name : IHM-CAM-DC-1
ObjectClass : computer
ObjectGUID : c1eff660-25f9-41de-9e41-acad98908abc
SamAccountName : IHM-CAM-DC-1$
SID : S-1-5-21-1370450699-4128765030-226702860-1000
UserPrincipalName :
DistinguishedName : CN=IHM-CAM-DC-2,OU=Domain Controllers,DC=example,DC=local
DNSHostName : IHM-CAM-DC-2.example.local
Enabled : True
Name : IHM-CAM-DC-2
ObjectClass : computer
ObjectGUID : 6bcee6cb-2f6f-4ea1-b7ab-842faca4bcd8
SamAccountName : IHM-CAM-DC-2$
SID : S-1-5-21-1370450699-4128765030-226702860-1103
UserPrincipalName :
b) "Domain controllers" group and retrieve his members:DistinguishedName : CN=IHM-CAM-DC-1,OU=Domain Controllers,DC=example,DC=local
DNSHostName : IHM-CAM-DC-1.example.local
Enabled : True
Name : IHM-CAM-DC-1
ObjectClass : computer
ObjectGUID : c1eff660-25f9-41de-9e41-acad98908abc
SamAccountName : IHM-CAM-DC-1$
SID : S-1-5-21-1370450699-4128765030-226702860-1000
UserPrincipalName :
DistinguishedName : CN=IHM-CAM-DC-2,OU=Domain Controllers,DC=example,DC=local
DNSHostName : IHM-CAM-DC-2.example.local
Enabled : True
Name : IHM-CAM-DC-2
ObjectClass : computer
ObjectGUID : 6bcee6cb-2f6f-4ea1-b7ab-842faca4bcd8
SamAccountName : IHM-CAM-DC-2$
SID : S-1-5-21-1370450699-4128765030-226702860-1103
UserPrincipalName :
ex:-Get-ADGroupMember 'Domain Controllers'
PS C:\Users> Get-ADGroupMember 'Domain Controllers'
distinguishedName : CN=IHM-PORT-DC-1,OU=Domain Controllers,DC=example,DC=local
name : IHM-PORT-DC-1
objectClass : computer
objectGUID : 0a591ca8-b52a-452b-b68a-629c7b16443b
SamAccountName : IHM-PORT-DC-1$
SID : S-1-5-21-1370450699-4128765030-226702860-1104
distinguishedName : CN=IHM-CAM-DC-2,OU=Domain Controllers,DC=example,DC=local
name : IHM-CAM-DC-2
objectClass : computer
objectGUID : 6bcee6cb-2f6f-4ea1-b7ab-842faca4bcd8
SamAccountName : IHM-CAM-DC-2$
SID : S-1-5-21-1370450699-4128765030-226702860-1103
c) Get-ADDomainController cmdlet:
Get-ADDomainController -Filter * | Select-Object name
ex:-
PS C:\Users> Get-ADDomainController -Filter * | Select-Object name
name
----
IHM-CAM-DC-1
IHM-CAM-DC-2
No comments:
Post a Comment
Thank You.
https://linwintech.blogspot.com/