Enable and Test PowerShell Remoting on a Windows HostIssue Windows discovery uses PowerShell remoting to automatically run scripts on target devices. The following steps verify that PowerShell remoting is enabled and working on each machine. If it is not working, you may see a common error such as: Failed to launch process powershell -ExecutionPolicy ByPass -NonInteractive -WindowStyle Hidden -commandReleaseMadrid 3 and newer versionsResolutionEnable PowerShell remoting To make a remote connection on your server, do the following: Open PowerShell, and select Run as administrator. In the PowerShell window, type the cmdlet, Enable-PSRemoting -Force.Select Enter. This command starts the WinRM service, sets it to start automatically with your system, and creates a firewall rule that allows incoming connections. The -Force part of the cmdlet tells PowerShell to perform these actions without prompting you for each step. Add a remote-connected host to <trust zone> Open PowerShell and select Run as administrator.In the PowerShell window, type Set-Item wsman:\localhost\client\trustedhosts * The asterisk is a wildcard symbol for all hosts. To restrict servers that can connect, replace the asterisk with a comma-separated list of IP addresses or hostnames. Restart the WinRM service In the PowerShell window, type the cmdlet, Restart-Service WinRMSelect Enter. Test the connection From the MID Server, run the following cmdlet into PowerShell: Test-WsMan <Target IP> Select Enter. This command tests whether the WinRM service is running on the remote host. If it completes successfully, information about the remote host WinRM service displays, indicating that WinRM is enabled and your <Target Host> can communicate.If the command fails, an error message displays instead. Run a single remote command on the remote system Use the Invoke-Command cmdlet as follows: Invoke-Command -ComputerName COMPUTER -ScriptBlock { COMMAND } -credential USERNAME. Example The following command displays the contents of the C:\ directory on a remote host with the IP address and a username: Invoke-Command -ComputerName <TargetIP> -ScriptBlock { Get-ChildItem C:\ } -credential domain\username To run several cmdlets on the remote host Instead of repeating the Invoke-Command cmdlet and the remote IP address, start a remote session instead. To do this: Type the cmdlet: Enter-PSSession -ComputerName <Target IP> -Credential Domain\USERSelect Enter. Related LinksPowerShell remoting for Discovery MID Server PowerShell files