How to find the inactive users in a domain
To find all users in only the current domain, who have been inactive for 3 weeks or more, and display their DNs: dsquery user domainroot -name -inactive 3
To find all users in only the current domain, who have been inactive for 3 weeks or more, and display their DNs: dsquery user domainroot -name -inactive 3
To extract all the users in the OU with the Password never expires details, we can user Dsquery or CSVDE commands Use the blow command to find and export users with Password never expires in Active Directory Dsquery command dsquery user “OU=Test,DC=test,DC=com” -limit 0 | dsget user -pwdneverexpires >c:tempUsers.txt dsquery user “OU=Test,DC=test,DC=com” –o rdn -limit… Read More »
If you are working with command-line tools to manage the active directory then you will require an LDAP path as an input for the commands (like dsget, dsmod), how to find the LDAP path? or LDAP DN To know more about LDAP and LDAP Query, like the difference between Distinguished Name (DN) and Relative Distinguished… Read More »
How to verify KCC disabled, do you know ISTG is enabled or disabled for you active directory sites, you check the ISTG status using below command command Verify KCC status on intersite (by default KCC enabled) dsquery site -name Default-First-Site-Name | dsget site –autotopology autotopologynodsget succeeded Note: If automatic inter-site topology generation is enabled (yes)… Read More »
Command to find the site name for given DC Command to find site name for the given domain controller dsquery server test01 -site domain controller name = test01
Command to find all DCs in the given site Command to find all the Domain Controllers in the “Default-First-Site-Name” site dsquery server -o rdn -site Default-First-Site-Name Site name = Default-First-Site-Name
Command to find all the subnets for the given site Command to find all the subnet associated to the “Default-First-Site-Name” site in AD dsquery subnet -o rdn -site Default-First-Site-Name Site name = Default-First-Site-Name
Command to Find the site name for given subnet in AD, some time we know the IP and subnet and we have to find the site in active directory, you can use the below command dsquery subnet -name 192.168.1.0/24 | dsget subnet -site Subnet = 192.168.1.0/24 Please replece the above subnet with your subnet to… Read More »
Command to troubleshoot DNS issues (Nslookup Advance Usage) Nslookup is a command-line tool used to test and troubleshoot the DNS issues Find the advance help for Nslookup C:>nslookupDefault Server: ns1chn.vsnl.comAddress: 202.54.6.60 > ?Commands: (identifiers are shown in uppercase, [] means optional)NAME – print info about the host/domain NAME using default serverNAME1 NAME2 – as above,… Read More »
Command to find the number of Sitelink’s for the corresponding site csvde -f C:Tempsite.csv -d “CN=Inter-Site Transports,CN=Sites,CN=Configuration,DC=test,DC=com” -r “(CN=*site2*)” -l “cn” In the above command you will get the output in site.csv file, it contains all the Sitelinks and it’s corresponding DN Eg: Output DN,cn“CN=site1/site2,CN=IP,CN=Inter-Site Transports,CN=Sites,CN=Configuration,DC=test,DC=com”, site1/site2 In this site2 – Site Namesite1/site2 – Sitelink… Read More »