Skip to content

Instantly share code, notes, and snippets.

@AspenForester
Created June 14, 2018 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AspenForester/1e0af7a1708a2af0f94a2d40a2396a9b to your computer and use it in GitHub Desktop.
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
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