add refresh_api to jenkinsfile
This commit is contained in:
1
inventory/WinRM/CosmosRM.bat
Normal file
1
inventory/WinRM/CosmosRM.bat
Normal file
@ -0,0 +1 @@
|
||||
powershell -executionpolicy bypass -Command \\home.cosmos\netlogon\cosmosrm.ps1
|
||||
17
inventory/WinRM/cosmosrm.ps1
Normal file
17
inventory/WinRM/cosmosrm.ps1
Normal file
@ -0,0 +1,17 @@
|
||||
# script for setting ansible service account to registry key
|
||||
$username = "cosmos-ansible"
|
||||
$ansible_registry = "HKLM:\SOFTWARE\Cosmos\Ansible"
|
||||
$password_key = "Password"
|
||||
$password = (Get-ItemProperty $ansible_registry).$password_key
|
||||
# This is what the thing needs to set the password
|
||||
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
|
||||
# Set password
|
||||
$UserAccount = Get-LocalUser -Name $username
|
||||
$UserAccount | Set-LocalUser -Password $securePassword
|
||||
|
||||
# Make it a local admin
|
||||
Add-LocalGroupMember -Group "Administrators" -Member $username
|
||||
|
||||
# Various Ansible Settings
|
||||
Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $true
|
||||
Enable-WSManCredSSP -Role Server -Force
|
||||
Reference in New Issue
Block a user