Open PowerShell with administrator right to enable WinRM. Then type the following command, and press “Y” two times.
winrm quickconfig
![](https://tungle.ca/wp-content/uploads/2022/02/image-258.png)
If your network connection type is Public, you will get an error below.
![](https://tungle.ca/wp-content/uploads/2022/03/image-9.png)
Go to Windows Firewall, and select “Public” on the Profiles setting to allow to connect via Public network.
![](https://tungle.ca/wp-content/uploads/2022/03/image-10-1024x666.png)
Test the WinRM configuration by running the following command.
winrm identify -r:http://localhost:5985 -auth:none
If the test is successful as in the screenshot below, your device is able to be managed via WMI.
![](https://tungle.ca/wp-content/uploads/2022/02/image-259.png)
Check WinRM port is running.
![](https://tungle.ca/wp-content/uploads/2022/02/image-260-1024x595.png)
Remotely check WinRM port has listened on Windows machine.
Test-NetConnection WIN102022-01 -port 5985
![](https://tungle.ca/wp-content/uploads/2022/02/image-261.png)
Enter WMI or WinRM credential for workgroup machine or Windows server.
PS C:\Windows\system32> $wmiuser, $wmisecret = (read-host 'Enter the WMIuser'), (Read-Host 'Enter the WMIsecret' -AsSecureString)
![](https://tungle.ca/wp-content/uploads/2022/02/image-263-1024x60.png)
A newadmin user is member of local Administrators on Windows workgroup machine or Windows server.
![](https://tungle.ca/wp-content/uploads/2022/02/image-270.png)
Create wmi_cred_new variable for WMI or WinRM credential.
$wmi_cred_new = New-Object System.Management.Automation.PSCredential($wmiuser, $wmisecret)
![](https://tungle.ca/wp-content/uploads/2022/02/image-264-1024x20.png)
Check hostname and ipconfig on a remote host via WinRM.
Invoke-Command -ComputerName WIN102022-01 -Credential $wmi_cred_new -ScriptBlock {hostname; ipconfig}
![](https://tungle.ca/wp-content/uploads/2022/02/image-269-1024x120.png)
Check current OS Windows Patch.
Invoke-Command -ComputerName WIN102022-01 -FilePath C:\Shared\Get-CurrentPatchInfo.ps1 -Credential $wmi_cred_new
![](https://tungle.ca/wp-content/uploads/2022/02/image-266-1024x278.png)
Get Lastreboot and uptime on Windows 10 workgroup machine.
Invoke-Command -ComputerName WIN102022-01 -Credential $wmi_cred_new -ScriptBlock {$OS1 = Get-WmiObject Win32_operatingsystem -Computer WIN102022-01 ; $LastReboot =($OS1.ConvertToDateTime($OS1.LastBootUpTime)) ; $LastReboot ; $Uptime = (Get-Date) -$OS1.ConvertToDateTime($OS1.LastBootUpTime) ; $Uptime = ([String]$Uptime.Days + " Days " + $Uptime.Hours + " Hours " + $Uptime.Minutes + " Minutes") ; $uptime}
![](https://tungle.ca/wp-content/uploads/2022/02/image-268-1024x155.png)