AD NLTEST CMD in Brief
NLTEST to test the trust relationship between a workstation and domain
Table of Contents:
1.NLTEST can be used to show this trust relationship.
PS C:\> nltest /trusted_domainsList of domain trusts:0: GS gs.com (NT 5) (Direct Outbound) (Direct Inbound) ( Attr: 0x8 )1: CONTOSO contoso.com (NT 5) (Forest Tree Root) (Primary Domain) (Native)The command completed successfully2.To determine the domain controllers in the CONTOSO domain:
PS C:\> nltest /dclist:contosoGet list of DCs in domain 'contoso' from '\\WIN-5Q4IM0060DO'.WIN-5Q4IM0060DO.contoso.com [PDC] [DS] Site: IND-BLRThe command completed successfully3.To determine the domain controllers in the CONTOSO domain:
PS C:\> nltest /dclist:contosoGet list of DCs in domain 'contoso' from '\\WIN-5Q4IM0060DO'.WIN-5Q4IM0060DO.contoso.com [PDC] [DS] Site: IND-BLRThe command completed successfully4.Below are the secure channels between each domain controller in CONTOSO and a DC in the MICROSOFT domain.
C:\>nltest /server:test1 /sc_query:microsoftFlags: 0Connection Status = 0 0x0 NERR_SuccmicrosoftTrusted DC Name \\NET1Trusted DC Connection Status Status = 0 0x0 NERR_SuccmicrosoftThe command completed succmicrosoftfullyC:\>nltest /server:test2 /sc_query:microsoftFlags: 0Connection Status = 0 0x0 NERR_SuccmicrosoftTrusted DC Name \\NET1Trusted DC Connection Status Status = 0 0x0 NERR_SuccmicrosoftThe command completed succmicrosoftfully5.The workstation that is a member of the CONTOSO domain has an implicit trust with a domain controller.
C:\>nltest /server:Computer1 /sc_query:contosoFlags: 0Connection Status = 0 0x0 NERR_SuccmicrosoftTrusted DC Name \\TEST2Trusted DC Connection Status Status = 0 0x0 NERR_SuccmicrosoftThe command completed succmicrosoftfully6.To determine if a domain controller can authenticate a user account:
PS C:\> nltest /whowill:contoso biz
[11:06:22] Mail message 0 sent successfully (\MAILSLOT\NET\GETDC834)
[11:06:22] Response 0: NetpDcAllocateCacheEntry: new entry 0x000000D83F9ADBD0 -> DC:WIN-5Q4IM0060DO DnsDomName:(null) Flags:0x0
S:WIN-5Q4IM0060DO D:CONTOSO A:biz (Act found)The command completed successfully7.NLTEST can be used to find a trusted domain that has a given user account.
8.Determine SRV priorities and weights (Command for trusting and trusted domain)
PS C:\> nltest /dnsgetdc:contoso.comList ofDCs inpseudo-random order taking into account SRV priorities andweights:Non-Site specific:win-5q4im0060do.contoso.com fe80::e0a8:9c56:ba17:df5d%1210.224.34.1The command completed successfullyPS C:\> nltest /dnsgetdc:gs.comList ofDCs inpseudo-random order taking into account SRV priorities andweights:Non-Site specific:ban-dc01.gs.com 10.224.34.10The command completed successfullyPS C:\>
9.Determine the failures for all DC-specific DNS records
PS C:\> nltest /DSQUERYDNSFlags: 0Connection Status = 0 0x0 NERR_SuccessThere was no failure in the last update for all DC-specific DNS recordsThe command completed successfully10.Reset the NETLON secure channel
nltest /sc_reset:<domainname>
Below are the cmd to force manually to register & deregister resource record:
- Forced manual registration: NLTEST /DSREGDNS
- Forced manual deregistration: NLTEST /DSDEREGDNS:<FQDN DC>
