The Remove-MsolServicePrincipal cmdlet in PowerShell removes a service principal from Microsoft Office 365.
The syntax to remove a service principal from Azure Active Directory is given below.
Remove-MsolServicePrincipal
-ObjectId <Guid>
-AppPrincipalId <Guid>
-ServicePrincipalName <String>
[-TenantId <Guid>]
[<CommonParameters>]
In this article, we will discuss how to use the Remove-MsolServicePrincipal cmdlet in PowerShell to remove a service principal from Azure Active Directory.
How to Remove a Service Principal
To remove a service principal from Office 365, use the Remove-MsolServicePrincipal cmdlet with the -ServicePrincipalName
parameter.
The -ServicePrincipalName
parameter specifies the name of the service principal or service principals to remove.
Remove-MsolServicePrincipal -ServicePrincipalName "ShellGeekApp/ShellApp.com"
This command removes a service principal by specifying the service principal name “ShellGeekApp/ShellApp.com“.
Conclusion
I hope the above article on how to use the Remove-MsolServicePrincipal cmdlet in PowerShell to remove a service principal from Azure Active Directory is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.