Get-AdComputer is not showing originating server

When I run an AD enumeration script, the Server I am running FROM never shows in the list… WHY?

$serverListFile = Get-adcomputer "OU=containerofeveryserver,DC=domain,DC=root" -filter {name -like "*servernamecontext*"} -SearchScope Subtree -Properties DNSHostName|select DNSHostName
$serverListFile|where {$_.DNSHostname -eq "localserverhostname"} #does not show
$serverListFile.DNSHostname|grep -Pattern localserverhostname #does not show either
$serverListFile.DNSHostname|grep -Pattern localserverhostname.domain.root #does not show either

But THIS shows???

$serverListFile.DNSHostname|grep -Pattern $env:COMPUTERNAME #does show
frustrated person staring at screen of computer

CAN it be an update changed something??? Here are All the latest KBs on this 2016 Server:

  • KB4049065
  • KB4535680
  • KB4589210
  • KB5001402
  • KB5005698
  • KB5006669

Something definitely changed from last week to this week…


Posted

in

,

by