Powershell to enable PSremoting and execution policy

Now a day PS remoting   has more importance since we can not go to each and every server to execute powershell commands and get the results. Powershell have lot of remoting options like most of the command have -computername parameter which we can use to specify remote target server or we can use invoke-command. nbut before you execute powershell script remotely you should have PSremoting enable on target server.

 executing below powershell script allow you to do PS remoting

# Configures the server for WinRM 
Write-Host “Configuring PowerShell remoting…” 
$winRM = Get-Service -Name winrm 
If ($winRM.Status -ne “Running”) 
{Start-Service -Name winrm} 
Set-ExecutionPolicy Bypass -Force 
Enable-PSRemoting -Force 

(Visited 3 times, 1 visits today)

By Arun Sabale

Arun is a Solution Architect on enterprise client management with more than 14 years of experience in IT. Arun Sabale is Blogger and tech enthusiast. His main focus is on Azure cloud infra, Cloud automation with powershell, python, ARM terraform and all cloud infra services like compute, storage, network, automation, function api etc... LinkedIN - https://www.linkedin.com/in/arun-sabale/