Microsoft 365: PowerShell – How to retrieve tenant settings

Fetching all Microsoft 365 tenant
Fetching all Microsoft 365 tenant

Hi All,

Greetings for the day!!!

Today, I’m sharing a short PowerShell script that retrieves all tenant settings.

Details

  • Background / Usecase / Scenario
    • I need to update one of the my tenant setting – “LegacyAuthProtocolsEnabled“
    • Before updating the respective tenant setting, I want to see the current value for the setting – “LegacyAuthProtocolsEnabled“
  • We have SharePoint Online PowerShell module CMDLET – “Get-SPOTenant” which returns all the tenant settings.
  • To use “Get-SPOTenant” CMDLET we need to connect to Microsoft 365 tenant
  • We will connect to our Microsoft 365 tenant using “Connect-SPOService” PowerShell CMDLET
  • Import the SharePoint Online PowerShell module – Microsoft.Online.SharePoint.PowerShell using Import-Module PowerShell CMDLET
  • Using Get-Module we will get the path of – SharePoint Online PowerShell module – Microsoft.Online.SharePoint.PowerShell

PS C:\> Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable
Directory: C:\Users\Documents\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Binary 16.0.2612… Microsoft.Online.SharePoint.PowerS… Desk

  • As we get the path for SharePoint Online PowerShell module – Microsoft.Online.SharePoint.PowerShell, we are ready to import the module

PS C:\> Import-Module -Name C:\Users\Documents\PowerShell\Modules\Microsoft.Online.SharePoint.PowerShell -UseWindowsPowerShell
WARNING: The names of some imported commands from the module 'Microsoft.Online.SharePoint.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
WARNING: The names of some imported commands from the module 'Microsoft.Online.SharePoint.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
WARNING: The names of some imported commands from the module 'Microsoft.Online.SharePoint.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
WARNING: Module Microsoft.Online.SharePoint.PowerShell is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax.

We have detailed articles on PowerShell module.

PowerShell – Exploring Module CMDLETs – https://knowledge-junction.in/2022/12/12/__trashed-2/

PowerShell Modules / CMDLETs – Connecting to Microsoft 365 Services – https://knowledge-junction.in/2025/06/09/powershell-connecting-to-microsoft-365-services/

  • As we successfully import the module, we are ready to connect to Microsoft 365 tenant using “Connect-SPOService“

PS C:\> Connect-sPOService -Url https://knowledgejunction1-admin.sharepoint.com/ -Credential $cred

Screenshot of a PowerShell terminal showing commands related to the SharePoint Online PowerShell module, including 'Get-Module -Name Microsoft.Online.SharePoint.PowerShell' and 'Connect-SPOService'.
figure: Connecting to our Microsoft 365 tenant
  • As we successfully connected to Microsoft 365 tenant, we are ready to fetch all tenant settings using “Get-SPOTenant“

PS C:> Get-SPOTenant

RunspaceId : 6f32d8eb-3387-484b-8912-7b344174b765
StorageQuota : 1304576
BonusStorageQuotaMB : 0
StorageQuotaAllocated : 0
ResourceQuota : 0
ResourceQuotaAllocated : 0
OneDriveStorageQuota : 1048576
CompatibilityRange : 15,15
ExternalServicesEnabled : True
NoAccessRedirectUrl :
ArchiveRedirectUrl :
SharingCapability : ExternalUserAndGuestSharing
DisplayStartASiteOption : True
StartASiteFormUrl : https://knowledgejunction1.sharepoint.com/SitePages/
Test-PowerApps.aspx
ShowEveryoneClaim : False
ShowAllUsersClaim : False
OfficeClientADALDisabled : False
LegacyAuthProtocolsEnabled : True
DisableCustomAppAuthentication : False
IsSharePointAddInsDisabled : False
IsSharePointAddInsBlocked : False
DisableSharePointStoreAccess : False
SiteOwnerManageLegacyServicePrincipalEnabled : False
ShowEveryoneExceptExternalUsersClaim : True
AllowEveryoneExceptExternalUsersClaimInPrivateSite : True
SearchResolveExactEmailOrUPN : False
ProvisionSharedWithEveryoneFolder : False

Screenshot of PowerShell terminal showing the output of the Get-SPOTenant command, displaying various tenant settings and their current values.
figure: Fetching all Microsoft 365 tenant

REFERENCES

Thanks for reading!!!

HAVE A FANTASTIC TIME AHEAD !!! LIFE IS BEAUTIFUL 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

2 Responses

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.