Does this implicate that machines having a WSMAN spn and not having a HTTP spn will fail in the nearby future? Or will WSMAN still be tried when the HTTP SPN isn’t there?
Yes it will technically fail if there is no HTTP SPN registered and it won’t fallback to WSMAN. But keep in mind that while WSMAN/* is an SPN that is explicitly registered to a principal, HTTP is one that is implicitly there for “HOST” registrations. We can see that the servicePrincipalName for a computer principle contains an explicitly entry for WSMAN but nothing for HTTP.
(Get-ADComputer TESTHOST -Property servicePrincipalName).servicePrincipalName
WSMAN/testhost
WSMAN/testhost.domain.test
TERMSRV/TESTHOST
TERMSRV/testhost.domain.test
RestrictedKrbHost/TESTHOST
HOST/TESTHOST
RestrictedKrbHost/testhost.domain.test
HOST/testhost.domain.test
But for any HOST/* entries it will also automatically apply the following mappings to the principal
$dse = Get-ADRootDSE
$mappings = Get-ADObject -Identity "CN=Directory Service,CN=Windows NT,CN=Services,$($dse.ConfigurationNamingContext)" -Properties sPNMappings
$mappings.sPNMappings
# host=alerter,appmgmt,cisvc,clipsrv,browser,dhcp,dnscache,replicator,eventlog,eventsystem,policyagent,oakley,dmserver,dns,mcsvc,fax,msiserver,ias,messenger,netlogon,netman,netdde,netddedsm,nmagent,plugplay,protectedstorage,rasman,rpclocator,rpc,rpcss,remoteaccess,rsvp,samss,scardsvr,scesrv,seclogon,scm,dcom,cifs,spooler,snmp,schedule,tapisrv,trksvr,trkwks,ups,time,wins,www,http,w3svc,iisadmin,msdtc
We can see that http is part of this list so will automatically be part of a host principal vs WSMAN needing to be registered specifically by the service. This is the cause behind your problem where some hosts had WSMAN but other hosts like a domain controller did not causing problems.
The pywinrm library used by the winrm connection plugin uses HTTP and is why I changed the default to that in pypsrp.
I might revisit this before the next release because after tracing the normal WinRM client in PowerShell I’ve found that Kerberos actually uses the HOST SPN and not HTTP
# .\Trace-Process.ps1 -ProcessId $pwshClientProcessId -Metadata @{Secur32='Initialize*'} -OutputFormat Yaml
- Function: Secur32.dll!InitializeSecurityContextW
Time: 2026-01-13T04:58:12.0801232+10:00
ThreadId: 2584
Arguments:
Credential: 0x262E51DC088 - PCredHandle
Context: 0x00000000 - PCtxtHandle
TargetName:
Raw: 0x262E51DC0AC - Pointer
Value: HOST/test.domain.test # <<<<----- Shows PowerShell uses HOST
ContextReq: 0x00000017 - ISC_REQ_DELEGATE, ISC_REQ_MUTUAL_AUTH, ISC_REQ_REPLAY_DETECT, ISC_REQ_CONFIDENTIALITY
Reserved1: 0
TargetDataRep: 0x00000010 - SECURITY_NATIVE_DREP
Input:
Raw: 0x00000000 - PSecBufferDesc
Reserved2: 0
NewContext: 0x262E51DC098 - PCtxtHandle
Output:
Raw: 0x347BE0E910 - PSecBufferDesc
Version: 0
Count: 1
BufferPtr: 0x347BE0E8E8 - PSecBuffer
Buffers:
- Type: 0x00000002 - SECBUFFER_TOKEN
Flags: 0x00000000 - SECBUFFER_NONE
Size: 48256
Raw: 0x262E5B32070 - Pointer
Data: ""
ContextAttr: 0x347BE0E8C0 - Pointer
Expiry: 0x347BE0E900 - PTimeStamp
From a consistency with pywinrm using HTTP makes sense but using HOST seems to be more correct and is what the native client does. It also ensures that hosts where the HTTP SPN was registered to another principal wouldn’t have WinRM fail with Kerberos auth as the HOST principal should always be the host.