If my account is deleted, will my office scripts within a Teams team also be deleted?

Jesus David Marquez 20 Reputation points
2025-08-20T14:38:21.1033333+00:00

I've created multiple Office scripts for my organization, and I've shared these scripts with a Teams team.

If my account is deleted, will these scripts on this site also be deleted?

And if they are deleted, how can I prevent the scripts from being deleted if my account is deleted?

Microsoft 365 and Office | Development | Office JavaScript API
0 comments No comments
{count} votes

Accepted answer
  1. Gabriel-N 4,645 Reputation points Microsoft External Staff Moderator
    2025-08-21T01:49:08.55+00:00

    Hi Jesus David Marquez

    Thanks for reaching Q7A Forum with your question about Office Scripts and account deletion.

    Based on my research and official Microsoft documentations, Office Scripts are typically stored in your OneDrive under /Documents/Office Scripts/. If your account is deleted, your OneDrive is also removed and that means any scripts stored there will be lost, even if they were shared with a Teams team. However, if you transfer your scripts to a SharePoint site associated with your Teams team, they become team-owned and follow SharePoint’s retention policies, which are more resilient to account changes. You might check that you store it in the right place, or if it's not, you can move it to a SharePoint folder.

    If account deletion is planned and you still have access, you can manually transfer the owner scripts to another user or to SharePoint. Additionally, Microsoft documentation mentions that admins can temporarily restore a deleted user's OneDrive and transfer script files to another user or to SharePoint.

    For long-term script management, some organizations use a dedicated service account to create and manage shared scripts. This helps avoid the risk of losing scripts when individual accounts are deleted and could be a good preventive step for your team.

    Here are some official documents that provide deeper insight:

    Hope this information is helpful for your case.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.