Get-SPOSite

Nani Ramos 1 Reputation point
2022-11-26T23:32:12.103+00:00

Would like to filter all site collection owners using WorkEmail instead of UPN. Is this possible? Can I also filter owners of all site collections that owners are M365 group? TIA!

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,297 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,270 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,897 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Haoyan Xue_MSFT 22,381 Reputation points Microsoft Vendor
    2022-11-28T07:22:10.82+00:00

    Hi @Nani Ramos ,

    1. In Office 365/SharePoint Online, the user's account(UPN) is their email address. Cannot be filtered directly through WorkEmail.
      Powershell to filter all site collection owners: $AdminCenterURL = "https://domain-admin.sharepoint.com/"
      $user="xyza@keyman .onmicrosoft.com" #Connect to SharePoint Online
      Connect-SPOService -url $AdminCenterURL -Credential (Get-Credential)
      #Get Site owners of all site collections
      Get-SPOSite -Filter "Owner -like '$($user)'" | Select URL, Owner

    264616-image.png
    2.After my internal and external search and testing, could not achieve filter owners of all site collections that owners are M365 group.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.