Luckily, Anand Srinivasan already blogged on how to achieve this through .Net code:
link
I've taken the liberty to update his sample to PowerShell code, since that fits my usage scenario's better;
$site = get-spweb "https://spsiteurl.local"
$clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$manager = [Microsoft.SharePoint.SPAppPrincipalManager]::GetManager($site)
$realm = Get-SPAuthenticationRealm -ServiceContext $site.Site
$nameIdentifier = $clientId + '@' + $realm
$appPrincipal = Get-SPAppPrincipal -Site $site -NameIdentifier $nameIdentifier
$manager.DeleteAppPrincipal($appPrincipal)
No comments:
Post a Comment