Home > Appendices > Remove the Service Account
Export to PDFTo remove the service account from the Team/Group/channel owner using PowerShell, refer to the following steps:
Prepare a CSV file and configure a column named Source Mailbox.
In the Source Mailbox column, configure the email addresses of the Teams from which you want to remove the owner role.
Click to download the AddTeamOwner.ps1 file to your server.
Install the Exchange Online PowerShell V3 module to the server where you will run the AddTeamOwner.ps1 file. Refer to for details.
Connect the Exchange Online PowerShell V3 module to Exchange Online. Refer to for details.
Right-click the AddTeamOwner.ps1 file and select Run with PowerShell.
Enter your credentials, and click OK to open the PowerShell window.
Enter the email address of the service account that you want to remove from the configured Teams, and press Enter on the keyboard.
Enter the full path of the CSV file configured in steps 1 and 2, and press Enter on the keyboard.
If you want to remove the service account’s owner role from the Teams, enter N. Press Enter on the keyboard.
To add the owner role to the service account back, enter Y. Press Enter on the keyboard.