Stay Tuned!

Subscribe to our newsletter to get our newest articles instantly!

Apps

How to Access a Remote Machine via PowerShell

Challenge

The remote machine is running under Workgroup, not as a Domain. The software updates such as Adobe Acrobat needs to be updated manually due to the current standard user credential won’t let the system install it (UAC) and it required an Administrator account to log in and run. The administrator has to log on to every machine manually and run the updates. The updates sometimes ran every week.

Solution

On the Remote machine

Start Windows PowerShell as an Administrator by right-clicking the Windows PowerShell shortcut and selecting Run as Administrator

At the PowerShell prompt, verify the WinRM is running by using the following command:

get-service winrm

The value of the Status property in the output should be Running.




To configure Windows PowerShell for remoting, type the following command:

Enable-PSRemoting -force

If the remote computer is not in a trusted domain, the remote computer might not be able to authenticate the credentials. Enable authentication, which requires adding the remote computer to the list of trusted hosts for the local machine in WinRM. To do so, type:

winrm set winrm/config/client ‘@{TrustedHosts=”LocalComputer”}’

On the local machine

Start Windows PowerShell as an Administrator by right-clicking the Windows PowerShell shortcut and selecting Run as Administrator




Run the following command:

winrm set winrm/config/client ‘@{TrustedHosts=”RemoteComputer”}’

or

winrm set winrm/config/client ‘@{TrustedHosts=”*”}’

Exit from this application.




Run Windows PowerShell ISE as Administrator

Create Untitled.ps1 document and save it under: C:\Users\Username\Documents

$Credentials = Get-Credential
Enter-PSSession -ComputerName RemoteComputer -Credential $Credentials

Run hostname to verify local machine

Run the Untitled.ps1 command with authentication window




Run hostname to verify that on remote machine

Environment

  • Remote machine: Ms Windows 7 Professional
  • Local machine: Ms Windows 7 Professional
  • Network: Workgroup NOT domain

Credits

Photo by Anete Lusina: https://www.pexels.com/photo/male-remote-worker-inserting-usb-stick-into-port-4792741/

[Note: Pageviews – 2,217 – before migrated from Dewalist Blog website on 09/08/2020]

Valdy

About Author

Valdy founded Dewacorp.com, a helpdesk and IT Services provider that has taken care of nearly 40,000 customer service requests in the past 15 years - nearly 2,600 per year. He also created the growing Dewalist.com - a classified website that has close to 110,000 page views and 9,000+ user visits per month with 61,000+ yearly published ads and 47,000 active registered users. He blogs for the ever-growing Dewapost.com, a tech blog that gets around 20,000 impressions per month with 700 clicks and 10 average pages first impressions on Google Search. You can reach him on the Contact Us page, social media links below or Dewachat.com.

You may also like

Apps

Automate Repetitive Tasks on Your Computer

[This blog is migrated from our classifieds website on 18 July 2020. Previously, it has 3,759 views.] Pre-Solution There are
Apps

Why does Joomla! 1.5 use UTF-8 encoding?

Well… how about never needing to mess with encoding settings again? Ever needed to display several languages on one page