Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Enable-PSRemoting
- winrm set winrm/config/client/auth '@{Basic="true"}'
- winrm set winrm/config/service/auth '@{Basic="true"}'
- winrm set winrm/config/service '@{AllowUnencrypted="true"}'
- dir WSMAN:\localhost\Shell
- Set-Item WSMan:\localhost\Shell\AllowRemoteShellAccess $True
- Set-Item -Force WSMan:\localhost\Client\TrustedHosts *
- $networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
- $connections = $networkListManager.GetNetworkConnections()
- # Set network location to Private for all networks
- $connections | % {$_.GetNetwork().SetCategory(1)}
- net user ansibleuser /delete
- net user ansibleuser ansible /add
- net localgroup administrators ansibleuser /add
- $password = ConvertTo-SecureString ansible -AsPlainText –Force
- $adminuser = New-Object System.Management.Automation.PSCredential ansibleuser,$password
- $IssuerThumbprint="86540FFE64B5840300996BDF481FE71C3D3956CC"
- New-Item -Path WSMan:\localhost\ClientCertificate -URI * -Subject ansibleuser@localhost -Issuer $IssuerThumbprint -Credential $adminuser -force
- #Check if mapping is enabled by default
- #dir WSMan:\localhost\ClientCertificate\ClientCertificate_469738437
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement