FastTrack/scripts/Delete-YammerUsers
Dean Cron 36a179f2da
Update README.md
Fixing a problem with the issues link
2024-07-19 09:16:49 -04:00
..
Delete-YammerUsers.ps1 Update Delete-YammerUsers.ps1 2023-11-28 13:57:19 -05:00
README.md Update README.md 2024-07-19 09:16:49 -04:00
UserIDSample.png Add files via upload 2023-11-28 13:55:44 -05:00

README.md

Microsoft FastTrack Open Source - Delete-YammerUsers

This sample script will allow a Yammer admin to bulk-delete Yammer users

Usage

Prerequisites

  • You must register an app and generate a bearer token (aka Developer Token) in your Yammer network for use with this script, youll need itfor the next step below. Detailed instructions on how to generate this can be found in step 2 here: https://techcommunity.microsoft.com/t5/yammer-developer/generating-an-administrator-token/m-p/97058

  • You'll need to create a CSV file containing one column:

    • UserID. This will contain the IDs of the users you want to delete.

    The CSV should look similar to this:

    CSV format

    You can get the user ID of the users you want to delete in one of two ways:

    1. Run a user export of all users. Settings-> Edit Network Admin Settings -> Export Users -> Export All Users. Grad the IDs of the users you want to delete from here and crearte a new CSV, placing those IDs in a column named UserID.
    2. If you're doing this pre-native mode migration, you can get the user IDs from the alignment report you're basing your cleanup on.

Variables

There are 3 variables you need to change in the script itself. These are located very early in the script just below “<############ STUFF YOU NEED TO MODIFY ############>”:

  1. $Global:YammerAuthToken = "BearerTokenString"

    Replace BearerTokenString with the token you created via the instructions in the prerequisites. The line should look something like this:

    $Global:YammerAuthToken = "21737620380-GFy6awIxfYGULlgZvf43A"

  2. $usersToBeDeletedCSV = 'C:\temp\userstobedeleted.csv'

    Point this to the userstobedeleted.csv file you created as mentioned above.

  3. $whatIfMode = $true

    The script runs in a WhatIf mode by default since user deletion cant be undone, so itll only loop through the CSV and tell you which users it would have deleted, it doesnt actually take hard action. When youre ready to have it actually delete users, change the value to $false

Parameters

None

Execution

Once youve completed the pre-reqs, youre ready to go. Run the script like so:

.\Delete-YammerUsers.ps1

Applies To

  • Yammer / Viva Engage networks in M365

Author

Author Original Publish Date
Dean Cron, Microsoft November 28th, 2023

Issues

Please report any issues you find to the issues list.

Support Statement

The scripts, samples, and tools made available through the FastTrack Open Source initiative are provided as-is. These resources are developed in partnership with the community and do not represent official Microsoft software. As such, support is not available through premier or other Microsoft support channels. If you find an issue or have questions please reach out through the issues list and we'll do our best to assist, however there is no associated SLA.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the MIT License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents,or trademarks, whether by implication, estoppel or otherwise.