Last active
June 22, 2021 06:29
-
-
Save andrewiankidd/f47e8bc7d6a2cc68711e8d3e01850b8a to your computer and use it in GitHub Desktop.
Revisions
-
andrewiankidd revised this gist
Jan 9, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ winrm quickconfig -q Write-Host "------Genning Thumbprint" #get thumbprint $thumbprint = (New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname $fqdn -NotAfter (Get-Date).AddMonths(36)).Thumbprint Write-Host "------Proceeding with following details" #create cert -
andrewiankidd revised this gist
Aug 15, 2017 . No changes.There are no files selected for viewing
-
andrewiankidd created this gist
Aug 14, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ param ($fqdn) if ($fqdn -eq $null){ #lots of assuming going on here $zone = ".westeurope.cloudapp.azure.com" $fqdn = "$env:computername$zone" } ##enable winrm Write-Host "------Enabling WinRM (HTTP)" winrm quickconfig -q Write-Host "------Genning Thumbprint" #get thumbprint $thumbprint = (New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname $fqdn).Thumbprint Write-Host "------Proceeding with following details" #create cert Write-Host fqdn: $fqdn, thumbprint: $thumbprint $cmd = 'winrm create winrm/config/listener?Address=*+Transport=HTTPS `@`{Hostname=`"$fqdn`"`; CertificateThumbprint=`"$thumbprint`"`}' Write-Host "------Enabling WinRM (HTTPS)" Invoke-Expression $cmd Write-Host "------Making Firewall rule" #poke hole in firewall & netsh advfirewall firewall add rule name="winRM HTTPS" dir=in action=allow protocol=TCP localport=5986 Write-Host "------Testing WinRM" & test-wsman $fqdn