All posts filed under: Remoting


Test-WSManCredSSP: Check if a remote computer has WSMan CredSSP enabled

Update: This script won’t work against Windows 2003 or Windows XP systems. There is no CredSSP support on this and hence the WSMan:\<ComputerName>\Client\Auth\CredSSP or WSMan:\<computerName>\Service\Auth\CredSSP won’t resolve. You can use -ErrorAction SilentlyContinue along with Get-Item cmdlet when reading these values, if you don’t want to see an error. Thanks to @dfinke for reporting this. I’ve published a free book on PowerShell 2.0 remoting. You can download it at: When using PowerShell remoting, WSMan CredSSP is a requirement if there are multiple hops involved in the remoting scenario. When using remoting in an automation scenario, it becomes very important to know if the remote computer has CredSSP enabled or not. PowerShell v2 provides a cmdlet — Get-WSManCredSSP that tells you if CredSSP client or server  roles are enabled on the local computer. Make a note, I said “local computer”. This cmdlet, unfortunately, does not have a -ComputerName parameter. You may get a question, why not use Invoke-Command and run this cmdlet on the remote machine? Yes, we can do that. But, only if the remote computer …

Prerequisite Deployment

Remote install of SharePoint 2010 prerequisites

I’ve published a free book on PowerShell 2.0 remoting. You can download it at: Did you ever try installing SharePoint 2010 prerequisites remotely? If so, you would know by now that it is not easy. Essentially because of the Windows update packages in the prerequisites. It is a known issue that Wusa.exe cannot be invoked in a remote session. If you try to install SharePoint 2010 prerequisites remotely — either using PowerShell remoting or WMI — it fails with an error code 5. We cannot really claim to have a fully unattended SharePoint deployment process until we have a solution to the prerequisite install process. So, with that background, I started working on the script for remotely installing SharePoint 2010 prerequisites. In today’s post, I will show you how to do that. To achieve this, I used a combination of PsExec.exe and PowerShell remoting. Here are the prerequisites for this script to work. PowerShell remoting must be enabled the remote system where you are deploying SharePoint prerequisites. On the remote system, CredSSP must be enabled …

Feature Install

PowerShell to list / add / remove Windows roles & features remotely

Lot of my R & D work at home happens on a couple of physical systems and lot of virtual machines hosted on Hyper-V. One thing that I regularly do is to rebuild lot of these machines and in that process, I add/remove Windows OS features many times. One default setting I have on all my systems is PowerShell remoting. This helps me access any system from a central location to add / remove these Windows features. I have been using PowerShell remoting combined with Server Manager cmdlets in Windows Server 2008 R2. But, every time I want to enable/disable a feature, there is lot of typing. So, I ended up writing my own wrapper for doing this remotely using three functions or cmdlets — whatever you call it. These functions have been tested on Windows Server 2008 R2 and ServerCore R2 OS. ServerCore is a bit tricky though. We don’t have PowerShell enabled by default. So, we have to manually enable Windows PowerShell feature using OCSetup. Only then, we can use this script for …

PowerShell remoting

eBook Update: Layman’s guide to PowerShell 2.0 remoting

After lot of procrastination, I finally completed updates to my PowerShell remoting eBook. First of all, many thanks to Jan Egil Ring (@JanEgilRing) for contributing Appendix B: Remoting in an enterprise. This is a great addition to the content of this eBook. These are the changes that went in to this update. Chapter 2 Enable remoting for only a specific network adapter Remoting in an Enterprise Chapter 3 Run script files on remote computers Chapter 9 Added a note on Domain controller credential delegation Updated a note on Windows XP/2003 support for CredSSP Appendix A Added some more FAQ Appendix B Remoting in an Enterprise by Jan Egil Ring I’ve replaced the old download link with the updates and here is the download link. You can download the older version of this eBook here. Looking forward to your feedback, as always.

Executing script existing only on a remote system using Invoke-Command

This is more of a personal note and may sound trivial to many of you out there. But just wanted to make sure I share it here. A while back, in my remoting series, I wrote about executing commands / scripts on a remote machine using Invoke-Command cmdlet. Talking specifically about scripts, you can use -FilePath parameter to execute scripts on a remote machine.

Note that the script you provide as a value to -FilePath must exist on the local machine or at a place accessible to the local machine. So, what if you want to run a script that exists only on the remote server? You can use script block for that. Invoke-Command -ComputerName SP2010-WFE -scriptBlock { C:\scripts\Test.PS1 } This way, you can execute the script present on a remote machine but not on the local system. I’ve published a free book on PowerShell 2.0 remoting. You can download it at:

eBook: Layman’s guide to PowerShell 2.0 remoting

If are you a regular visitor to this blog, you may be aware of my PowerShell remoting series of blog articles. Traffic to this blog increased by almost 80% ever since I started the remoting series. This set of articles appear on the first page of Internet search almost all the time. The idea behind starting the remoting series was to develop the content in to an eBook at the end. I have been sitting on it for while and just got a chance to complete it after a few late night efforts.This eBook has more content than the remoting blog posts. This kinda concludes the remoting series. There are a few things I have not discussed including fan-in remoting. I will add those things as separate chapters, if required. You can download the eBook here This eBook got an update from the initial release. Here are the additions in the update. Chapter 2 Enable remoting for only a specific network adapter Remoting in an Enterprise Chapter 3 Run script files on remote computers Chapter 9 …

Enabling PowerShell remoting for only a specified set of IP addresses

I’ve published a free book on PowerShell 2.0 remoting. You can download it at: I wasn’t so sure about the post title. But read on to understand what I really meant. 🙂 When you enable remoting on a computer using Enable-PSRemoting cmdlet, an http listener will be created to listen for remoting requests on all IP addresses on the local computer. This may not be a great security practice in an enterprise. For example, you have an Internet facing server with two network connections. One – obviously – is the Internet connection and a second one connecting to your internal network. You don’t need remoting be enabled on the network adapter connected Internet. But, since you used Enable-PSRemoting cmdlet, remoting will be enabled and there is a WinRM listener on the Internet facing network too. So, how do we disable remoting on the Internet facing adapter? Enable-PSRemoting is a comprehensive cmdlet that does lot of things for you in one shot. This is also the recommended way to enable remoting. So, if we need to …

Remote File Explorer

Remote file explorer using PowerShell remoting and Windows forms

Last week, I released the remote file explorer powerpack for PowerGUI. The concept of this powerpack is quite simple. We use PowerShell remoting to access the PS drives of a remote machine and then use the same remoting channel to transfer files between computers. I’ve published a free book on PowerShell 2.0 remoting. You can download it at: So, here is the first release of this forms based script. I have put this on CodePlex for better visibility and availability. This will also let me use the version control features of CodePlex. I am no expert in developing GUI applications and there will be some inefficient code. Do let me know when you find some thing like. I will fix it as soon as possible. The project is available at and the latest release is Here is how the initial release looks As shown in the above screenshot, I have used TreeView control for the computer listing and then a DataGrid for listing the files. Requirements 1. PowerShell 2.0 2. pModem 0.5 or …