- Courses
- đź’»Programming Languages
- 🪟PowerShell
- PowerShell for System Administration
- Remote Management
- Security Considerations
On this page
PowerShell Remoting Security: Best Practices Guide
Updated on June 18, 2026
By Enrico Hochkoeppler
Web Developer & TutoriaLibre Founder
PowerShell Remoting is the recommended way to manage Windows systems and is enabled by default in Windows Server 2012 R2 and later. A secure remoting implementation requires strong authentication (preferably Kerberos), encryption of all communication, proper authorization through group membership and session configurations, careful handling of multi-hop scenarios, comprehensive logging and auditing, and thoughtful firewall and network design. When these principles are applied, PowerShell Remoting becomes a secure and reliable foundation for large-scale remote administration.
The Security Model Behind WinRM​
WinRM enforces a strict security model based on three pillars:
- Authentication — verifying the identity of the user connecting.
- Authorization — determining what that user is allowed to do.
- Encryption — ensuring that all communication is protected from interception.
PowerShell Remoting does not bypass Windows security; instead, it integrates with it. Every remote command runs under the security context of the authenticated user, and the remote system enforces the same permissions that would apply if the user were logged in locally.
WinRM runs as a service under the Network Service account and spawns isolated processes running as user accounts to host PowerShell instances. An instance of PowerShell running as one user has no access to a process running an instance of PowerShell as another user, providing process-level isolation.
Authentication Methods​
WinRM supports several authentication mechanisms, each suited to different environments.
Kerberos (Default in Domain Environments)​
Kerberos is the preferred authentication method because:
- It does not require sending credentials over the network.
- It supports mutual authentication, ensuring both sides verify each other.
- It avoids the double-hop problem when configured with delegation.
When both machines are domain-joined, Kerberos is used automatically.
NTLM (Fallback When Kerberos Is Unavailable)​
NTLM is used when machines are not domain-joined or when Kerberos cannot be negotiated. NTLM is secure but lacks mutual authentication and is more limited in multi-hop scenarios.
CredSSP (For Multi-Hop Authentication)​
CredSSP allows credentials to be delegated to a remote machine so that the remote session can authenticate to a third system. This is useful but must be enabled carefully because it increases the risk of credential exposure if the remote machine is compromised.
Basic Authentication (Only Over HTTPS)​
Basic authentication sends credentials in a reversible form and must never be used without HTTPS. It is typically reserved for legacy systems or constrained environments.
Encryption of Remote Sessions​
It is helpful to consider the security of a PowerShell Remoting connection from two perspectives: initial authentication and ongoing communication. Regardless of the transport protocol used (HTTP or HTTPS), WinRM always encrypts all PowerShell remoting communication after initial authentication.
Even when using HTTP (port 5985), PowerShell Remoting encrypts all traffic using the session key negotiated during authentication. This means:
- Commands and output are encrypted.
- Credentials are protected during authentication.
- Attackers cannot read the contents of the session even if they intercept the traffic.
However, encryption alone does not guarantee identity verification. For environments requiring strict identity assurance, HTTPS (port 5986) should be used.
Encryption Details by Authentication Method​
- Basic authentication provides no encryption.
- NTLM authentication uses an RC4 cipher with a 128-bit key.
- Kerberos authentication uses the encryption type specified in the TGS ticket. Modern systems use the AES-256 algorithm.
- CredSSP encryption uses the TLS cipher suite negotiated in the handshake.
When you connect over HTTPS, WinRM uses the TLS protocol to negotiate the encryption used to transport data. When you connect over HTTP, WinRM uses the message-level encryption negotiated by the initial authentication protocol.
Using HTTPS for Enhanced Security​
Configuring WinRM to use HTTPS provides:
- Certificate-based server authentication.
- Strong protection against man-in-the-middle attacks.
- The ability to use Basic authentication safely.
- Compliance with security policies requiring encrypted endpoints.
HTTPS remoting requires:
- A valid SSL certificate.
- A listener configured for HTTPS.
- Matching hostnames.
- Appropriate firewall rules.
Once configured, the remoting experience is identical, but the connection is more secure.
NTLM-Based Server Identity​
Assigning an SSL certificate to the target server (if issued by a Certificate Authority that the client also trusts) enables NTLM-based authentication that guarantees both the user identity and server identity.
If deploying an SSL certificate to a server for NTLM connections is infeasible, you can suppress the resulting identity errors by adding the server to the WinRM TrustedHosts list. Adding a server name to the TrustedHosts list should not be considered as any form of statement of the trustworthiness of the hosts themselves—as the NTLM authentication protocol cannot guarantee that you are in fact connecting to the host you are intending to connect to. Instead, consider the TrustedHosts setting to be the list of hosts for which you wish to suppress the error generated by being unable to verify the server's identity.
Authorization and Access Control​
Authentication determines who the user is; authorization determines what they can do.
Local Group Membership​
Users must be members of the Administrators group (full access) or the Remote Management Users group (limited access). Membership in these groups determines whether a user can establish a remote session.
Session Configuration Permissions​
Each remoting endpoint has an associated security descriptor that defines:
- Which users may connect.
- Which users may run commands.
- What capabilities are available inside the session.
This allows administrators to create highly restricted environments, limiting users to specific tasks.
The Role of Session Configurations in Security​
Session configurations (endpoints) are a critical security boundary. They allow administrators to:
- Restrict available cmdlets.
- Limit access to the PowerShell language.
- Preload specific modules.
- Prevent access to the file system.
- Enforce auditing and logging.
- Define which users may connect.
This mechanism is the foundation of Just Enough Administration (JEA), which provides role-based, least-privilege remote access. JEA enables you to remove users from widely privileged local or domain administrator roles and carefully control what they can do on each machine.
Securing Restricted Sessions​
For restricted sessions, follow these recommendations:
- Limit the use and capabilities of PowerShell providers — Do not allow the FileSystem provider. If users can write to any part of the file system, it is possible to completely bypass security. Do not allow the Certificate provider; with the provider enabled, a user could gain access to stored private keys.
- Do not allow commands that can create new runspaces — The Windows Compatibility feature in PowerShell 7 creates a new runspace to host Windows PowerShell. Do not allow any commands that would run via the Windows Compatibility feature. The
*-Jobcmdlets can create new runspaces without the restrictions. - Do not allow the
Trace-Commandcmdlet — UsingTrace-Commandbrings all traced commands into the session. - Do not create your own proxy implementations for the restricted commands — PowerShell has a set of proxy commands for restricted command scenarios. These proxy commands ensure that input parameters cannot compromise the security of the session.
- Configure the session to use NoLanguage mode — NoLanguage mode disables the PowerShell scripting language completely. Users cannot run scripts or use variables. They can only run native commands and cmdlets.
- Do not allow the debugger to be used in the session — By default, the PowerShell debugger runs code in FullLanguage mode. Set the
UseFullLanguageModeInDebuggerproperty in the SessionState to false.
The Double-Hop Problem​
When a remote session attempts to access a third system, authentication may fail because the remote machine cannot reuse the user's credentials. This is known as the double-hop problem.
By default, PowerShell Remoting uses Kerberos (if available) or NTLM for authentication. Both of these protocols authenticate to the remote machine without sending credentials to it. This is the most secure way to authenticate, but because the remote machine does not have the user's credentials, it cannot access other computers and services on the user's behalf.
Solutions to the Double-Hop Problem​
The following table lists the methods in order of preference:
ConfigurationNoteResource-based Kerberos constrained delegationHigher security with simpler configurationKerberos constrained delegationHigh security but requires Domain AdministratorJust Enough Administration (JEA)Can provide the best security but requires more detailed configurationPSSessionConfiguration using RunAsSimpler to configure but requires credential managementCredSSPBalances ease of use and securityPass credentials inside an Invoke-Command script blockSimplest to use but you must provide credentials**Kerberos delegation (unconstrained)**Not recommended
CredSSP Considerations​
CredSSP caches credentials on the remote server, so using it opens you up to credential theft attacks. If the remote computer is compromised, the attacker has access to the user's credentials. CredSSP is disabled by default on both client and server computers. You should enable CredSSP only in the most trusted environments.
Resource-Based Kerberos Constrained Delegation​
For resource-based Kerberos constrained delegation, WinRM (and therefore PowerShell remoting) runs as the computer account by default. To allow delegation, set the PrincipalsAllowedToDelegateToAccount parameter on the target server to the computer object of the intermediate server.
The Kerberos Key Distribution Center (KDC) caches denied-access attempts for 15 minutes. If the intermediate server previously attempted to access the target server, you need to clear the cache.
Logging and Auditing​
PowerShell Remoting integrates with Windows logging systems, providing visibility into remote activity.
Important Event Logs​
- PowerShell Operational Log (
Microsoft-Windows-PowerShell/Operational) - WinRM Logs (
Microsoft-Windows-WinRM/Operational) - Security Log (authentication events)
Researchers from Mandiant presented a session at the BlackHat conference that provides a good summary of the event logs and other security evidence generated by PowerShell Remoting sessions.
These logs allow administrators to:
- Trace remote commands.
- Investigate suspicious activity.
- Audit administrative actions.
- Monitor failed authentication attempts.
Firewall and Network Considerations​
WinRM uses:
- Port 5985 for HTTP
- Port 5986 for HTTPS
Firewalls must be configured to allow inbound traffic on these ports. In tightly controlled environments, administrators often restrict access to specific management subnets or require VPN connections.
Firewall Rules by Network Type​
On private networks, the default Windows Firewall rule for PowerShell Remoting accepts all connections. On public networks, the default Windows Firewall rule allows PowerShell Remoting connections only from within the same subnet. You have to explicitly change that rule to open PowerShell Remoting to all connections on a public network.
Warning: The firewall rule for public networks is meant to protect the computer from potentially malicious external connection attempts. Use caution when removing this rule.
Summary​
Security is an integral part of PowerShell Remoting. A secure remoting environment requires:
- Strong authentication — preferably Kerberos, which does not send credentials over the network.
- Encryption of all communication — WinRM always encrypts all PowerShell remoting communication after initial authentication, regardless of the transport protocol.
- Proper authorization through group membership and session configurations.
- Careful handling of multi-hop scenarios — prefer resource-based Kerberos constrained delegation over CredSSP.
- Logging and auditing of remote activity.
- Thoughtful firewall and network design — restrict access to specific subnets where possible.
- HTTPS endpoints for environments requiring strict identity assurance.
- Restricted session configurations that limit providers, cmdlets, and language features.
When these principles are applied, PowerShell Remoting becomes a secure and reliable foundation for large-scale remote administration.
Found this helpful? Share the knowledge...
... or support this project to keep it alive!
Previous
Sessions and Session Configuration
Next
Managing Windows Systems
-
The Security Model Behind WinRM
-
Authentication Methods
- Kerberos (Default in Domain Environments)
- NTLM (Fallback When Kerberos Is Unavailable)
- CredSSP (For Multi-Hop Authentication)
- Basic Authentication (Only Over HTTPS)
-
Encryption of Remote Sessions
- Encryption Details by Authentication Method
-
Using HTTPS for Enhanced Security
- NTLM-Based Server Identity
-
Authorization and Access Control
- Local Group Membership
- Session Configuration Permissions
-
The Role of Session Configurations in Security
- Securing Restricted Sessions
-
The Double-Hop Problem
- Solutions to the Double-Hop Problem
- CredSSP Considerations
- Resource-Based Kerberos Constrained Delegation
-
Logging and Auditing
- Important Event Logs
-
Firewall and Network Considerations
- Firewall Rules by Network Type
-
Summary
