NerdyHearn
Home
Blog

Contact
Mailing List

Software

Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail

Sites
DocuTerminal
How Long For Me
My Music To Me
SaveMySerials
TypeCount

Blog
Twitter

NerdyHearn - Blog


<< Back To All Blogs

Using Remote Powershell

Saturday, November 8th, 2014

Powershell provides a number of great features, one of which is remote powershell connections. This is a particularly interesting feature for a Linux/Windows conversion for those used to using SSH to connect directly to a remote server without remoting into a desktop environment.

Enabling and using remote powershell connections requires configuration on both the client machine and the remote machine.

For this example we'll use 192.168.1.100 as the client, and 192.168.1.200 as the server.

On the server machine, open a powershell prompt (with run as administrator) and enter the following command:

Enable-PSRemoting –Force
Set-Item wsman:localhostclienttrustedhosts 192.168.1.100

This will enable Powershell remoting and will allow connections from the client 192.168.1.100. You could also use a * for all hosts, subnet ranges, or hostnames instead of a direct IP address.

On the client machine:
Enable-PSRemoting –Force
Set-Item wsman:localhostclienttrustedhosts 192.168.1.200

This will enable remote powershell on the client machine and add the remote machine as a trusted host.

To connect to the remote host from the local client:

#Give the user a remote credential prompt
$cred = get-credential

Enter-PSSession –ComputerName 192.168.1.200 –Credential $cred

Remote Powershellin' Tom Out.

Tags

PowerShell

Related Blogs

Uninstalling PowerShell V1.0 from Windows Server 2003
Determine Forest and Domain Functional Levels in Powershell
Current file path in custom PowerShell Cmdlet
Some Useful Powershell commands for the Linux nerds out there
Customizing PowerShell for faster development with a default profile

Comments

Currently no comments.

Add A Comment

Name:


URL:


Email Address: (not public, used to send notifications on further comments)


Comments:



Enter the text above, except for the 1st and last character:


NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations