Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

30 lines (28 sloc) 631 Bytes
function Get-ClientsUnderNoSite
{
[CmdletBinding()]
param ()
try
{
## Find all DCs in the forest
$dcs = ((Get-ADForest).Domains | foreach { (Get-ADDomainController -Server $_ -Filter *) }).HostName
foreach ($d in $dcs)
{
$output = @{'DomainController' = $d}
$clients = Select-String -Pattern 'NO_CLIENT_SITE: (.*) \d' -Path "\\$d\c$\windows\debug\netlogon.log" | foreach {
$_.Matches.Groups[1].Value
} | Group-Object
if ($clients)
{
$clients | foreach {
$output.Client = $_.Name
[pscustomobject]$output
}
}
}
}
catch
{
Write-Error -Message $_.Exception.Message
}
}
You can’t perform that action at this time.