Skip to content

Commit eec99d5

Browse files
committed
Merge branch 'dev'
2 parents 732abc4 + 6bcabce commit eec99d5

File tree

4 files changed

+812
-291
lines changed

4 files changed

+812
-291
lines changed

GenLeCertForNS.cmd

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@ECHO OFF
22
setlocal EnableDelayedExpansion
3-
REM --> Check for permissions
3+
REM --> Check for permissions to find out if script has elevated privileges.
44
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
55

6-
REM --> If error flag set, we do not have admin.
6+
REM --> If error flag set, we do not have elevated privileges.
77
if '%errorlevel%' NEQ '0' (
88
echo Requesting administrative privileges...
99
goto UACPrompt
@@ -24,30 +24,50 @@ if '%errorlevel%' NEQ '0' (
2424

2525
goto StartScript
2626

27-
rem ===== Help Example =====
27+
rem ===== Help Example - HTTP =====
2828

2929
SET OPTIONS=-CN "domain.com"
3030
SET OPTIONS=%OPTIONS% -EmailAddress "[email protected]"
3131
SET OPTIONS=%OPTIONS% -SAN "sts.domain.com","www.domain.com","vpn.domain.com"
3232
SET OPTIONS=%OPTIONS% -PfxPassword "P@ssw0rd"
3333
SET OPTIONS=%OPTIONS% -CertDir "C:\Certificates"
34-
SET OPTIONS=%OPTIONS% -NSManagementURL "http://192.168.100.1"
35-
SET OPTIONS=%OPTIONS% -NSCsVipName "cs_domain.com_http"
36-
SET OPTIONS=%OPTIONS% -NSPassword "P@ssw0rd"
37-
SET OPTIONS=%OPTIONS% -NSUsername "nsroot"
38-
SET OPTIONS=%OPTIONS% -NSCertNameToUpdate "san_domain_com"
39-
SET OPTIONS=%OPTIONS% -LogLevel Debug
34+
SET OPTIONS=%OPTIONS% -ManagementURL "http://192.168.100.1"
35+
SET OPTIONS=%OPTIONS% -CsVipName "cs_domain.com_http"
36+
SET OPTIONS=%OPTIONS% -Username "nsroot"
37+
SET OPTIONS=%OPTIONS% -Password "P@ssw0rd"
38+
SET OPTIONS=%OPTIONS% -CertKeyNameToUpdate "san_domain_com"
39+
rem SET OPTIONS=%OPTIONS% -LogLevel Debug
40+
rem SET OPTIONS=%OPTIONS% -Production
41+
42+
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.
43+
44+
rem ===== Help Example - DNS =====
45+
46+
SET OPTIONS=-CN "domain.com"
47+
SET OPTIONS=%OPTIONS% -EmailAddress "[email protected]"
48+
SET OPTIONS=%OPTIONS% -SAN "*.domain.com"
49+
rem SET OPTIONS=%OPTIONS% -DNSPlugin "Aurora"
50+
rem SET OPTIONS=%OPTIONS% -DNSParams @{AuroraCredential=$((New-Object PSCredential 'KEYKEYKEY',$(ConvertTo-SecureString -String 'SECRETSECRETSECRET' -AsPlainText -Force))); AuroraApi='api.auroradns.eu'}
51+
SET OPTIONS=%OPTIONS% -PfxPassword "P@ssw0rd"
52+
SET OPTIONS=%OPTIONS% -CertDir "C:\Certificates"
53+
SET OPTIONS=%OPTIONS% -ManagementURL "http://192.168.100.1"
54+
SET OPTIONS=%OPTIONS% -CsVipName "cs_domain.com_http"
55+
SET OPTIONS=%OPTIONS% -Username "nsroot"
56+
SET OPTIONS=%OPTIONS% -Password "P@ssw0rd"
57+
SET OPTIONS=%OPTIONS% -CertKeyNameToUpdate "san_domain_com"
58+
rem SET OPTIONS=%OPTIONS% -LogLevel Debug
4059
rem SET OPTIONS=%OPTIONS% -Production
4160

4261
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.
43-
NOTE: Use the "-Verbose" parameter to get diagnostic output
4462

4563
rem ===== Auto Run Example ====
4664

4765
SET OPTIONS=%OPTIONS% -AutoRun
48-
SET OPTIONS=%OPTIONS% -ConfigFile "LetsEncryptCerificates.json"
66+
SET OPTIONS=%OPTIONS% -ConfigFile ".\LetsEncryptCerificates.json"
4967
SET OPTIONS=%OPTIONS% -Production
5068

69+
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.
70+
NOTE: Use the "-Verbose" parameter to get diagnostic output
5171

5272
rem ===== End Help Example =====
5373

@@ -58,15 +78,15 @@ SET OPTIONS=%OPTIONS% -EmailAddress "[email protected]"
5878
SET OPTIONS=%OPTIONS% -SAN "sts.domain.com","www.domain.com","vpn.domain.com"
5979
SET OPTIONS=%OPTIONS% -PfxPassword "P@ssw0rd"
6080
SET OPTIONS=%OPTIONS% -CertDir "C:\Certificates"
61-
SET OPTIONS=%OPTIONS% -NSManagementURL "http://192.168.100.1"
62-
SET OPTIONS=%OPTIONS% -NSCsVipName "cs_domain.com_http"
63-
SET OPTIONS=%OPTIONS% -NSPassword "P@ssw0rd"
64-
SET OPTIONS=%OPTIONS% -NSUsername "nsroot"
65-
SET OPTIONS=%OPTIONS% -NSCertNameToUpdate "san_domain_com"
81+
SET OPTIONS=%OPTIONS% -ManagementURL "http://192.168.100.1"
82+
SET OPTIONS=%OPTIONS% -CsVipName "cs_domain.com_http"
83+
SET OPTIONS=%OPTIONS% -Username "nsroot"
84+
SET OPTIONS=%OPTIONS% -Password "P@ssw0rd"
85+
SET OPTIONS=%OPTIONS% -CertKeyNameToUpdate "san_domain_com"
6686
SET OPTIONS=%OPTIONS% -LogFile "le-certificates.txt"
67-
SET OPTIONS=%OPTIONS% -LogLevel Info
68-
rem SET OPTIONS=%OPTIONS% -ConfigFile ".\GenLe-Config.json"
87+
rem SET OPTIONS=%OPTIONS% -LogLevel Debug
88+
rem SET OPTIONS=%OPTIONS% -ConfigFile ".\GenLe-Config.json"
6989
rem SET OPTIONS=%OPTIONS% -DisableIPCheck
7090
rem SET OPTIONS=%OPTIONS% -Production
7191

72-
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -File "%~dp0GenLeCertForNS.ps1" %OPTIONS%
92+
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "& {.\GenLeCertForNS.ps1 %OPTIONS%}"

0 commit comments

Comments
 (0)