Currently in a powershell class, one of the tasks was to run a get-wmiobject as a job.
Gwmi win32_bios -cn lon-dc1 -asjob
The error i am getting is "The RPC server is unavailable".
I have disabled the firewall on the remote computer and the same error comes up.
If i run the gwmi command without the -asjob this works. If i wrap it in invoke-command this works too but myself and the instructor are unable to understand why it fails when i add -asjob at the end.
Much appreciated if someone can answer and i can tell my instructor. 🙂
You don't say what OS version or PoSH version you are using on the host and remote host.
Well, this comes off as an environmental issue on the target and/or on your host.
Here are some items to check
1 – Check that DCOM is enabled on both the host and the target PC.
2 – GPO Computer Configuration\Administrative Templates\Windows Components\WinRM\Client\Trusted Hosts
3 – Check the following services state, that all need to be running
4 – On the remtoe host – disable the Firewall for all profiles
Remember this, there are a fwe commands that don't need / use PSRemtoing.
As noted on this forum and others..
Many thanks for replying I shall remember to try this next time I encounter the issue.
It just confused us that Gwmi win32_bios -cn lon-dc1 works but when I add -asjob it fails to work.
You must be logged in to reply to this topic.