Lately, I had to execute Powershell very simple script on a large list of Windows systems, but lot of them weren’t ready for it, so I ended up having to do some hacking, and previously checking if the system was ready to accept external commands.

The most tricky thing was to check for availability of WinRM remotely, then being able to enable when necessary prior executing Invoke-Command from Powershell.

To check WinRM remotely:

After including this sentence, and because was not possible using Powershell to enable WinRM, we had to use psexec this way:

Then, after WinRM enabled, I had to unzip certain file over Powershell 2.0, not an easy task, but finally, I found out this very nice solution:

Goal achieved, WinRM full operative and file unzipped in the end!


Leave a Reply