Created
June 14, 2018 20:07
-
-
Save AspenForester/1e0af7a1708a2af0f94a2d40a2396a9b to your computer and use it in GitHub Desktop.
Leverages PSexec to execute winrm quickconfig on machines that don't have WSMan enabled for remoting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Enable-WSManRemote | |
{ | |
[cmdletbinding()] | |
Param( | |
[Parameter(Position = 0, | |
ValueFromPipeline = $True, | |
ValueFromPipelineByPropertyName = $True)] | |
[ValidateNotNullorEmpty()] | |
[string[]] | |
$Computername | |
) | |
process | |
{ | |
& 'C:\Program Files\SysInternals\PsExec.exe' "\\$Computername" -s winrm.cmd quickconfig -q | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment