I'd like to know how to have a ServicePrincipal in Azure AD that will be able to alter app registrations that it doesn't own, like remove an app or rotate its keys. I was told that if SP has "Application administrator" role then it should have enough permissions to do so.
So how would I be able to achieve this in Powershell?
I think you are looking for the
Add-AzureADDirectoryRoleMember
PowerShell cmdlet.Here is an example: