cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate $cer.Import("C:\myapp.cer") $binCert = $cer.GetRawCertData() ...

          $cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
          $cer.Import("C:\myapp.cer")
          $binCert = $cer.GetRawCertData()
          $credValue = [System.Convert]::ToBase64String($binCert);
          New-MsolServicePrincipalCredential -ServicePrincipalName "MyApp/myApp.com" -Type asymmetric -Value $credValue -StartDate $cer.GetEffectiveDateString() -EndDate $cer.GetExpirationDateString()

          New credential object added, including the KeyId for the added credential.
English
English (United States)
Deutsch (Deutschland)
German (Germany)
Español (España)
Spanish (Spain)
Français (France)
French (France)
italiano
Italian
日本語
Japanese