Friday, June 1, 2018

Check If SRV record is created or not in DNS



Check If SRV record is Resolved from any of DC so that will come to know Record is created in DNS for particular DC or Server.

nslookup -q=SRV _ldap._tcp. <domain name>

Example :

nslookup -q=SRV _ldap._tcp.bbn.com


Get logged in DC and sites name, domain of Active Directory User



nltest /dsgetdc:domain_name       

Example :
nltest /dsgetdc:bbn.com       

Active Directory : Check where the object was modified and how many times for particular user



repadmin /showobjmeta <NGUKDC8MDS004> " DN"


Example:

repadmin /showobjmeta DC1  "CN=BBN,OU=Service Accounts,OU=Administration,DC=US,DC=AD,DC=net"



Flush DNS, NetBios name and Kerberos



To clear DNS name cache you type in: IPConfig /FlushDNS
    To clear NetBIOS name cache you type in: NBTStat –R
    To clear Kerberos tickets will need KList.exe: KList purge


Powershell command will return all deleted objects from Active Directory



Get-ADObject -Filter {(isdeleted -eq $true) -and (name -ne "Deleted Objects")} -includeDeletedObjects -property *


With date range \\

[datetime]$StartTime = "8/1/2013"
[datetime]$EndTime = "9/1/2013"
Get-ADObject -Filter {(isdeleted -eq $true) -and (name -ne "Deleted Objects")} -includeDeletedObjects -property whenChanged | Where-Object {$_.whenChanged -ge $StartTime -and $_.whenChanged -le $EndTime}


[datetime]$StartTime = "8/1/2013"
[datetime]$EndTime = "9/1/2013"
Get-ADObject -Filter {(isdeleted -eq $true) -and (name -ne "Deleted Objects")} -includeDeletedObjects -property whenChanged | Where-Object {$_.whenChanged -ge $StartTime -and $_.whenChanged -le $EndTime}



Get list of Dcs with Seleted properties



Get-ADDomainController -Filter * | Select Name, ipv4Address, OperatingSystem, site | Sort-Object -Property Name >C:\DC_Overview.txt


Get list of Dcs with All extra properties\\
Get-ADDomainController -Filter *


Get Domain Controller with all Properties of one DC\\
 Get-ADDomainController <dc name>




Get all the AD users and Computers



Get all the AD Users/  Get-ADUser -Filter * -Properties * | export-csv C:\Users\bbn\Desktop\AD_Uerslist.csv


Get all the AD computers / Get-ADComputer -Filter * -Properties *  | export-csv C:\Users\BBN\Desktop\AD_Computerlist.csv