# PSRemoting in Workgroup (Standalone) Servers

**URL:** <https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210>\
**Category:** PowerShell Help\
**Created:** [March 18, 2019, 2:30pm UTC](https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210 "2019-03-18T14:30:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pathade90](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pathade90/32/187_2.png) [@pathade90](https://forums.powershell.org/u/pathade90)\
**Post date:** [March 18, 2019, 2:30pm UTC](https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210/1 "2019-03-18T14:30:02Z")

</div>

I would like to run the PS Script on multiple Workgroup Machines where PSRemoting is enabled and All required Firewall Ports are opened. If I do Enter-PSSession Localhost it works fine. Problem is during remote execution.

[pre]

$Servers = Get-Content ‘C:\PSRemoting\VMList.txt’  
$Scriptpath = ‘C:\PSRemoting\Temp.ps1’  
$logfile =‘C:\PSRemoting\log.txt’  
$Username = ‘support’  
$Password = ‘MYPassword’  
$Halt = ‘2’ #This value defines the pause between to execution in secs  
$pass = ConvertTo-SecureString -AsPlainText $Password -Force  
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass  
foreach($s in $Servers)  
{  
$Credtest = gwmi win32\_computersystem -computer $s -credential $cred  
If($Credtest -eq $null)  
{  
Write-Output “$(Get-Date -Format g) : PasswordFailure : $S : Password is not working” | Out-File -FilePath $logfile -Append -Force  
} else {

try {  
Write-Output “Proccessing $S”  
Start-Sleep -s $Halt  
Invoke-Command -ComputerName $s -FilePath $Scriptpath -Credential $Cred -ErrorAction Stop -ErrorVariable Err  
}  
catch {  
Write-Output “$(Get-Date -Format g) : ExecutionFailure : $S : Exection Failed with Error: $ERR” | Out-File -FilePath $logfile -Append -Force  
}

}  
}

[/pre]

In above script $Credtest is success but Invoke is failing with below error:

3/18/2019 11:36 AM : ExecutionFailure : VMNAME: Exection Failed with Error: System.Management.Automation.ActionPreferenceStopException: The running command stopped because the preference variable “ErrorActionPreference” or common parameter is set to Stop: [VMNAME] Connecting to remote server VMNAME failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 occurred while using Kerberos authentication: There are currently no logon servers available to service the logon request.  
Possible causes are:  
-The user name or password specified are invalid.  
-Kerberos is used when no authentication method and no user name are specified.  
-Kerberos accepts domain user names, but not local user names.  
-The Service Principal Name (SPN) for the remote computer name and port does not exist.  
-The client and remote computers are in different domains and there is no trust between the two domains.  
After checking for the above issues, try the following:  
-Check the Event Viewer for events related to authentication.  
-Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.  
Note that computers in the TrustedHosts list might not be authenticated.  
-For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about\_Remote\_Troubleshooting Help topic.  
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)  
at lambda\_method(Closure , Object , StrongBox`1 , InterpretedFrame )

&nbsp;

Any assistance on above error is much appreciated or any better way to do PSRemoting on Workgroup VM’s.

---

<div class="post-metadata">

**Author:** ![postanote](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@postanote](https://forums.powershell.org/u/postanote)\
**Post date:** [March 18, 2019, 9:25pm UTC](https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210/2 "2019-03-18T21:25:13Z")

</div>

You have to setup the environment for this and it is well documented in many places over the years…

> Enable PowerShell Remoting on a standalone (workgroup) computer https://4sysops.com/archives/enable-powershell-remoting-on-a-standalone-workgroup-computer
> 
> PowerShell remoting between two workgroup machines
> 
> > **[PowerShell remoting between two workgroup machines](https://learn.microsoft.com/en-us/archive/blogs/wmi/powershell-remoting-between-two-workgroup-machines)**
> 
> POWERSHELL PS REMOTING BETWEEN STANDALONE WORKGROUP COMPUTERS
> 
> > **[POWERSHELL PS REMOTING BETWEEN STANDALONE WORKGROUP COMPUTERS](http://vcloud-lab.com/entries/active-directory/powershell-ps-remoting-between-standalone-workgroup-computers)**
> >
> > This article is about how to setup powershell remoting between computers in non domain (workgroup) environment.
> 
> PowerShell remoting between two workgroup machines  
> [https://posh2scripting.wordpress.com/2013/06/07/powershell-remoting-between-two-workgroup-machines](https://posh2scripting.wordpress.com/2013/06/07/powershell-remoting-between-two-workgroup-machines)
> 
> Enabling remote Powershell on workgroup computers
> 
> > **[Enabling remote Powershell on workgroup computers](https://infrahouse.wordpress.com/2015/10/21/enabling-remote-powershell-on-workgroup-computers/)**
> >
> > Using remote Powershell on workgroup computers is disabled by default. This is how to enable it at the host and the client. Host At the host that we want to reach with Powershell, we need to enable…
> 
> How to setup WinRM in a WorkGroup Non Domain Environment  
> [https://www.paulligocki.com/how-to-setup-winrm-in-a-workgroup-non-domain-environment](https://www.paulligocki.com/how-to-setup-winrm-in-a-workgroup-non-domain-environment)

**See also:**

 

_> Understanding and troubleshooting WinRM connection and authentication: a thrill seeker's guide to adventure http://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure
> 
> WinRM (Windows Remote Management) Troubleshooting Tips  
> [https://support.iportalis.com/en-us/article/1-winrm-windows-remote-management-troubleshooting-tips](https://support.iportalis.com/en-us/article/1-winrm-windows-remote-management-troubleshooting-tips)
> 
> Troubleshoot WinRM with PowerShell—Part 1
> 
> > **[Troubleshoot WinRM with PowerShell—Part 1 - Scripting Blog \[archived\]](https://devblogs.microsoft.com/scripting/troubleshoot-winrm-with-powershellpart-1/)**
> >
> > Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to look at WinRM logs.  Hey, Scripting Guy! I am having problems with WinRM. When I use the Get-CimInstance cmdlet, it fails. When I specify the –DCOM protocol for...
> 
> > **[Troubleshooting WinRM with PowerShell—Part 2 - Scripting Blog \[archived\]](https://devblogs.microsoft.com/scripting/troubleshooting-winrm-with-powershellpart-2/)**
> >
> > Summary: Ed Wilson, Microsoft Scripting Guy, talks about troubleshooting WinRM.  Hey, Scripting Guy! So I thought that Windows PowerShell remoting was supposed to just work. Well, it doesn't. I am confused, and don’t even know where to begin. I...
> 
> Learn How to Easily Troubleshoot PowerShell Remoting
> 
> > **[Learn How to Easily Troubleshoot PowerShell Remoting - Scripting Blog \[archived\]](https://devblogs.microsoft.com/scripting/learn-how-to-easily-troubleshoot-powershell-remoting/)**
> >
> > Summary: Microsoft Scripting Guy, Ed Wilson, shows you how to easily troubleshoot Windows PowerShell remoting.  Hey, Scripting Guy! I have a problem. I am running Windows 8 on my desktop, and I have upgraded our Hyper-V servers to Windows...
> 
> About Remote Troubleshooting
> 
> > **[about Remote Troubleshooting - PowerShell](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote_troubleshooting?view=powershell-7.4&viewFallbackFrom=powershell-6)**
> >
> > Describes how to troubleshoot remote operations in PowerShell._

---

<div class="post-metadata">

**Author:** ![pathade90](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pathade90/32/187_2.png) [@pathade90](https://forums.powershell.org/u/pathade90)\
**Post date:** [March 19, 2019, 7:14am UTC](https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210/3 "2019-03-19T07:14:41Z")

</div>

[@postanote](https://powershell.org/profile/postanote/)

Thanks for help.

While going through the articles found that issue with source VM trusted host config. After adding \* in Trustedhost in Source VM it started working fine.

Once again thanks for guidance.

---

<div class="post-metadata">

**Author:** ![postanote](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@postanote](https://forums.powershell.org/u/postanote)\
**Post date:** [March 19, 2019, 1:14pm UTC](https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210/4 "2019-03-19T13:14:03Z")

</div>

No worries. Glad they helped.

If this is you now self controlled environment, then doing this ‘adding \* in Trustedhost’ is fine, but not something you’d want to do in an enterprise. For risk manager reasons, ‘adding \* in Trustedhost’, is not recommended, specifically list the hosts you want to trust.

---

<div class="post-metadata">

**Author:** ![jjj](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jjj](https://forums.powershell.org/u/jjj)\
**Post date:** [March 19, 2019, 4:06pm UTC](https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210/5 "2019-03-19T16:06:33Z")

</div>

Holy Cow! I was just getting ready to post a question about this exact topic and this was the top of the heap.

Thanks, I’ll be testing this solution in a couple hrs.

Here was the gist of my problem.

New to Powershell and IT generally

Attempting to collect info from WMI (CIM) classes on a remote computer

Has the same Network (10.0.0.x)

The request is being made from a Win 10 machine

The request is made of a 2016 Win Server EVAL machine

Access is denied unless -Credentials "Administrator" is used

Other users of the Administrator group are denied.

Both machines are visible and accessible via Windows Explorer

Both machines are have been made Trusted Hosts of each other via WinRM

My prefrence is to not to supply credentials for the moment since I'm

just setting up a lab environment

Thanks again

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:33pm UTC](https://forums.powershell.org/t/psremoting-in-workgroup-standalone-servers/12210/6 "2024-05-16T20:33:09Z")

</div>


