๐Ÿ“— Ansible playbooks and roles for building an idempotent, interconnected and scalable infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-playbooks/roles/smb/templates/scripts/psr-reset-ps1.j2

5 lines
369 B

2 years ago
#Requires -RunAsAdministrator
gci wsman:\localhost\listener | ? {$_.Keys -contains "Transport=HTTPS" -and $_.Keys -contains "Address=*"} | % {$_ | Remove-Item -Force -Recurse }
Get-LocalUser {{ winrm_remote_user }} | Set-LocalUser -Password (ConvertTo-SecureString '{{ winrm_bootstrap_password }}' -AsPlainText -Force)
Remove-NetFirewallRule -Name "WINRM-HTTPS-In-TCP"