Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GSC Autocert
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GSC Libraries
GSC Autocert
Commits
aa5ecab3
Commit
aa5ecab3
authored
Nov 07, 2019
by
Ben Galloway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve log output
parent
e3590c8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
exchange2010.ps1
exchange2010.ps1
+11
-11
iis.ps1
iis.ps1
+11
-11
No files found.
exchange2010.ps1
View file @
aa5ecab3
...
...
@@ -11,16 +11,6 @@ catch {
throw
$_
}
try
{
Write-Output
"Importing certificate to local store..."
echo
""
|
certutil
-importpfx
.
\gsc.org.uk.pfx
}
catch
{
Write-Output
"Failed to import certificate."
Write-Output
"The error was as follows:"
throw
$_
}
try
{
$certInfo
=
(
Get-PfxCertificate
-FilePath
gsc.org.uk.pfx
)
Write-Output
""
...
...
@@ -35,6 +25,16 @@ catch {
throw
$_
}
try
{
Write-Output
"Importing certificate to local store..."
echo
""
|
certutil
-importpfx
.
\gsc.org.uk.pfx
}
catch
{
Write-Output
"Failed to import certificate."
Write-Output
"The error was as follows:"
throw
$_
}
# FOR EXCHANGE
try
{
Add-PSSnapin
Microsoft.Exchange.Management.PowerShell.E2010
...
...
@@ -56,7 +56,7 @@ catch {
Write-Output
""
Write-Output
"========================="
Write-Output
"SUCCESS!"
Write-Output
"The certificate
with thumbprint
$(
$certInfo
.
Thumbprint
)
was
successfully
installed
"
Write-Output
"The certificate
is now in use
"
Write-Output
"and will expire on
$(
(
$certInfo
.
NotAfter
)
.
ToString
(
"dd MMMM yyyy"
)
)"
Write-Output
"========================="
Write-Output
""
iis.ps1
View file @
aa5ecab3
...
...
@@ -12,16 +12,6 @@ catch {
throw
$_
}
try
{
Write-Output
"Importing certificate to local store..."
echo
""
|
certutil
-importpfx
.
\gsc.org.uk.pfx
}
catch
{
Write-Output
"Failed to import certificate."
Write-Output
"The error was as follows:"
throw
$_
}
try
{
$certInfo
=
(
Get-PfxCertificate
-FilePath
gsc.org.uk.pfx
)
Write-Output
""
...
...
@@ -36,6 +26,16 @@ catch {
throw
$_
}
try
{
Write-Output
"Importing certificate to local store..."
echo
""
|
certutil
-importpfx
.
\gsc.org.uk.pfx
}
catch
{
Write-Output
"Failed to import certificate."
Write-Output
"The error was as follows:"
throw
$_
}
# FOR IIS
try
{
Import-Module
WebAdministration
...
...
@@ -59,7 +59,7 @@ catch {
Write-Output ""
Write-Output "========================="
Write-Output "SUCCESS!"
Write-Output "The certificate
with thumbprint $($certInfo.Thumbprint) was successfully installed
"
Write-Output "The certificate
is now in use
"
Write-Output "and will expire on $(($certInfo.NotAfter).ToString("dd MMMM yyyy"))"
Write-Output "========================="
Write-Output ""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment