Open DonDom86 opened 2 years ago
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
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
+ CategoryInfo : ObjectNotFound: (:) [Get-ADDomainController], ADIdentityNotFoundException
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException,Microsoft.ActiveDirectory.Management.Commands.GetADDomainController
30
PS C:\Windows\system32>
`
Can you tell e what sort of this WAN optimizer is ? is it some product or what?
For example
It's a bad implementation of the riverbed, because this appliance is a "fake rodc.
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?