SharePoint Online – finding direct assignments

We have 600+ SharePoint sites and we are going to migrate them to an entirely new hybrid domain environment. We are currently attempting a configuration of a cross-tenant access scenario. I am attempting to find any users who have been directly assigned to any of our SharePoint sites. I don’t want to go user by user (3000+ users) to find direct assignments unless I absolutely have to. I would rather look at the sites and determine if a user is not assigned as a part of a group. So far I am not finding a SPO cmdlet that will identify the direct assigned users.

Has anyone done this before, and if so would you be willing to share your methods and experience? I can assign all of the current users/groups but would rather clean up before migrating the sites from the old tenant to the new tenant. I have successfully assigned my account in the new tenant as an #EXT user to an existing site in the old tenant. But we are wanting to avoid direct assignments it at all possible.

I am pulling the sites into a collection with Get-SPOSite, and users/groups for each site with Get-SPOUser. From there I need to identify direct assignments and that isn’t clear. TIA.

To find any users who have been directly assigned to any of the SharePoint sites, you can use the Get-SPOUser cmdlet to get a list of all users for each site, and then use the Get-SPOGroup cmdlet to get a list of all groups for each site. You can then compare the users against the members of each group to determine if any users are not assigned as part of a group. Here’s an example PowerShell script that should accomplish this:

$sites = Get-SPOSite
foreach ($site in $sites) {
    $users = Get-SPOUser -Site $site.Url
    $groups = Get-SPOGroup -Site $site.Url
    foreach ($user in $users) {
        $isAssigned = $false
        foreach ($group in $groups) {
            $members = Get-SPOGroup -Site $site.Url -Group $group.Title | Select-Object -ExpandProperty Users
            if ($members -contains $user.LoginName) {
                $isAssigned = $true
                break
            }
        }
        if (!$isAssigned) {
            Write-Output "User $($user.LoginName) is not assigned to a group on site $($site.Url)"
        }
    }
}

This script will loop through all SharePoint sites in your tenant, and for each site it will get a list of all users and groups. It will then loop through each user, and for each user it will loop through each group to see if the user is a member of that group. If the user is not a member of any group, it will output a message indicating that the user is not assigned to a group on that site.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật