Friday, 14 February 2020

Provisioning OneDrive for new users.

Although you can create a student account in Office 365 and allocate OneDrive as a resource, behind the scenes the storage location is not actually assigned to the user account.

This normally occurs the first time the users tries to access or browse to their OneDrive which sometimes causes a noticeable delay before the site opens. For one off accounts this not too much of an issue but for a class groups in the first day of term it's not something you want to be dealing with.


In this situation it's a good idea to pre-provisioned OneDrive to improve the user experience and reduce the number of hands in the air.

First create a list of student accounts and save it as a file. For example a text file named users.txt that contains:

student1@myschool.net
student2@myschool.net
student3@myschool.net

Next run the PowerShell command Request-SPOPersonalSite  referencing the file you created.

$users = Get-Content -path "C:\users.txt" Request-SPOPersonalSite -UserEmails $users

That will kick off a background task to create the site for all accounts. If you are pre-provisioning OneDrive for a whole year group it might take up to 24 hours for the OneDrive locations to be created, so be patient or plan ahead,

Tuesday, 11 February 2020

Getting the Hardware ID for AutoPilot Enrolment.


If you have a new device its very easy to get the hardware information you need to enrol with Autopilot without going through the whole OOBE setup.




Start the device and wait a few second until the region selection page appears.

Press the following key combination SHIFT + F10

A CMD prompt will appear, type in PowerShell and hit Enter

The next step involves creating a local directory to store the information.

cd\
md scripts
cd scripts


You then need to set the execution level.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

At the command prompt run the following commands.

Save-Script -Name Get-WindowsAutoPilotInfo -Path c:\scripts

The NuGet provider is required for this action. Press Y and Enter. NuGet will be downloaded and installed.

If you run a listing on the directory again you'll see the script downloaded to the scripts folder.

Run the following command;

Get-WindowsAutoPilotInfo.ps1 -outputfile c:\scripts\intunehwid.csv

This writes the required data into the intunehwid.csv file. This file needs to be uploaded to InTune either using either the Windows Store or the Device Management portal.

If you are enrolling a number of devices it's probably a good idea to script the whole process and run it directly from the USB key, appending the output data to a file on the drive rather then saving locally.

After that run; shutdown /p

.. to turn off the device.