Test if a computer is setup to receive remote commands via the WinRM service.
Syntax
Test-WSMan [[-ComputerName] string] [-Authentication Authentication]
[-Credential PSCredential] [CommonParameters]
Key
-Authentication Authentication
The authentication mechanism to be used at the server. Possible values are:
Basic Send username and password in clear text.
Default Use the authentication method implemented by WS-Management protocol. This is the default.
Digest Challenge-response scheme using a server-specified data string for the challenge.
Kerberos Authenticate by using Kerberos certificates.
Negotiate Challenge-response that negotiates an authentication scheme.
e.g. Kerberos protocol or NTLM.
CredSSP Use Credential Security Service Provider (CredSSP) authentication, delegate
credentials to a remote computer. This increases the security risk, if the remote
computer is compromised, the credentials could be used to control the network session.
-ComputerName string
The computer against which you want to run the management operation.
A fully qualified domain name, NetBIOS name, or an IP address.
Use the local computer name, localhost, or a dot (.) to specify the local computer.
The local computer is the default. When the remote computer is in a different domain,
use a fully qualified domain name. You can pipe a value for ComputerName.
-Credential PSCredential
A user account that has permission to perform this action. default=current user.
e.g. "User01", "Domain01\User01", or "User@Domain.com". Or a PSCredential object, such as
returned by the Get-Credential cmdlet. When you type a user name, you will be prompted for a password.
CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
-OutBuffer -OutVariable.
If the tested computer is running the WinRM service, Test-WSMan will display the WS-Management identity schema, the protocol version, the product vendor, and the product version of the tested service.
Examples
Determine whether the WinRM service is running on the local computer:
PS C:> test-wsman
Determine whether the WinRM service is running on server64 :
PS C:> test-wsman -computername server64
Test to see if the WS-Management (WinRM) service is running on the local computer using the authentication parameter, this allows Test-WSMan to return the Operating System version:
PS C:> test-wsman -authentication default
“The real test of friendship is: can you literally do nothing with the other person? Can you enjoy those moments of life that are utterly simple?” ~ Eugene Kennedy
Related PowerShell Cmdlets:
Connect-WSMan - Connect to the WinRM service on a remote computer.
Invoke-Command - Run commands on local and remote computers.
Get-WSManCredSSP - Get the Credential Security Service Provider configuration.