User Profile
HenrikAdolfsson
Copper Contributor
Joined 9 years ago
User Widgets
Recent Discussions
Export all owners email adress for all Office 365 groups
Hi! I have a script that exports all owners e-mail address for each Office 365 group to a csv file. The format of the csv file looks like below, one combination of Group and Owner on each row. Group 1;email address removed for privacy reasons Group 1;email address removed for privacy reasons Group 1;email address removed for privacy reasons Group 2;email address removed for privacy reasons … … The script looks like this: $PSScriptRoot $groups = Get-UnifiedGroup -ResultSize Unlimited | Sort-Object DisplayName $obj = @() foreach($group in $groups) { foreach($ManagedByDetails in $group.ManagedByDetails) { $ret = "" | select UnifiedGroup,ManagedByDetails,Alias $ret.UnifiedGroup = $group.DisplayName $ret.Alias = $group.Alias $ret.ManagedByDetails = $ManagedByDetails | Get-Recipient | select -ExpandProperty PrimarySMTPAddress $ret $obj += $ret } } $obj | Export-Csv $PSScriptRoot\Exporter\Office365GroupOwners.csv -NoTypeInformation -Encoding utf8 The script is working fine, but with over 6000 groups in the organization it now takes a long time to run, and it often stops. I have done some research on Internet and understand that it would be much faster to run a script against the Graph API. I have tested Tony Redmonds script, https://github.com/12Knocksinna/Office365itpros/blob/master/TeamsGroupsActivityReportV5.PS1, and it works fine but it doesn’t give me the email address of all owners, just one for each group/team. I have tried to see if I could re-use some parts of Tonys script and extract all owners email addresses, but I’m not that skilled in scripting :-(. So, I’m wondering if someone has a Graph-based script that exports the email address of each owner like my original script? Or any other suggestion to extract the same information. Thanks! /HenrikSolvedRe: Export all owners email adress for all Office 365 groups
Thanks Tony! At first it didn't work, but when I changed it to $GroupOwnerEmail = $GroupData.Mail -Join ", " } it gave all owners email addresses. I guess that you meant $GroupOwnerEmail and not $GroupUserMail, or? It ran very fast and gave me the information that I need, but since all addresses are on the same line, I’m note able to import it to my Power BI report like I normally do. Do you know a way to get the group name/alias and just one owner on each row? Regards, Henrik5.6KViews0likes2CommentsBlock users from becoming Guest in another Office 365 Tenant
Hi! Is it possible to restrict our Azure/Office 365 users from using their account/email-addresses as Guests in another Azure/Office 365 Tenant. I know that we can block which domains that we can send Guest invitations to, but in this case it is the other way around.Solved32KViews0likes15CommentsShare Outlook calender with a Team/Office 365 Group
Hi! We are using Outlook 2016, Exchange Online and Microsoft Teams and have a Team/Office 365 Group with approx. 60 users. We would like each member to share their calendar with the rest of the team members. In Outlook when I try to grant permission to the Team/Office 365 Group under Calendar Properties -> Permissions I get an error says it is not possible to grant permission to this kind of group. If I use a regular Security-enabled Distribution Group it works fine. So, it looks like an Office 365 Group is not usable for this. Is there anyone that has any suggestions how I can solve this? Creating a new Distribution Group and manage the members manually is not an option. I have tried to security enable the Azure Group, using the following command, but it didn't help. Set-AzureADGroup -ObjectId "270f9668..." -SecurityEnabled $True837Views0likes0Comments
Recent Blog Articles
No content to show