scusi gist felülvizsgálása 6 months ago. Revízióhoz ugrás
Nincsenek változtatások
Florian Walther gist felülvizsgálása 2 years ago. Revízióhoz ugrás
1 file changed, 1 insertion
gistfile1.txt
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | # | |
| 3 | 3 | # i do not know if this code works, never tried. | |
| 4 | 4 | # i just wanted to keep it, just in case or to try it one day. | |
| 5 | + | # Even if it does not work, it might be a good starting point. | |
| 5 | 6 | # ~scusi | |
| 6 | 7 | ############################################################################### | |
| 7 | 8 | #Set UserCertificate in EXO | |
Florian Walther gist felülvizsgálása 2 years ago. Revízióhoz ugrás
1 file changed, 29 insertions
gistfile1.txt(fájl létrehozva)
| @@ -0,0 +1,29 @@ | |||
| 1 | + | # Source: https://techcommunity.microsoft.com/t5/exchange/upload-s-mime-user-certificate-with-outlook-to-the-gal/m-p/3781147 | |
| 2 | + | # | |
| 3 | + | # i do not know if this code works, never tried. | |
| 4 | + | # i just wanted to keep it, just in case or to try it one day. | |
| 5 | + | # ~scusi | |
| 6 | + | ############################################################################### | |
| 7 | + | #Set UserCertificate in EXO | |
| 8 | + | ############################################################################### | |
| 9 | + | Connect-ExchangeOnline | |
| 10 | + | $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("D:\temp\a.bohren@icewolf.ch_swisssign.cer") | |
| 11 | + | $certArray = New-Object System.Collections.ArrayList | |
| 12 | + | $certArray.Insert(0,$cert.GetRawCertData()) | |
| 13 | + | Set-Mailbox -Identity email address removed for privacy reasons -UserCertificate $certArray | |
| 14 | + | ||
| 15 | + | $MBX = Get-RemoteMailbox -Identity email address removed for privacy reasons | |
| 16 | + | $Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($mbx.UserCertificate) | |
| 17 | + | $Cert | fL | |
| 18 | + | ||
| 19 | + | ############################################################################### | |
| 20 | + | #AD | |
| 21 | + | ############################################################################### | |
| 22 | + | $ADUser = Get-ADUser -Identity "a.bohren" -Properties userCertificate | |
| 23 | + | $ADUser.userCertificate | |
| 24 | + | $Cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($ADUser.userCertificate) | |
| 25 | + | $Cert | fL | |
| 26 | + | Set-ADUser -Identity "a.bohren" -Clear "userCertificate" | |
| 27 | + | ||
| 28 | + | $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("D:\temp\a.bohren@icewolf.ch_swisssign.cer") | |
| 29 | + | Set-ADUser -Identity "a.bohren" -add @{"userCertificate"=$Cert.Rawdata} | |