The WinRM secret you’re not using

Hello again (yes it’s been awhile sense my last post).

Working on a script for work I came across an interesting behavior of WinRM. When I attempt to connect to a domain controller of a non-trusted domain and I use a samAccountname [domain\username] I get the following (and typical) error:

winrm-error

The $sam cred looks like:

sam

…BUT if I use UPN the Invoke-Command works:

invoke-results

The $upn looks like:

upn

The client computer is a member of a domain but not the “thenewtonlab.com” domain…I’ve tested this from a workgroup computer and it fails…

Next time your having WinRM issues give this a try…let me know how it goes. I’d love to hear if it works for you as well.

Happy scripting,

D

EDIT:

So after doing some further testing geeking, I’ve found that using the UPN works around the configuration needed for CredSSP to connect to SharePoint (as listed here).

AND…this works for a WORKGROUP computer if you run:

Set-Item WSMan:\localhost\Client\TrustedHosts -Value “*” -Force (from an elevated shell)

This has been a great find for me. Now it’s beer:30  🙂

The WinRM secret you’re not using

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top