0

Is there a way to get a list of all deleted sites in sharePoint using Microsoft Graph or SharePoint API? I don’t want to use powershell. I want a api. Thanks in advance

0

You can use Get-SPODeletedSite command to get deleted sites in SharePoint Online:

$adminUPN="adminname@Tenant.onmicrosoft.com"
$orgName="TenantName"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
Get-SPODeletedSite -IncludePersonalSite

Get-SPODeletedSite

2
  • I don't want to use powershell. I want an API either microsoft graph or sharepoint api Jun 8 '20 at 10:43
  • @MridulSharma Graph API have no endpoint to list deleted sites docs.microsoft.com/en-us/graph/api/… Rest API is client side API, also not have such enpoint to get deleted sites. In this case, SharePoint Online Mangement Shell is the only way to achieve it.
    – Jerry
    Jun 9 '20 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.