I have multiple DHCP servers that I need to be able to manage, that are all core servers. With the DHCP module being rich in functionality, what better time to learn Powershell with a definite goal in front of me. This demonstrates that remoting is setup properly (I think, as I am executing a core command between systems and I am going cross domains successfully). However, I cannot make a listing of DHCP servers work.
PS C:\WINDOWS\system32> Get-Process Powershell Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName ------- ------ ----- ----- ------ -- -- ----------- 818 45 156904 200928 5.44 4532 1 powershell 772 39 142328 165348 2.23 13536 1 powershell PS C:\WINDOWS\system32> Invoke-Command -ComputerName 192.168.1.1 -Credential foo\DomainAdmin -ScriptBlock{Get-Process Powershell} Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName PSComputerName ------- ------ ----- ----- ------ -- -- ----------- -------------- 685 46 156808 162652 17.09 2436 1 powershell 192.168.1.1 PS C:\WINDOWS\system32> Invoke-Command -ComputerName 192.168.1.1 -Credential foo\DomainAdmin -ScriptBlock{Get-DHCPServerInDC} Failed to initialize directory service resources for domain foo.bar.us. + CategoryInfo : ResourceUnavailable: (PS_DhcpServerInDC:root/Microsoft/..._DhcpServerInDC) [Get-DhcpServ erInDC], CimException + FullyQualifiedErrorId : DHCP 20070,Get-DhcpServerInDC + PSComputerName : 192.168.1.1 PS C:\WINDOWS\system32>
I did spend some time going over what Powershell chaining or Double Hop is, and no this issue is not that. I am doing a 1-to-1 mapping with no intermediate system. (Enlighten me if I am wrong, I will try not take it as Lighting me…) This was launched from an administrative shell on the local workstation directly to the server in question. Yes, when launched locally the Get-DHCPServerInDC completes and returns a list of servers, on both the Workstation and Server.
I am seeing that the Directory Service is unavailable in Foo, but what is causing the unavailability? Where do I go to further troubleshoot? Is this expected behavior and it is my expectation that needs to change?
Any help would be greatly appreciated.
All system IPs, Domain Names, and Account Names have been changed to protect the innocent.
-Sean.
Addendum #1
I did a :
$cs = New-CIMSession -ComputerName 192.168.1.1 -Credential foo\DomainAdmin Get-DHCPServerInDC -CimSessioin $cs
and got the same error message as above. At least behavior is consistent.