
If you’ve spent some time managing Active Directory, you’ll know how important it is to ensure that all subnets are linked to appropriate sites in AD sites and services console. Otherwise you may see slow logon or GPO issues in your environment. Using below script you can find all subnets which exist in your environment but have not yet been created in AD sites and services.
1 2 3 4 5 6 7 8 9 10 11 12 | $servers = "DC1", "DC2", "DC3", "DC4", "DC5", "DC6" foreach ($server in $servers){ $lines = Get-Content \\$server\c$\Windows\debug\netlogon.log #$lines = Get-Content \\$server\c$\Windows\debug\netlogon.log | Select-Object -First 60000 foreach ($line in $lines){ if ($line -match "NO_CLIENT_SITE"){ $client = $line.Split(":")[4].trim(" ").Split(" ")[0] $ip = $line.Split(":")[4].trim(" ").Split(" ")[1] Add-Content -Value "$server '|' $client '|' $ip" -Path C:No_client_site.txt } } } |
You do not need to enable netlogon debug logging, No_Client_Site information is captured in netlogon logs by default.
Leave a Reply