Created
June 12, 2017 08:45
-
-
Save DarkAllien/09e6501c5ace609620e50611034e8134 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
Remove-Item $DirFiles\..\a.* -recurse -force | |
Import-Certificate -FilePath "$DirFiles\Certificates\VismaRootCA.cer" -CertStoreLocation Cert:\LocalMachine\Root -ErrorAction 'Continue' | |
Import-Certificate -FilePath "$DirFiles\Certificates\VismaIntCA.cer" -CertStoreLocation Cert:\LocalMachine\Root -ErrorAction 'Continue' | |
start-process $DirFiles\..\getcertificate.bat | |
Execute-Process -FilePath "CCMSETUP.EXE" -Parameters "/Source:$DirFiles /NoService /UsePKICert /NoCRLCheck CCMHOSTNAME=IPVITCMSCMG001.CLOUDAPP.NET/CCM_Proxy_MutualAuth/72057594037927955 SMSSITECODE=VIT CCMALWAYSINF=1 CCMFIRSTCERT=1 SMSSIGNCERT=$DirFiles\Certificates\SMS_Signing_Certificate.cer " | |
# Add regkey to stop Auto-Update | |
Push-Location | |
Set-Location HKLM: | |
$registryPath="SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" | |
$Name = "NoAutoUpdate" | |
$value = "1" | |
New-ItemProperty -Path $registryPath -Name $Name -Value $value -PropertyType DWORD –Force | |
Pop-Location | |
$SCEPPolicyPath = "$DirFiles"+"\ep_defaultpolicy.xml" | |
Execute-Process -FilePath "scepinstall.exe " -Arguments "/policy $SCEPPolicyPath /s /q" -IgnoreExitCodes "-2147156218" -WindowStyle 'Hidden' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment