Hi,
I been trying write a powershell script to walk through the entire O365 SharePoint Online tenant and add an Office 365 Security group (one that doesn't have an email address associated with it) to the primary or secondary site collection (SC) administrators for each site. The group will support eDiscovery and Administrative Support activities.
I have the script working to enumerate all site collections but have hit a problem when I want to add the group.
I can use the following cmdlet to add a user as and SC admin:
Set-SPOUser-Site $siteUrl-LoginName$userEmail -IsSiteCollectionAdmin$true
Where $userEmail is a valid email address in the tenant. The issue is that the Office 365 Security group doesn't have an email address so I can't use it here. I can enumerate the group using the following but I can't find anyway to use the output from this and apply it to adding it to the SC admins group.
Get-MsolGroup-SearchString"SharePoint eDisc and Admins"
Can you please provide some assistance as to how to successfully an Office 365 Security group to the primary or secondary site collection (SC) administrators for a site using PowerShell.
I've been told by Partner Support that this is not possible using the current SPO cmdlets and that CSOM is not within their support scope. SO can anyone help with this query in relation to how to acheinve this using CSOM within PowerShell?
Thanks in advance,
KB
Kirk Barrett, CSC