11@ ECHO OFF
22setlocal 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 .
77if '%errorlevel% ' NEQ '0' (
88 echo Requesting administrative privileges...
99 goto UACPrompt
@@ -24,30 +24,50 @@ if '%errorlevel%' NEQ '0' (
2424
2525goto StartScript
2626
27- rem ===== Help Example =====
27+ rem ===== Help Example - HTTP =====
2828
2929SET OPTIONS = -CN " domain.com"
3030SET OPTIONS = %OPTIONS% -EmailAddress
" [email protected] " 3131SET OPTIONS = %OPTIONS% -SAN " sts.domain.com" ," www.domain.com" ," vpn.domain.com"
3232SET OPTIONS = %OPTIONS% -PfxPassword " P@ssw0rd"
3333SET 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
4059rem SET OPTIONS=%OPTIONS% -Production
4160
4261NOTE: 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
4563rem ===== Auto Run Example ====
4664
4765SET OPTIONS = %OPTIONS% -AutoRun
48- SET OPTIONS = %OPTIONS% -ConfigFile " LetsEncryptCerificates.json"
66+ SET OPTIONS = %OPTIONS% -ConfigFile " .\ LetsEncryptCerificates.json"
4967SET 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
5272rem ===== End Help Example =====
5373
5878SET OPTIONS = %OPTIONS% -SAN " sts.domain.com" ," www.domain.com" ," vpn.domain.com"
5979SET OPTIONS = %OPTIONS% -PfxPassword " P@ssw0rd"
6080SET 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"
6686SET 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"
6989rem SET OPTIONS=%OPTIONS% -DisableIPCheck
7090rem SET OPTIONS=%OPTIONS% -Production
7191
72- %SystemRoot% \System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -File " %~dp0 GenLeCertForNS. ps1" %OPTIONS%
92+ %SystemRoot% \System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy Bypass -Command " & {.\GenLeCertForNS. ps1 %OPTIONS% } "
0 commit comments