When I run the Get-PnPTenantServicePrincipal, Get-PnPTenantServicePrincipalPermissionGrants, Enable-PnPTenantServicePrincipal and Disable-PnPTenantServicePrincipal, I get "Unkown error".
With PnP debug log I get this output:
pwsh Error: 0 : 2024-05-14 15:57:42.4400 [PnP.Framework] [0] [Error] ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerException: Unknown Error
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServerAsync(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryAsync()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQueryAsync()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQueryAsync()
at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, String userAgent)
ServerErrorCode: -1
ServerErrorTypeName: Microsoft.SharePoint.Client.UnknownError
ServerErrorTraceCorrelationId: 04b828a1-a099-5000-9591-19941115384a
ServerErrorValue:
ServerErrorDetails:
. 0ms
Expected behavior
I expect the call to succeed.
What is the version of the Cmdlet module you are running?
I tried that with PnP PowerShell 2.3.0 and 2.4.0
Which operating system/environment are you running PnP PowerShell on?