SharePoint Tenent Setting Not fully available in Graph API

Mukilan M 0 Reputation points
2024-05-24T11:01:43.2233333+00:00

The Graph API SharePoint Tenet setting is not giving complete details like the Powershell Cmd : Get-SPOTenent
But SPOTenent is using only legacy authorization. And PnP also using only the user based bearer token not accepting the application based bearer token.
Need solution for this :
-> Is there any graph API to get SharePoint&OneDrive Tenent Setting completely like Get-SPOTenant.
-> Is there any way to use Connect SPOOnline using bearer token using appid, appsecret without using PnP.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,051 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
903 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,011 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 32,556 Reputation points Microsoft Vendor
    2024-05-27T02:28:16.0866667+00:00

    Hi @Mukilan M,

    In Graph api you could use following api to get Tenent Setting

    GET https://graph.microsoft.com/v1.0/admin/sharepoint/settings
    

    Here is the document for reference

    https://learn.microsoft.com/en-us/graph/api/sharepointsettings-get?view=graph-rest-1.0&tabs=http

    To connect SPOOnline with ModernAuth, you could use following cmdlet

    Connect-SPOService -Credential $creds -Url https://tenant-admin.sharepoint.com -ModernAuth $true -AuthenticationUrl https://login.microsoftonline.com/organizations
    

    Here is the document for reference

    https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/connect-sposervice?view=sharepoint-ps#example-5


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.