Last active
April 18, 2020 07:48
-
-
Save cakriwut/695d4a6e1464a225cd196c9454575688 to your computer and use it in GitHub Desktop.
This file contains 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 characters
# Requires $env:AdminUser $env:AdminPassword | |
Set-ExecutionPolicy Bypass -Scope Process -Force | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
Enable-WSManCredSSP -Role Server -Force | |
Enable-WSManCredSSP -Role Client -DelegateComputer * -Force | |
New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -Name AllowFreshCredentialsWhenNTLMOnly -Force | |
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\AllowFreshCredentialsWhenNTLMOnly -Name 1 -Value * -PropertyType String | |
$user = "$($env:computername)\$($env:AdminUser)" | |
$securePassword = ConvertTo-SecureString $env:AdminPassword -AsPlainText -Force | |
$credential = New-Object System.Management.Automation.PSCredential $user,$securePassword | |
Invoke-Command -Authentication CredSSP -ScriptBlock {choco install sql-server-express -y} -ComputerName $env:computername -Credential $credential | |
Invoke-Command -Authentication CredSSP -ScriptBlock {choco install ssms -y} -ComputerName $env:computername -Credential $credential |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment