Approve-SPOTenantServicePrincipalPermissionRequest

Approves a permission request for the current tenant's "SharePoint Online Client" service principal

Syntax

Approve-SPOTenantServicePrincipalPermissionRequest
       -RequestId <Guid>

Description

Approves a permission request for the current tenant's "SharePoint Online Client" service principal

The return value of a successful call is a permission grant object. See the Description section of Get-SPOTenantServicePrincipalPermissionGrants for more information about a permission grant object.

To get the collection of permission grants for the "SharePoint Online Client" service principal, use the Get-SPOTenantServicePrincipalPermissionGrants command.

Approving a permission request also removes that request from the list of permission requests.

Examples

------------------EXAMPLE 1------------------

$requests = Get-SPOTenantServicePrincipalPermissionRequests
$requestToApprove = $requests | ? { $_.Resource -eq 'Office 365 SharePoint Online' -and $_.Scope -eq 'MyFiles.Read' } | Select-Object -First 1

if ($requestToApprove -ne $null)
{
    Approve-SPOTenantServicePrincipalPermissionRequest -RequestId $requestToApprove.Id
}

Approves the permission request for the 'Office 365 SharePoint Online' resource with scope claim 'MyFiles.Read'. If there is no request with those properties, then no approve action will be taken.

Parameters

-RequestId

The ID of the permission request to approve

Type:Guid
Position:Named
Required:True
Accept pipeline input:False
Accept wildcard characters:False