Last active
September 2, 2016 11:01
-
-
Save rheid/c4e2d8b2662438614862 to your computer and use it in GitHub Desktop.
Import SSL certificate to IIS webserver what is inside the root filesystem
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
$Path = "C:\inetpub\wwwroot\static" | |
$Folders = Get-ChildItem -path $Path -Recurse -Include *.pfx | |
$pass = $mypwd = ConvertTo-SecureString -String "<Passwort>" -Force –AsPlainText | |
foreach ($file in $Folders) | |
{ | |
#Get Folder-Informationen form Filessystem | |
$loop = $loop + 1; | |
$sitefilepath = $file.Fullname | |
Write-Host $sitefilepath -ForegroundColor Green | |
Import-PfxCertificate –FilePath $sitefilepath -CertStoreLocation cert:\localmachine\my –Exportable -Password $pass | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment