Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition
by Jonas Andersson, Nuno Mota, Mike Pfeiffer
How it works...
Since the Exchange Management Shell uses remote PowerShell sessions, the Import-ExchangeCertificate cmdlet cannot use a local file path to import a certificate file. This is because the cmdlet could be running on any server within your organization and a local file path may not exist. Therefore, we need to use the -FileData parameter to provide the actual data of the certificate. In step 1, we read the certificate data into a byte array using the Get-Content cmdlet, which is a PowerShell core cmdlet, and is not run through the remote PowerShell on the Exchange server. The content of the certificate is stored as a byte array in the $certificate variable, and we can assign this data to the -FileData parameter of the Import-ExchangeCertificate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access