sharepoint modern team site
6 TopicsRetrieving SharePoint Site Visitors Using PowerShell Script
I’m working on a PowerShell script to generate a report of Microsoft Teams details, including the owners, members, and SharePoint site visitors. While the script successfully retrieves most of the information, it fails to retrieve the site visitors, which I can clearly see in the SharePoint Admin Center. Issues: Site Visitors Not Retrieved: Despite having site visitors visible in the SharePoint Admin Center, the script returns "Error retrieving Visitors" or an empty string for site visitors. Potential Errors: I'm using a try-catch block to handle exceptions, but it seems like there are no errors being caught that could indicate why the visitors aren't being retrieved. What I’ve Tried: Ensured the SharePoint site URL is correct. Checked permissions and roles for the account running the script. Request: Could someone help identify what might be going wrong or suggest a different approach to reliably retrieve the list of SharePoint site visitors or any module I am missing on? I am using below modules with Powershell Runtime version 5.1. ExchangeOnlineManagement - Version 3.5.1 Get-MsolUserLicences - Version 0.0.8 Microsoft.Graph.Authentication - Version 2.20.0 Microsoft.Graph.Teams - Version 2.20.0 Microsoft.Graph.Users - Version 2.20.0 Microsoft.Online.SharePoint.PowerShell - Version 16.0.25012.12000 MicrosoftTeams - Version 6.4.0 MSOnline - Version 1.1.183.81 PackageManagement - Version 1.4.8.1 PnP.PowerShell - Version 2.5.0 PowerShellGet - Version 2.2.5 SharePointPnPPowerShellOnline - Version 3.29.2101.0 Any insights or recommendations would be greatly appreciated! Thanks in advance for your help. Connect-MicrosoftTeams -Credential $UserCredential -AccountId $myCredential.UserName Connect-ExchangeOnline -Credential $UserCredential -ShowProgress $true Connect-SPOService -Url "https://domain-admin.sharepoint.com # Initialize an empty array to store the results $Result = @() # Get all Teams enabled groups $AllTeamsInOrg = Get-Team $Teamcount = $AllTeamsInOrg.Count foreach ($Team in $AllTeamsInOrg) { Write-Host "Processing Team $($Team.DisplayName) ..." -NoNewline -ForegroundColor Gray $TeamName = $Team.DisplayName $TeamGroupId = $Team.GroupId # Get team details $TeamOwner = (Get-TeamUser -GroupId $TeamGroupId -Role Owner).User $TeamUserCount = (Get-TeamUser -GroupId $TeamGroupId).Count $TeamGuest = (Get-TeamUser -GroupId $TeamGroupId -Role Guest).Name if ($TeamGuest -eq $null) { $TeamGuest = "No Guests in Team" } $TeamMembers = (Get-TeamUser -GroupId $TeamGroupId -Role Member).User $TeamChannels = (Get-TeamChannel -GroupId $TeamGroupId).DisplayName $ChannelCount = (Get-TeamChannel -GroupId $TeamGroupId).Count # Retrieve SharePoint site URL from the team $TeamGroup = Get-UnifiedGroup -Identity $TeamGroupId $SharePointSiteURL = $TeamGroup.SharePointSiteURL if ($SharePointSiteURL -ne $null) { try { # Get all SharePoint Online groups for the site $SiteGroups = Get-SPOSiteGroup -Site $SharePointSiteURL # Find the "Visitors" group and get its members $VisitorsGroup = $SiteGroups | Where-Object { $_.Title -eq "Visitors" } if ($VisitorsGroup) { $Visitors = Get-SPOSiteGroup -Site $SharePointSiteURL -Group $VisitorsGroup.Title | Select-Object -ExpandProperty Users $VisitorsEmails = $Visitors | Select-Object -ExpandProperty Email -join ", " $GroupsData += [pscustomobject]@{ 'Site URL' = $SharePointSiteURL 'Group Name' = $VisitorsGroup.Title 'Users' = $VisitorsEmails } } else { $GroupsData += [pscustomobject]@{ 'Site URL' = $SharePointSiteURL 'Group Name' = "Visitors" 'Users' = "No Visitors Group Found" } } } catch { Write-Host "Error processing site ${SharePointSiteURL}: $($_.Exception.Message)" -ForegroundColor Red $GroupsData += [pscustomobject]@{ 'Site URL' = $SharePointSiteURL 'Group Name' = "Visitors" 'Users' = "Access Denied or Error" } } } else { $GroupsData += [pscustomobject]@{ 'Site URL' = $SharePointSiteURL 'Group Name' = "Visitors" 'Users' = "No SharePoint Site URL" } } # Add team details to the $Result array $Result += [PSCustomObject]@{ TeamName = $TeamName TeamOwners = $TeamOwner -join ', ' TeamMemberCount = $TeamUserCount TeamMembers = $TeamMembers -join ', ' NoOfChannels = $ChannelCount ChannelNames = $TeamChannels -join ', ' SharePointSite = $SharePointSiteURL AccessType = $TeamGroup.AccessType TeamGuests = $TeamGuest -join ',' SharePointSiteVisitors = $SharePointSiteVisitors } Write-Host "done." -ForegroundColor Green }1.4KViews0likes0CommentsWhat is the best way to migrate content from Mediawiki to SharePoint modern sites
My question might seem way too generic but I am trying to start somewhere We have some content in Mediawiki CMS/Server, and we are trying to migrate this content to our modern SharePoint site What is the best and the most optimal way to do it? We did try a product called Metalogic, but that product is not perfect and has some limitations as it migrates to classic SharePoint sites, not modern We did consider the ShareGate tools, but those tools have some limitations as well Would anyone recommend a most optimal approach to resolve this task? Thank you everyone in advance15KViews2likes13CommentsMega Menu issues - duplication of menu
I was making some changes to our mega menu (in a Team Site not associated with Office 365) and somehow have managed to duplicate the entire menu, which becomes visible only when hovering over one of the options. I can see no way to roll back to an earlier version of the menu to try and correct the fault and when I edit the mega menu options there's no duplication to be seen... Can anyone suggest any fixes?1.3KViews0likes2CommentsIs the SharePoint created in MS Teams replacing the Classic Office 365 SharePoint Teams site?
Hi All, I am confused with what SharePoint site I should recommended for our company. What is the difference with the SharePoint site generated by Microsoft Teams (https://teams.microsoft.com/) and the classic SharePoint Online created in the Office 365 SharePoint Admin Centre (https://portal.office.com/adminportal/)? Is the SharePoint created in MS Teams replacing the Classic Office 365 SharePoint Teams site? What are the differences? Does anyone have a video that clearly highlights the difference with the two SharePoint environments? I hope you can helpSolved5.6KViews0likes6CommentsHow do you add a List Template to the Apps Gallery for all Modern Team sites that are created?
I have several custom project list that are typically used for all project and I want to have these available for staff to be able to add in each Modern Team Site that is created automatically when a new Planner is created. These lists are available for people to choose when they create a classic Team site, but I have not found a way to add them to the Modern Team sites apps gallery. Does anyone know a way to accomplish this?1.9KViews0likes3Comments