Saturday, March 11, 2017

How to Increase the OneDrive for Business retention and deletion from 30days to 3650days (10 Years)

    I am sure we may have come across this scenario were the customer wants more than 30Day for deleted user OneDrive for Business. The OneDrive Clean Up Job runs, and the user profile is marked for deletion. The profile will be preserved in the database in a deleted state. The default retention period is 30 days but this value can be modified by using the -OrphanedPersonalSitesRetentionPeriod parameter for the Set-SPOTenant cmdlet in the SharePoint Online Management Shell.   


    • From the Start button, choose All Programs, search for SharePoint Online Management Shell  and then Right click on "SharePoint Online Management Shell" and select run as an administrator

    • Run Connect-SPOService. For example, type this command at the prompt:
    For e.g. Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.onmicrosoft.com  (Press Enter)
    Where URL is the URL of the SharePoint Online Administration Center
    Credential is the user name for Global admin

    • Run the Below Command
    Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod 3650   (Press Enter)

    • Once you press the enter button  you will get the message
    Are you sure you want to perform this action?
    This will update the Retention Policy for All Orphaned OneDrive for Business sites.

    • Click  on "Yes" to update the  update the Retention Policy for All Orphaned OneDrive for Business sites.
    Run the Below Command
    Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod 3650   (Press Enter)

    • Once you press the enter button  you will get the message
    Are you sure you want to perform this action?
    This will update the Retention Policy for All Orphaned OneDrive for Business sites.

    Click  on "Yes" to update the  update the Retention Policy for All Orphaned OneDrive for Business sites.

How to redirect your site collection from one site collection to another

If you would like to redirect your site collection from https://abc.sharepoint.com to https://xyz.sharepoint.com
1. Go to A site collection
2. Edit Page
3. Insert > Web Part
4. Under Media and Content > click on Script Editor > Add
5. Select Script Editor Web Part > click on Web Part Tab > Web Part Properties
6. In web part > click on Edit Snippet
7. Paste the below script

<script '"text/javascript"'>//<![CDATA[alert("This site has been moved to New site. Please check it out . You will be redirected within 5 second.");//]]></script> 

<meta http-equiv="refresh" content="5;url=https://xyz.sharepoint.com">

Search Box