Can i get a list of all site collections in a tenant using power automate?

%3CLINGO-SUB%20id%3D%22lingo-sub-1860658%22%20slang%3D%22en-US%22%3ECan%20i%20get%20a%20list%20of%20all%20site%20collections%20in%20a%20tenant%20using%20power%20automate%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1860658%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3EWill%20it%20be%20possible%20to%20get%26nbsp%3B%20a%20list%20of%20all%20site%20collections%20in%20a%20tenant%20using%20power%20automate%3F%3CBR%20%2F%3ECurrently%20I'm%20using%20powershell%20and%20have%20to%20query%20the%20sharepoint%20admin%20site.%3C%2FP%3E%3CP%3EBut%20i'm%20thinking%20power%20automate%20can%20do%20similar%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1860658%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1865704%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20i%20get%20a%20list%20of%20all%20site%20collections%20in%20a%20tenant%20using%20power%20automate%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1865704%22%20slang%3D%22en-US%22%3E%3CP%3EAnyone%20updates%20from%20any%20one%20from%20Microsoft%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1922256%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20i%20get%20a%20list%20of%20all%20site%20collections%20in%20a%20tenant%20using%20power%20automate%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1922256%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89836%22%20target%3D%22_blank%22%3E%40Patrick%20Rote%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20case%20you%20haven't%20already%20figured%20this%20out...%20Yes%2C%20you%20can%20use%20the%20%22Invoke%20an%20HTTP%20request%20(Azure%20AD)%22%20to%20issue%20a%20Graph%20query%20to%20get%20all%20sites.%20See%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fsite-search%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGraph%20documentation%3C%2FA%3E%20for%20an%20example%20to%20test%20in%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fgraph-explorer%2Fpreview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGraph%20Explorer%3C%2FA%3E%20with%20your%20credentials.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%20Parse%20JSON%20to%20get%20at%20the%20individual%20fields%2C%20and%20then%20do%20whatever%20you%20wanted%20to%20do.%20In%20the%20example%20below%2C%20I'm%20just%20displaying%20them%20in%20an%20HTML%20table%20which%20could%20then%20be%20emailed%20or%20whatever.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorSandy%20Ussia_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%5BSorry%2C%20image%20attached%20-%20I%20couldn't%20embed%20it%20for%20some%20reason.%5D%3C%2FP%3E%0A%3CP%3EDoes%20this%20help%20you...%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESandy%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1922587%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20i%20get%20a%20list%20of%20all%20site%20collections%20in%20a%20tenant%20using%20power%20automate%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1922587%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89836%22%20target%3D%22_blank%22%3E%40Patrick%20Rote%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%26nbsp%3B%3CSPAN%3ESharePoint%20admin%20center%20site%2C%20there%20is%20one%20list%20with%20name%20%22DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS%22%20which%20contains%20the%20list%20of%20all%20site%20collections%20in%20tenant.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20you%20can%20call%20SharePoint%20REST%20APIs%20using%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20action%20in%20Power%20Automate%20to%20fetch%20the%20items%20from%20above%20list%20which%20will%20have%20details%20about%20site%20collections.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EReference%3C%2FSTRONG%3E%3A%26nbsp%3B%3CA%20title%3D%22Get%20All%20Site%20Collections%20Of%20Office%20365%20Tenant%20In%20MS%20Flow%22%20href%3D%22https%3A%2F%2Fwww.c-sharpcorner.com%2Farticle%2Fget-all-site-collections-of-office-365-tenant-in-ms-flow%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EGet%20All%20Site%20Collections%20Of%20Office%20365%20Tenant%20In%20MS%20Flow%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

Hi All,

Will it be possible to get  a list of all site collections in a tenant using power automate?
Currently I'm using powershell and have to query the sharepoint admin site.

But i'm thinking power automate can do similar?

 

Thanks 

4 Replies

Any updates from any one from Microsoft?

 

Hi @Patrick Rote ,

 

In case you haven't already figured this out... Yes, you can use the "Invoke an HTTP request (Azure AD)" to issue a Graph query to get all sites. See the Graph documentation for an example to test in Graph Explorer with your credentials. 

Then Parse JSON to get at the individual fields, and then do whatever you wanted to do. In the example below, I'm just displaying them in an HTML table which could then be emailed or whatever.

 

[Sorry, image attached - I couldn't embed it for some reason.]

Does this help you...?

 

Sandy

@Patrick Rote 

In SharePoint admin center site, there is one list with name "DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS" which contains the list of all site collections in tenant.

 

So, you can call SharePoint REST APIs using "Send an HTTP request to SharePoint" action in Power Automate to fetch the items from above list which will have details about site collections.

 

ReferenceGet All Site Collections Of Office 365 Tenant In MS Flow 


Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

 

@Sandy Ussia 

 

The query you mentioned in your answer will return all the sites (and subsites) and not only site collections in tenant.

 


Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.