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.
12,267 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,142 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,821 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,171 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.