Powershell Create Office 365 Groups (unified) with assets

%3CLINGO-SUB%20id%3D%22lingo-sub-150474%22%20slang%3D%22en-US%22%3EPowershell%20Create%20Office%20365%20Groups%20(unified)%20with%20assets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150474%22%20slang%3D%22en-US%22%3EGood%20evening%20fellow%20members.%20Before%20I%20put%20forward%20a%20proposal%20can%20I%20please%20ask%20if%20it%20is%20possible%20to%20programmatically%20create%20an%20Office%20365%20Group%20(unified)%20plus%20populate%20it%20with%20assets.%20Assets%20meaning%20'copying'%20documents%20from%20an%20existing%20SharePoint%20library%20when%20the%20group%20has%20been%20created.%20I%20am%20presuming%20the%20correct%20method%20is%20using%20the%20Graph%20API%2C%20but%20does%20this%20allow%20the%20ability%20to%20automate%20the%20population%20of%20the%20assets%20as%20well%3F%20Hope%20someone%20can%20give%20me%20a%20'Yes%20it%20is%20possible'%20or%20no%20not%20yet!%20Many%20thanks%20for%20any%20help.%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-150474%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%20Groups%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150716%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Create%20Office%20365%20Groups%20(unified)%20with%20assets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150716%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20could%20do%20it%20with%20the%20new%20Site%20Design%20Scripts%20as%20well%2C%20once%20your%20site%20is%20created%20the%20script%20could%20trigger%20a%20Flow%2C%20and%20Flow%20could%20copy%20some%20content.%20No%20polling%20required%2C%20it%20would%20all%20be%20triggered%20when%20the%20site%20is%20created%20from%20the%20design.%20See%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fsite-design-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fdeclarative-customization%2Fsite-design-overview%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150684%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Create%20Office%20365%20Groups%20(unified)%20with%20assets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150684%22%20slang%3D%22en-US%22%3EThank%20Juan%2C%20I%20am%20pleased%20about%20that.%20Needed%20to%20double%20check%20in%20case%20i%20was%20just%20happily%20wishing!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150563%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Create%20Office%20365%20Groups%20(unified)%20with%20assets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150563%22%20slang%3D%22en-US%22%3EYes%2C%20this%20is%20absolutely%20possible...bear%20in%20mind%20that%20you%20could%20find%20some%20challenges%20in%20regards%20of%20when%20the%20Group%20SPO%20Site%20is%20created%2C%20but%20technically%20you%20can%20just%20create%20a%20schedule%20task%20that%20check%20if%20the%20Group%20site%20is%20ready%20so%20documents%20are%20loaded%20in%20the%20document%20library...and%20yes%2C%20the%20right%20approach%20to%20do%20this%20is%20by%20means%20of%20the%20Graph.%20Take%20also%20a%20look%20at%20the%20possibilities%20provided%20by%20PnP%20n%20regards%20of%20provisioning%20modern%20team%20sites%20with%20a%20Group%20attached%3C%2FLINGO-BODY%3E
Super Contributor
Good evening fellow members. Before I put forward a proposal can I please ask if it is possible to programmatically create an Office 365 Group (unified) plus populate it with assets. Assets meaning 'copying' documents from an existing SharePoint library when the group has been created. I am presuming the correct method is using the Graph API, but does this allow the ability to automate the population of the assets as well? Hope someone can give me a 'Yes it is possible' or no not yet! Many thanks for any help.
3 Replies
Yes, this is absolutely possible...bear in mind that you could find some challenges in regards of when the Group SPO Site is created, but technically you can just create a schedule task that check if the Group site is ready so documents are loaded in the document library...and yes, the right approach to do this is by means of the Graph. Take also a look at the possibilities provided by PnP n regards of provisioning modern team sites with a Group attached
Thank Juan, I am pleased about that. Needed to double check in case i was just happily wishing!

You could do it with the new Site Design Scripts as well, once your site is created the script could trigger a Flow, and Flow could copy some content. No polling required, it would all be triggered when the site is created from the design. See

 

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview