Skip to content

Instantly share code, notes, and snippets.

@DarkAllien
Created June 12, 2017 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarkAllien/09e6501c5ace609620e50611034e8134 to your computer and use it in GitHub Desktop.
Save DarkAllien/09e6501c5ace609620e50611034e8134 to your computer and use it in GitHub Desktop.
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