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
How Long For Me
SaveMySerials

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

Current file path in custom PowerShell Cmdlet
Recursively removing SVN bindings with PowerShell
Determine Forest and Domain Functional Levels in Powershell
Programatically Retrieving an Assembly's PublicKeyToken through a PowerShell CmdLet
Uninstalling PowerShell V1.0 from Windows Server 2003

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. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers