Advertisement
Guest User

Untitled

a guest
Nov 30th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. Enable-PSRemoting
  2.  
  3. winrm set winrm/config/client/auth '@{Basic="true"}'
  4. winrm set winrm/config/service/auth '@{Basic="true"}'
  5. winrm set winrm/config/service '@{AllowUnencrypted="true"}'
  6.  
  7. dir WSMAN:\localhost\Shell
  8.  
  9. Set-Item WSMan:\localhost\Shell\AllowRemoteShellAccess $True
  10. Set-Item -Force WSMan:\localhost\Client\TrustedHosts *
  11.  
  12. $networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
  13. $connections = $networkListManager.GetNetworkConnections()
  14.  
  15. # Set network location to Private for all networks
  16. $connections | % {$_.GetNetwork().SetCategory(1)}
  17.  
  18. net user ansibleuser /delete
  19.  
  20. net user ansibleuser ansible /add
  21.  
  22. net localgroup administrators ansibleuser /add
  23.  
  24. $password = ConvertTo-SecureString ansible -AsPlainText –Force
  25.  
  26. $adminuser = New-Object System.Management.Automation.PSCredential ansibleuser,$password
  27.  
  28. $IssuerThumbprint="86540FFE64B5840300996BDF481FE71C3D3956CC"
  29. New-Item -Path WSMan:\localhost\ClientCertificate -URI * -Subject ansibleuser@localhost -Issuer $IssuerThumbprint -Credential $adminuser -force
  30.  
  31. #Check if mapping is enabled by default
  32. #dir WSMan:\localhost\ClientCertificate\ClientCertificate_469738437
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement