-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
812 additions
and
291 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
@ECHO OFF | ||
setlocal EnableDelayedExpansion | ||
REM --> Check for permissions | ||
REM --> Check for permissions to find out if script has elevated privileges. | ||
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | ||
|
||
REM --> If error flag set, we do not have admin. | ||
REM --> If error flag set, we do not have elevated privileges. | ||
if '%errorlevel%' NEQ '0' ( | ||
echo Requesting administrative privileges... | ||
goto UACPrompt | ||
|
@@ -24,30 +24,50 @@ if '%errorlevel%' NEQ '0' ( | |
|
||
goto StartScript | ||
|
||
rem ===== Help Example ===== | ||
rem ===== Help Example - HTTP ===== | ||
|
||
SET OPTIONS=-CN "domain.com" | ||
SET OPTIONS=%OPTIONS% -EmailAddress "[email protected]" | ||
SET OPTIONS=%OPTIONS% -SAN "sts.domain.com","www.domain.com","vpn.domain.com" | ||
SET OPTIONS=%OPTIONS% -PfxPassword "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -CertDir "C:\Certificates" | ||
SET OPTIONS=%OPTIONS% -NSManagementURL "http://192.168.100.1" | ||
SET OPTIONS=%OPTIONS% -NSCsVipName "cs_domain.com_http" | ||
SET OPTIONS=%OPTIONS% -NSPassword "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -NSUsername "nsroot" | ||
SET OPTIONS=%OPTIONS% -NSCertNameToUpdate "san_domain_com" | ||
SET OPTIONS=%OPTIONS% -LogLevel Debug | ||
SET OPTIONS=%OPTIONS% -ManagementURL "http://192.168.100.1" | ||
SET OPTIONS=%OPTIONS% -CsVipName "cs_domain.com_http" | ||
SET OPTIONS=%OPTIONS% -Username "nsroot" | ||
SET OPTIONS=%OPTIONS% -Password "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -CertKeyNameToUpdate "san_domain_com" | ||
rem SET OPTIONS=%OPTIONS% -LogLevel Debug | ||
rem SET OPTIONS=%OPTIONS% -Production | ||
|
||
NOTE: Use the "-Production" only if you're sure everything works, you can only use the Let's Encrypt production server 5 times per week. | ||
|
||
rem ===== Help Example - DNS ===== | ||
|
||
SET OPTIONS=-CN "domain.com" | ||
SET OPTIONS=%OPTIONS% -EmailAddress "[email protected]" | ||
SET OPTIONS=%OPTIONS% -SAN "*.domain.com" | ||
rem SET OPTIONS=%OPTIONS% -DNSPlugin "Aurora" | ||
rem SET OPTIONS=%OPTIONS% -DNSParams @{AuroraCredential=$((New-Object PSCredential 'KEYKEYKEY',$(ConvertTo-SecureString -String 'SECRETSECRETSECRET' -AsPlainText -Force))); AuroraApi='api.auroradns.eu'} | ||
SET OPTIONS=%OPTIONS% -PfxPassword "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -CertDir "C:\Certificates" | ||
SET OPTIONS=%OPTIONS% -ManagementURL "http://192.168.100.1" | ||
SET OPTIONS=%OPTIONS% -CsVipName "cs_domain.com_http" | ||
SET OPTIONS=%OPTIONS% -Username "nsroot" | ||
SET OPTIONS=%OPTIONS% -Password "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -CertKeyNameToUpdate "san_domain_com" | ||
rem SET OPTIONS=%OPTIONS% -LogLevel Debug | ||
rem SET OPTIONS=%OPTIONS% -Production | ||
|
||
NOTE: Use the "-Production" only if you're sure everything works, you can only use the Let's Encrypt production server 5 times per week. | ||
NOTE: Use the "-Verbose" parameter to get diagnostic output | ||
|
||
rem ===== Auto Run Example ==== | ||
|
||
SET OPTIONS=%OPTIONS% -AutoRun | ||
SET OPTIONS=%OPTIONS% -ConfigFile "LetsEncryptCerificates.json" | ||
SET OPTIONS=%OPTIONS% -ConfigFile ".\LetsEncryptCerificates.json" | ||
SET OPTIONS=%OPTIONS% -Production | ||
|
||
NOTE: Use the "-Production" only if you're sure everything works, you can only use the Let's Encrypt production server 5 times per week. | ||
NOTE: Use the "-Verbose" parameter to get diagnostic output | ||
|
||
rem ===== End Help Example ===== | ||
|
||
|
@@ -58,15 +78,15 @@ SET OPTIONS=%OPTIONS% -EmailAddress "[email protected]" | |
SET OPTIONS=%OPTIONS% -SAN "sts.domain.com","www.domain.com","vpn.domain.com" | ||
SET OPTIONS=%OPTIONS% -PfxPassword "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -CertDir "C:\Certificates" | ||
SET OPTIONS=%OPTIONS% -NSManagementURL "http://192.168.100.1" | ||
SET OPTIONS=%OPTIONS% -NSCsVipName "cs_domain.com_http" | ||
SET OPTIONS=%OPTIONS% -NSPassword "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -NSUsername "nsroot" | ||
SET OPTIONS=%OPTIONS% -NSCertNameToUpdate "san_domain_com" | ||
SET OPTIONS=%OPTIONS% -ManagementURL "http://192.168.100.1" | ||
SET OPTIONS=%OPTIONS% -CsVipName "cs_domain.com_http" | ||
SET OPTIONS=%OPTIONS% -Username "nsroot" | ||
SET OPTIONS=%OPTIONS% -Password "P@ssw0rd" | ||
SET OPTIONS=%OPTIONS% -CertKeyNameToUpdate "san_domain_com" | ||
SET OPTIONS=%OPTIONS% -LogFile "le-certificates.txt" | ||
SET OPTIONS=%OPTIONS% -LogLevel Info | ||
rem SET OPTIONS=%OPTIONS% -ConfigFile ".\GenLe-Config.json" | ||
rem SET OPTIONS=%OPTIONS% -LogLevel Debug | ||
rem SET OPTIONS=%OPTIONS% -ConfigFile ".\GenLe-Config.json" | ||
rem SET OPTIONS=%OPTIONS% -DisableIPCheck | ||
rem SET OPTIONS=%OPTIONS% -Production | ||
|
||
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -File "%~dp0GenLeCertForNS.ps1" %OPTIONS% | ||
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "& {.\GenLeCertForNS.ps1 %OPTIONS%}" |
Oops, something went wrong.