ADEssentials icon indicating copy to clipboard operation
ADEssentials copied to clipboard

Get-WinADForestDetails not working with WAN-Optimizer

Open DonDom86 opened this issue 3 years ago • 5 comments

If there are WAN-Optimizer in an active directory environment this function is not working. This is because Get-ADDomainController -Filter * Small change and it will also work in these environments.

#$DomainControllers = Get-ADDomainController -Filter $Filter -Server $QueryServer -ErrorAction Stop $DomainControllers = (Get-ADDomain -Identity $Domain).ReplicaDirectoryServers | ForEach { Get-ADDomainController -Identity $_ -Server $QueryServer }

This change should be done in multiple modules our maybe a chance for refactoring? image

DonDom86 avatar Aug 24 '22 09:08 DonDom86

This is coming from a single module: https://github.com/EvotecIT/PSSharedGoods/blob/master/Public/ActiveDirectory/Get-WinADForestDetails.ps1

During deployment the function is merged for those modules so that you don't need pssharedgoods for all modules. So if you modify it there, next release for all modules it will fix itself.

You would need to tell me more what happens with WAN Optimizer because I am not sure what happens? Also in future I would like to remove dependency on Get-ADDomain and use non-rsat way

PrzemyslawKlys avatar Aug 24 '22 10:08 PrzemyslawKlys

Hopefully this can help :-)

` PS C:\Windows\system32> $Filter = "*" $QueryServer = $env:COMPUTERNAME $Domain = $env:USERDOMAIN $Test1 = Get-ADDomainController -Filter $Filter -Server $QueryServer -ErrorAction Stop

$Test2 = (Get-ADDomain -Identity $Domain).ReplicaDirectoryServers | ForEach { Get-ADDomainController -Identity $_ -Server $QueryServer } $Test2.count Get-ADDomainController : Directory object not found At line:4 char:10

  • $Test1 = Get-ADDomainController -Filter $Filter -Server $QueryServer ...
  •      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (:) [Get-ADDomainController], ADIdentityNotFoundException
    • FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException,Microsoft.ActiveDirectory.Management.Commands.GetADDomainController

30

PS C:\Windows\system32>
`

DonDom86 avatar Aug 24 '22 13:08 DonDom86

Can you tell e what sort of this WAN optimizer is ? is it some product or what?

PrzemyslawKlys avatar Aug 24 '22 13:08 PrzemyslawKlys

For example

https://www.riverbed.com/de/products/steelhead

DonDom86 avatar Aug 24 '22 13:08 DonDom86

It's a bad implementation of the riverbed, because this appliance is a "fake rodc.

https://social.technet.microsoft.com/Forums/windowsserver/en-US/5260ae0c-79c7-459a-ae01-168098e5d220/getaddomaincontroller-directory-object-not-found?forum=winserverpowershell

DonDom86 avatar Aug 24 '22 13:08 DonDom86