Jump to content

Recommended Posts

Posted

Cool thing that I have done this week - migrated half of my users to OneDrive whilst still leaving legacy folder redirection in place.

Hopefully, some of my rambleings and thought processes can be of use to others.

 

Create a GPO that (i)

  • Creates an environment variable to the OneDrive folder (%userprofile%\OneDrive - \)
  • Sets the default location for the OneDrive folder
  • Redirect all libraries to %userprofile%\OneDrive - \

 

For testing, scope this to a test user.

Create a group containing your users that are using folder redirection - (Legacy Folder Redirection).

Change your existing redirection GPO to the above group.

 

This way, when your users are ready to be migrated, you remove them from the legacy group and they will pick up the OneDrive GPO.

 

You can then decide how you are going to handle file migration. My school was halfway there. Some users already had a folder called Documents. If I had migrated them there would be a risk of overwritting their files.

Our users' Desktop is outside of their HomeDirectory, so is difficult for them to get to. I decided to upload this for them.

 

There are multiple school's in our AD, they are split into seperate OUs and I want a way to split the migration up. PowerShell to the rescue...

The script will use Out-Grid to set up what to do.

  • Choose which school, or schools to migrate.
  • From that, pick up the distribution groups.
  • Then select the users.
  • Then chose which libraries we are to upload to OneDrive
  • Spit out a csv which can then be used in Microsoft's OneDrive SharePoint Migration Tool (If this is installed, there are PowerShell cmdlets available)

 

This wasnt intended to be shared, so has next to 0 commets. So a breif outline follows:

 

Check f the user has a home drive

Check if the user has been migrated - they'll be in the legacy group if not and remove them

Convert their UPN to their OneDrive url (https://-my.sharepoint.com/personal//)

Get the root location of their home drive - with out the trailing "My Documents"

Make their HomeDrive read only - disabled inheritance, removes Creator Owner and makes their permission read and execute. This way they can access their mapped home drive to upload any thing they are missing.

Skip the library if their libraries are nested (GPO says library follows the Documents folder), then dont upload them - you could move the libary then upload. Else they will end up with Pictures in their Documents library, rahter than in their Photos libary.

 

This is far from elegant and it takes time to run. I did look at using start-job, to manage theh inheritance bit, but I couldn't get it working and didnt want to rewrite the logic to split this out.

There's not many comments and variables that need to be edited are spready through out. I ahve changed the code to include some bits to help.

It assumes the legacy group exists

 

The only "destructive" bits are the inheritance/read only section and the remove from the legacy groups - easy to comment out.

 

GitHub Link

  • Thanks 2
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...