Failed to initialize directory services

Hi guys,

I hope someone can help me with an error I am receiving. I have ServerA in Domain1 and my workstation in Domain2.

When I am on ServerA I can do “Get-DHCPServerInDC” and it returns a list of DHCP servers as expected.

However when I Enter-PSSession to the server from my workstation using the correct credentials for Domain1 I get the following error:

Failed to initialize directory service resources for domain Domain1.
+ CategoryInfo : ResourceUnavailable: (PS_DhcpServerInDC:root/Microsoft/…_DhcpServerInDC) [Get-DhcpServerInDC], CimException
+ FullyQualifiedErrorId : DHCP 20070,Get-DhcpServerInDC
+ PSComputerName : ServerA.Domain1

I have also tried Invoke-Command instead of Enter-PSSession but I get the same error. I also get the same error if I Enter-PSSession or Invoke-Command from another server in the same Domain as ServerA.

Thanks a lot!

Pretty sure you might be hitting some form of double hop, but it may not be the double hop. Wondering if there is something going on under the covers of the AD module that’s creating the issue. Also what if any relationship do the two domains have, it’s not clear from your original description if they are child/parent or completely unrelated.

Thanks for the reply. The domains are completely seperate from each other no trusts set up either.

Yeah i think in that case you’re hitting a double hop.

https://blogs.technet.microsoft.com/ashleymcglone/2016/08/30/powershell-remoting-kerberos-double-hop-solved-securely/

OK I’ll check it out and let you know… thanks

Although I do get the same error even when I try to Enter-PSSession or Invoke-Command from a server in the same domain. It works fine locally however on the server.

Did you ever get this resolved? I have run into the same issue and am struggling.

On same domain:
Are able to enter a pssession, then run get-dhcpserverindc?

enter-pssession -computername servera -credential domain1\administrator
[ServerA]: PS c:\administrator\documents get-dhcpserverindc

Just run the powershell shell as domain administrator and run the cmdlet für authorizing the dhcp.