
The pressure on IT administrators at Microsoft and everywhere ratcheted up tremendously. The transition to living in this new “software as a service” world was further complicated when the global COVID-19 pandemic pushed much of the workforce into remote and hybrid environments.
#HOW TO CHANGE PERSPECTIVE IN PRINCIPLE APP HOW TO#
“Microsoft 365 started changing every day, and we needed to figure out how to keep up.” “We were no exception,” says David Johnson, who leads the team that governs how Microsoft 365 is deployed across Microsoft. So when you test it, I recommend you to use different values of the parameters.Once Microsoft 365 became a service, the way IT managers needed to think about change management had to change, and dramatically so. $Thumbprint = ::ToBase64String($CustomKeyIdentifier)īesides, you should note the different command combinations will lead to different results, see this link. $CustomKeyIdentifier = (Get-AzureADApplicationKe圜redential -ObjectId "").CustomKeyIdentifier Application administrator, Groups administrator, it will also work. Then you can use this way you have tried, to fix the Forbidden error, your account should at least be the Owner of the AD App, or if your account has an admin role in the tenant e.g. New-AzADServicePrincipal -DisplayName joy134 -CertValue $base64Value $cert=New-SelfSignedCertificate -Subject "CN=TodoListDaemonWithCert" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature And make sure you are looking into the correct AD App in the portal, because the DisplayName of the AD App could be repeated. In my sample, I use the new Az module, for the old AzureRm module which you used, it should also work(Not completely sure, I recommend you to use the new Az module, because the AzureRm module has been deprecated and will not be updated). App Registration) for you automatically, and the certificate will also appear in the Certificates & secrets of your AD App. When using New-AzADServicePrincipal to create the service principal, it will create an AD App(i.e. $ke圜reds.value | Select-Object customKeyIdentifier $sp =New-AzureRmADServicePrincipal -DisplayName "jimtestsample" -CertValue $keyValue -EndDate $endDate $keyValue = ::ToBase64String($certificateObject.GetRawCertData()) $certificateObject.Import("E:\Cert\examplecert.pfx","Password0123!", ::DefaultKeySet) $certificateObject = New-Object 509Certificates.X509Certificate2 The customKeyIdentifier in Ke圜redential is the thumbprint of the certificate GET How to get thumbprint of the certificate associated with a service principal in Azure AD using powershell when the service principal is created independently without AzureRmADApplication and AzureRmADAppCredential?Īccording to my test, we can use the following Azure AD Graph API to get the key credentials of the sp. $sp2 = New-AzureRmADServicePrincipal -ApplicationId $adapp.ApplicationId -DisplayName "" New-AzureRmADAppCredential -ApplicationId $adapp.ApplicationId -CertValue $certValue2 EndDate (::ConvertTimeBySystemTimeZoneId($(), ::Local.Id, 'GMT Standard Time')) StartDate (::ConvertTimeBySystemTimeZoneId($(), ::Local.Id, 'GMT Standard Time')) ` Sample script below - $adapp = New-AzureRmADApplication -DisplayName "" ` Please note that when I create an application using New-AzureRmADApplication followed by credential New-AzureRmADAppCredential and then New-AzureRmADServicePrincipal, then I see the ke圜redentials with customKeyIdentifier set to the certificate thumbprint. I also checked the manifest in Azure Portal under the service principal that gets created under Azure Active Directory → App Registrations → → Manifest, but the ke圜redentials node is empty "ke圜redentials": , I've tried this, but I get Forbidden when I try to execute Get-AzureADApplicationKe圜redential Once service principal is created in Azure AD, how do I see thumbprint of the certificate associated with the service principal using Powershell? This service principal works fine and I am able to get a token when using the cert. Where certValue3 is Base64String RawCertData. I have a service principal that I've creating using below powershell.
