Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-WinADForestDetails not working with WAN-Optimizer #32

Open
DonDom86 opened this issue Aug 24, 2022 · 5 comments
Open

Get-WinADForestDetails not working with WAN-Optimizer #32

DonDom86 opened this issue Aug 24, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@DonDom86
Copy link

DonDom86 commented Aug 24, 2022

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

@PrzemyslawKlys
Copy link
Member

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

@DonDom86
Copy link
Author

DonDom86 commented Aug 24, 2022

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>
`

@PrzemyslawKlys
Copy link
Member

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

@DonDom86
Copy link
Author

@DonDom86
Copy link
Author

@PrzemyslawKlys PrzemyslawKlys added the enhancement New feature or request label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants