How to run Get-DhcpServerv4OptionValue through Invoke-Command
I have a situation where I want to run Powershell
Get-DhcpServerv4OptionValue to query my DCHP server's (DhcpServerA) option values.
Unfortunately the machine I want to run this from (Machine A) does not have the modules available so I can't run it form there:
The specified module 'DhcpServer' was not loaded because no valid module file was found in any module directory.
However, I have a nearby server (Machine B) which does have the commands I need. I have tested running the powershell commands locally on this box and it returns the values I need.
So what I have tried doing is running the same command through
Invoke-Command on Machine B, from the original Machine A.
What I don't understand is that this does not seem to be working:
Failed to get version of the DHCP server DhcpServerA.
+ CategoryInfo : PermissionDenied: (DhcpServerA:root/Microsoft/...erv4OptionValue) [Get-DhcpServerv4OptionValue], CimException
+ FullyQualifiedErrorId : WIN32 5,Get-DhcpServerv4OptionValue
+ PSComputerName : MachineB
1) Why is this? (edit: Is this the Kerberos Double Hop problem?)
2) Is there another way of getting the modules onto Machine A (I can't install roles/features/RSAT) if they exist on Machine B
3) Is there another way of querying the dhcp server for the option values?
@Mathias R. Jessen - Thanks for the link, I tried that but it looks like my snag happens earlier;
Set-ADComputer : Insufficient access rights to perform the operation when attempting to run
Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount $ServerB