Skip to content

Commit 10e79bb

Browse files
authored
Merge pull request #97031 from EMaher/enewman/prep-windows-class
Adding How To: Prepare Classes that use Windows
2 parents ddc9296 + 1a1fe0c commit 10e79bb

File tree

2 files changed

+233
-0
lines changed

2 files changed

+233
-0
lines changed

articles/lab-services/classroom-labs/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
href: how-to-enable-remote-desktop-linux.md
7373
- name: Enable nested virtualization on a template VM
7474
href: how-to-enable-nested-virtualization-template-vm.md
75+
- name: Prepare a Windows template VM
76+
href: how-to-prepare-windows-template.md
7577
- name: Connect to VMs in classroom labs (student)
7678
items:
7779
- name: Access classroom labs
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
---
2+
title: Guide to setting up a Windows template machine | Microsoft Docs
3+
description: Generic steps to prepare a Windows template machine in Lab Services. These steps include setting Windows Update schedule, installing OneDrive, and installing Office.
4+
services: lab-services
5+
documentationcenter: na
6+
author: EMaher
7+
manager:
8+
editor: ''
9+
10+
ms.service: lab-services
11+
ms.topic: article
12+
ms.date: 11/21/2019
13+
ms.author: enewman
14+
---
15+
# Guide to setting up a Windows template machine in Azure Lab Services
16+
17+
If you’re setting up a Windows 10 template machine for Azure Lab Services, here are some best practices and tips to consider. The configuration steps below are all optional. However, these preparatory steps could help make your students be more productive, minimize class time interruptions, and ensure that they're using the latest technologies.
18+
19+
>[!IMPORTANT]
20+
>This article contains PowerShell snippets to streamline the machine template modification process. For all the PowerShell scripts shown, you’ll want to run them in Windows PowerShell with administrator privileges. In Windows 10, a quick way of doing that is to right-click the Start Menu and choose the "Windows PowerShell (Admin)".
21+
22+
## Install and configure OneDrive
23+
24+
To protect student data from being lost if a virtual machine is reset, we recommend students back their data up to the cloud. Microsoft OneDrive can help students protect their data.
25+
26+
### Install OneDrive
27+
28+
To manually download and install OneDrive, see the [OneDrive](https://onedrive.live.com/about/download/) or [OneDrive for Business](https://onedrive.live.com/about/business/) download pages.
29+
30+
You can also use the following PowerShell script. It will automatically download and install the latest version of OneDrive. Once the OneDrive client is installed, run the installer. In our example, we use the `/allUsers` switch to install OneDrive for all users on the machine. We also use the `/silent` switch to silently install OneDrive.
31+
32+
```powershell
33+
Write-Host "Downloading OneDrive Client..."
34+
$DownloadPath = "$env:USERPROFILE/Downloads/OneDriveSetup.exe"
35+
if((Test-Path $DownloadPath) -eq $False )
36+
{
37+
Write-Host "Downloading OneDrive..."
38+
$web = new-object System.Net.WebClient
39+
$web.DownloadFile("https://go.microsoft.com/fwlink/p/?LinkId=248256",$DownloadPath)
40+
} else {
41+
Write-Host "OneDrive installer already exists at " $DownloadPath
42+
}
43+
44+
Write-Host "Installing OneDrive..."
45+
& $env:USERPROFILE/Downloads/OneDriveSetup.exe /allUsers /silent
46+
```
47+
48+
### OneDrive customizations
49+
50+
There are many [customizations that can be done to OneDrive](https://docs.microsoft.com/onedrive/use-group-policy). Let's cover some of the more common customizations.
51+
52+
#### Silently move Windows known folders to OneDrive
53+
54+
Folders like Documents, Downloads, and Pictures are often used to store student files. To ensure these folders are backed up into OneDrive, we recommend you move these folders to OneDrive.
55+
56+
If you are on a machine that is not using Active Directory, users can manually move those folders to OneDrive once they authenticate to OneDrive.
57+
58+
1. Open File Explorer
59+
2. Right-click the Documents, Downloads, or Pictures folder.
60+
3. Go to Properties > Location. Move the folder to a new folder on the OneDrive directory.
61+
62+
If your virtual machine is connected to Active Directory, you can set the template machine to automatically prompt your students to move the known folders to OneDrive.
63+
64+
You’ll need to retrieve your Office Tenant ID first. For further instructions, see [find your Office 365 Tenant ID](https://docs.microsoft.com/onedrive/find-your-office-365-tenant-id). You can also get the Office 365 Tenant ID by using the following PowerShell.
65+
66+
```powershell
67+
Install-Module MSOnline -Confirm
68+
Connect-MsolService
69+
$officeTenantID = Get-MSOLCompanyInformation |
70+
Select-Object -expand objectID |
71+
Select-Object -expand Guid
72+
```
73+
74+
Once you have your Office 365 Tenant ID, set OneDrive to prompt to move known folders to OneDrive using the following PowerShell.
75+
76+
```powershell
77+
if ($officeTenantID -eq $null)
78+
{
79+
Write-Error "Variable `$officeTenantId must be set to your Office Tenant Id before continuing."
80+
}
81+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
82+
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
83+
-Name "KFMSilentOptIn" -Value $officeTenantID -PropertyType STRING
84+
```
85+
86+
### Use OneDrive files on-demand
87+
88+
Students might have many files within their OneDrive accounts. To help save space on the machine and reduce download time, we recommend making all the files stored in student's OneDrive account be on-demand. On-demand files only download once a user accesses the file.
89+
90+
```powershell
91+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive" -Force
92+
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
93+
-Name "FilesOnDemandEnabled" -Value "00000001" -PropertyType DWORD
94+
```
95+
96+
### Silently sign in users to OneDrive
97+
98+
OneDrive can be set to automatically sign in with the Windows credentials of the logged on user. Automatic sign-in is useful for classes where the student signs in with their Office 365 school credentials.
99+
100+
```powershell
101+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
102+
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
103+
-Name "SilentAccountConfig" -Value "00000001" -PropertyType DWORD
104+
```
105+
106+
### Disable the tutorial that appears at the end of OneDrive setup
107+
108+
This setting lets you prevent the tutorial from launching in a web browser at the end of OneDrive Setup.
109+
110+
```powershell
111+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive" -Force
112+
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
113+
-Name "DisableTutorial" -Value "00000001" -PropertyType DWORD -Force
114+
```
115+
116+
### Set the maximum size of a file that to be download automatically
117+
118+
This setting is used in conjunction with Silently sign in users to the OneDrive sync client with their Windows credentials on devices that don't have OneDrive Files On-Demand enabled. Any user who has a OneDrive that's larger than the specified threshold (in MB) will be prompted to choose the folders they want to sync before the OneDrive sync client (OneDrive.exe) downloads the files. In our example, "1111-2222-3333-4444" is the Office 365 tenant ID and 0005000 sets a threshold of 5 GB.
119+
120+
```powershell
121+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
122+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\DiskSpaceCheckThresholdMB"
123+
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\DiskSpaceCheckThresholdMB"
124+
-Name "1111-2222-3333-4444" -Value "0005000" -PropertyType DWORD
125+
```
126+
127+
## Install and configure Microsoft Office 365
128+
129+
### Install Microsoft Office 365
130+
131+
If your template machine needs Office, we recommend installation of Office through the [Office Deployment Tool (ODT)](https://www.microsoft.com/download/details.aspx?id=49117 ). You will need to create a reusable configuration file using the [Office 365 Client Configuration Service](https://config.office.com/) to choose which architecture, what features you’ll need from Office, and how often it updates.
132+
133+
1. Go to [Office 365 Client Configuration Service](https://config.office.com/) and download your own configuration file.
134+
2. Download [Office Deployment Tool](https://www.microsoft.com/download/details.aspx?id=49117). Downloaded file will be `setup.exe`.
135+
3. Run `setup.exe /download configuration.xml` to download Office components.
136+
4. Run `setup.exe /configure configuration.xml` to install Office components.
137+
138+
### Change the Microsoft Office 365 update channel
139+
140+
Using the Office Configuration Tool, you can set how often Office receives updates. However, if you need to modify how often Office receives updates after installation, you can change the update channel url. Update channel url addresses can be found at [change the update channel after you enable Office 365 clients to receive updates from Configuration Manager](https://docs.microsoft.com/sccm/sum/deploy-use/manage-office-365-proplus-updates#change-the-update-channel-after-you-enable-office-365-clients-to-receive-updates-from-configuration-manager). The example below shows how to set Office 365 to use the Monthly Update Channel.
141+
142+
```powershell
143+
# Update to the Office 365 Monthly Channel
144+
Set-ItemProperty
145+
-Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration\CDNBaseUrl"
146+
-Name "CDNBaseUrl"
147+
-Value "http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60"
148+
```
149+
150+
## Install and configure Updates
151+
152+
### Install the latest Windows Updates
153+
154+
We recommend that you install the latest Microsoft updates on the template machine for security purposes before publishing the template VM. It also potentially avoids students from being disrupted in their work when updates run at unexpected times.
155+
156+
1. Launch **Settings** from the Start Menu
157+
2. Click on **Update** & Security
158+
3. Click **Check for updates**
159+
4. Updates will download and install.
160+
161+
You can also use PowerShell to update the template machine.
162+
163+
```powershell
164+
Set-ExecutionPolicy Bypass -Scope Process -Force
165+
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm
166+
Install-Module PSWindowsUpdate -Confirm
167+
Install-WindowsUpdate -MicrosoftUpdate
168+
Set-ExecutionPolicy default -Force
169+
```
170+
171+
>[!NOTE]
172+
>Some updates may require the machine to be restarted. You'll be prompted if a reboot is required.
173+
174+
### Install the latest updates for Microsoft Store apps
175+
176+
We recommend having all Microsoft Store apps be updated to their latest versions. Here are instructions to manually update applications from the Microsoft Store.
177+
178+
1. Launch **Microsoft Store** application.
179+
2. Click the ellipse (…) next to your user photo in the top corner of the application.
180+
3. Select **Download** and updates from the drop-down menu.
181+
4. Click **Get update** button.
182+
183+
You can also use Powershell to update Microsoft Store applications that are already installed.
184+
185+
```powershell
186+
(Get-WmiObject -Namespace "root\cimv2\mdm\dmmap" -Class "MDM_EnterpriseModernAppManagement_AppManagement01").UpdateScanMethod()
187+
```
188+
189+
### Stop automatic Windows Updates
190+
191+
After updating Windows to the latest version, you might consider stopping Windows Updates. Automatic updates could potentially interfere with scheduled class time. If your course is a longer running one, consider asking students to manually check for updates or setting automatic updates for a time outside of scheduled class hours. For more information about customization options for Windows Update, see the [manage additional Windows Update settings](https://docs.microsoft.com/windows/deployment/update/waas-wu-settings).
192+
193+
Automatic Windows Updates may be stopped using the following PowerShell script.
194+
195+
```powershell
196+
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AU"
197+
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AU"
198+
-Name "NoAutoUpdate" -Value "1" -PropertyType DWORD
199+
```
200+
201+
## Install foreign language packs
202+
203+
If you need additional languages installed on the virtual machine, you can add them through the Microsoft Store.
204+
205+
1. Launch Microsoft Store
206+
2. Search for “language pack”
207+
3. Choose language to install
208+
209+
If you are already logged on to the template VM, use ["Install language pack" shortcut](ms-settings:regionlanguage?activationSource=SMC-IA-4027670) to go directly to the appropriate settings page.
210+
211+
## Remove unneeded built-in apps
212+
213+
Windows 10 comes with many built-in applications that might not be needed for your particular class. To simplify the machine image for students, you might want to uninstall some applications from your template machine. To see a list of installed applications, use the PowerShell `Get-AppxPackage` cmdlet. The example below shows all installed applications that can be removed.
214+
215+
```powershell
216+
Get-AppxPackage | Where {$_.NonRemovable -eq $false} | select Name
217+
```
218+
219+
To remove an application, use the Remove-Appx cmdlet. The example below shows how to remove everything XBox related.
220+
221+
```powershell
222+
Get-AppxPackage -Name *xbox* | foreach { if (-not $_.NonRemovable) { Remove-AppxPackage $_} }
223+
```
224+
225+
## Install common teaching-related applications
226+
227+
Install other apps commonly used for teaching through the Windows Store app. Suggestions include applications like [Microsoft Whiteboard app](https://www.microsoft.com/store/productId/9MSPC6MP8FM4), [Microsoft Teams](https://www.microsoft.com/store/productId/9MSPC6MP8FM4), and [Minecraft Education Edition](https://education.minecraft.net/). These applications must be installed manually through the Windows Store or through their respective websites on the template VM.
228+
229+
## Conclusion
230+
231+
This article has shown you optional steps to prepare your Windows template VM for an effective class. Steps include installing OneDrive and installing Office 365, installing the updates for Windows and installing updates for Microsoft Store apps. We also discussed how to set updates to a schedule that works best for your class.

0 commit comments

Comments
 (0)