How to Find Teams Channels With a Wiki Tab

Preparing for Teams Wiki to Move to OneNote

Updated 26 January 2023

In July 2022, Microsoft announced that they would stop the automatic provisioning of a wiki tab for new Teams channels. On 11 January 2023, Microsoft followed up with news of the retirement of the Teams wiki app in February 2023 (MC496248). OneNote is the replacement app and Microsoft plans to deliver an app to migrate wiki content to OneNote notebooks stored in SharePoint Online. The wiki content is already in SharePoint Online, so the migration moves whatever’s in the wiki to the default shared OneNote notebook. Once the migration finishes, Teams locks the wiki, and users work with OneNote from that point.

The migration app is due to roll out in mid-February. Eventually, Microsoft plans to remove the wiki app and tab from Teams.

The Need to Find Wikis

The reaction to Microsoft’s announcement has been positive. OneNote is a more functional application, and the Teams wiki never found much favor with customers. Although the change is good, some up-front work is necessary to prepare for the transition. One obvious question is what Teams channels have a wiki. The natural follow-up is to ask if any wikis contain something worth migrating.

Assessing the worth and importance of wiki content is not something that’s easy to automate. You could scan the SharePoint Online site and examine the date of the latest update for the wiki files to conclude if the wiki is active. Measuring what might be in the wiki is another matter. Beauty is very much in the eye of the beholder and what appears to be someone else’s rubbish might be critically important to them. But we can discover which Teams channels have wiki tabs and report that data to use as a guide to wiki migration.

Several years ago, I wrote a PowerShell script that uses Graph API requests to report the tabs and applications used by Teams channels. I took the code and amended it to generate a wiki report and replaced the Graph API requests with cmdlets from the Microsoft Graph PowerShell SDK to allow the script to run without needing to create a registered Azure AD app. Of course, if you want to, you can amend the original code and run it with a registered app. That’s an exercise for the reader.

Graph Documentation Improvements

Apart from not needing a registered app, using the Microsoft Graph PowerShell SDK illustrates how broadly the SDK extends. Microsoft is gradually updating Graph documentation to include PowerShell examples that feature SDK cmdlets. For instance, the Get channel API returns details of a channel in a team. Its examples include how to use the Get-MgTeamChannel cmdlet.

Another piece of essential information found in the Graph documentation is the application permission needed to run a request (or its matching cmdlet), like the ChannelSettings.Read.All permission needed to fetch channel settings. See this article for more information about figuring out Graph permissions.

Generating a Teams Channels with Wiki Report

Getting back to finding Teams wikis, the steps are simple:

  • Find all teams with the Get-MgTeam cmdlet. It’s critical to use the Select-MgProfile cmdlet to attach to the Graph beta endpoint because Get-MgTeam doesn’t support fetching all teams with the V1.0 endpoint.
  • For each team, find all channels with the Get-MgTeamChannel cmdlet.
  • For each channel, examine the tabs with the Get-TeamChannelTab cmdlet and collect information.
  • Examine each tab. If it’s a wiki tab, fetch details of the tab using some data exposed by the Get Tab Graph API (using the Get-MgTeamChannelTab cmdlet). For most wiki tabs, this returns a configuration property that holds a ‘hasContent’ value if anyone has edited the wiki. Some older wiki tabs don’t return a configuration property.
  • For wiki tabs with content, find the team owners because they are the best people to check the wiki to decide if it should be migrated to OneNote.
  • Generate the report of Teams wikis for checking. Figure 1 shows the output from the PowerShell list, which the code also saves to a CSV file. If you want something nicer, consider exporting to an Excel worksheet.

The script I used to create the report shown in Figure 1 is available from GitHub. Use the latest version from 26 January 2023 or later.

Figure 1: Reporting Teams channels with a wiki tab

The script is pure PowerShell so it’s easy to change to meet individual requirements. Have fun tracking down those pesky Wikis!


Make sure that you’re not surprised about changes that appear inside Office 365 applications by subscribing to the Office 365 for IT Pros eBook. Our monthly updates make sure that our subscribers stay informed.

40 Replies to “How to Find Teams Channels With a Wiki Tab”

  1. Tx for sharing above interesting & valuable resources.
    Is there a command/method to verify if there’s any content stored/entered on the Wiki tabs?

    1. This is one of those things that is technically possible but not worthwhile. You could find the files in SharePoint, but how could you assess the worth of their content?

      1. Our objective is to inform the business user community (espcially those who’ve put info on Wikis) about the upcoming change to OneNote (or will Wikis users (Team owners/members) be informed automaticaly?

    2. Using GraphAPI I notice that each Wiki Tab has a property ‘hasContent’ which is equals false in case nothing is entered on that page.

      1. That’s no indication of whether the content is valuable. It might help you understand which wikis to check, but someone who knows the content still needs to validate it.

      2. Hi Eric, I’ve been playing with the wiki hascontent configuration and found that not all wikis have the information and in some cases (older channels) it is blank. But it might be a good thing to check and I am updating the script so that people have a chance to use the information. Thanks for pointing it out…

  2. Tony, I’m getting the following error when running your script:

    PS C:\Windows\System32> .\wiki.ps1
    Welcome To Microsoft Graph!
    Finding Teams
    Get-MgTeam : Requested API is not supported. Please check the path.
    At C:\Windows\System32\wiki.ps1:9 char:1
    + [array]$Teams = Get-MgTeam -All
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: ({ Top = , Skip …ndProperty = }:f__AnonymousType29`8) [Get-MgTeam_List], RestException`1
    + FullyQualifiedErrorId : NotFound,Microsoft.Graph.PowerShell.Cmdlets.GetMgTeam_List
    For some reason, I can’t find any Teams… exiting…

    1. Make sure that you’re connected to the beta endpoint.

      Select-MgProfile Beta

      It’s in the script now. I omitted the line when cutting and pasting into GitHub.

      1. Hi Tony
        I’m confused, every method i try to run this very needed script (thank you) just returns
        PS C:\support\scripts> Select-MgProfile Beta
        Select-MgProfile : The term ‘Select-MgProfile’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or
        if a path was included, verify that the path is correct and try again

        I assume I’m missing a module i need to load or something, but don’t know which one… yet??
        James

      2. I get the same with the connect command
        Connect-MgGraph : The term ‘Connect-MgGraph’ is not recognized as the name of a cmdlet etc etc

  3. Hi Tony, tx for updating the script 👍🙏💪 > great help. In the mean time I used Power Automate w/t same instructions/methods as in your script to compile a list of Channels & Wiki tabs , possible having (useful) content and owners to inform🙂

  4. Hi!
    I’am having some problems running the script.
    I’ve tried different versions of Microsoft.Graph module but with no luck.
    If I run (Get-Command Get-MgTeam).parameters I cannot se the -All parameter.

    I’ve tried both with and without MgProfile Beta.

    Error Message:
    Get-MgTeam : A parameter cannot be found that matches parameter name ‘All’.
    At C:\temp\FindTeamChannelsWithWiki.PS1:21 char:28
    + [array]$Teams = Get-MgTeam -All
    + ~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-MgTeam], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Get-MgTeam

  5. Just tried running it and I got “For some reason, I can’t find any Teams…” message. Did I miss configuring something?

  6. I ran the script against my test tenant and everything worked great. Now, I want to run the script against my production tenant but it automatically connects to my test tenant. I have closed out of PS and ended all PS sessions. Am I doing somthing wrong?

  7. Thanks for writing this, really interesting. What happens if a company decides not to do anything I assume the wiki feature will stay in SharePoint and users can continue to use it from within SharePoint?

  8. Are wiki’s in Teams Meeting notes impacted by this? If so, is there a way to search for those as well.

  9. I ran the script but it gave an error on most of the Teams saying Forbidden,Microsoft.graph.PowerShell.Cmdlets.GetMGTeamChannel_List3

    I am a Teams admin

    It did return the Teams that I am a member/owner of.

    1. The clue is the word forbidden. Your connection to the Graph doesn’t have the necessary permissions to allow the Get-MgTeamChannelTab cmdlet to run.

      1. Thanks, I disconnected and reauthenticated and was able to run the script…thanks!

  10. Hi Tony
    Thank you for the script very helpful.
    Is there way to get the last modified date on the Wiki tabs?

    1. No. The only date stored is the created date (add $TabData.Configuration.AdditionalProperties.dateAdded to the fields reported if you want this information)

  11. Is there a way to generate a similar list but for sites that have setup a OneNote tab? We want to monitor our sites and see which team leads have converted their wikis to OneNote and I can’t seem to find a way to do that.

  12. Possible to add a check to see if the wiki is marked read only (i.e. it’s already been converted to Notes)?

    1. Doesn’t appear so. The data returned for a wiki doesn’t show anything that indicates it is read only:

      $TabData.Configuration.AdditionalProperties | fl

      Key : wikiTabId@odata.type
      Value : #Int64

      Key : wikiTabId
      Value : 1

      Key : wikiDefaultTab
      Value : True

      Key : hasContent
      Value : True

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.