Home > Appendices > Tools for Teams Chat Migration > Tool to Hide Chats from Users

    Export to PDF

    Tool to Hide Chats from Users

    If you have mapped your source chat members to unexpected destination users, and do not want to those destination users see the destination chats and chat messages, you can refer to the following steps hide the destination chats and chat messages from specific destination users:

    1. Scan the source chats to identify where the source chat members of those destination users reside by completing the following steps:

      1. Create a custom app in source tenant and add the following permissions to the app.
    APIPermissionTypeDescription
    Microsoft GraphUser.Read.AllApplicationRetrieve information of chat user profiles. 
    Microsoft GraphChat.ReadBasic.AllApplicationRetrieve chat information.
    Microsoft GraphChatMember.Read.AllApplicationRetrieve chat users.
    1. Access the and download the **ChatScanTool.zip** file. 2. Extract the ZIP file to a location with a network connection. 3. Create a CSV file in the extracted folder, and name the file as **Users**. 4. In each row of the CSV file, enter the username of source chat members whose chats you want to scan. ![The CSV file.](/en/fly-user-guide/appendices/tools-for-teams-chat-migration/images/image814.png "The CSV file.") 5. In the extracted tool folder, locate the **ChatScanTool.exe.config** configuration file and open it with Notepad. 6. In the configuration file, configure the tenant ID, csv file path of the user list, and the app ID and secret key of the custom app you create in step **a**. ![The configuration file.](/en/fly-user-guide/appendices/tools-for-teams-chat-migration/images/image815.png "The configuration file.") 7. Create a **Reports** folder in the extracted folder. 8. Double-click the **ChatScanTool.exe** application file to scan the chats of the configured users. After the scan is finished, a report file with the scanned source chats will be generated in the **Reports** folder.
    1. Hide the chats from those destination users by completing the following steps:

      1. Access the and download the LeaveAndHideChats.zip file.

      2. Extract the ZIP file to a location with a network connection.

      3. Run the Consent User.ps1 file with Windows PowerShell to consent required permissions.

      4. On the sign-in page, sign in using a Global Administrator of the destination tenant.

        The the sign-in page.

      5. Select the Consent on behalf of your organization option, and click Accept to consent permissions to users of your organization.

      6. In the extracted folder, create a CSV file and name it as Chats.

      7. According to the source chat IDs scanned in step 1 > i, find the corresponding destination chat IDs in your migration job report.

      8. Migration job report.

      9. Copy the IDs of destination chats that you want to hide from those destination users to the Chats.csv file.

        Chats.csv file

      10. Ask those destination users for which you want to hide the destination chats to run the TeamChatData.ps1 file with Windows PowerShell, and sign in with their credentials.

        TeamChatData.ps1 file

        After the job is finished, the chats will be hidden from those destination users. A report file with the hidden results will be generated in the tool folder.

    2. To migrate the chats to desired destination chat members, update the user mappings to map source chat members to the destination users, and rerun the migration job.