mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-06-18 03:43:39 +00:00
Merge pull request #4477 from nschonni/fix--Replace-syntax-with-langauge-code-2
fix: Replace syntax with langauge code 2
This commit is contained in:
@ -48,7 +48,7 @@ When the database is populated, you can use the MDT simulation environment to si
|
||||
1. On PC0001, log on as **CONTOSO\\MDT\_BA**.
|
||||
2. Modify the C:\\MDT\\CustomSettings.ini file to look like the following:
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=CSettings, CRoles, RApplications, Default
|
||||
[Default]
|
||||
@ -113,7 +113,7 @@ When the database is populated, you can use the MDT simulation environment to si
|
||||
|
||||
3. Using an elevated Windows PowerShell prompt (run as Administrator), run the following commands. Press **Enter** after each command:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
Set-Location C:\MDT
|
||||
.\Gather.ps1
|
||||
|
||||
|
@ -87,7 +87,7 @@ Setting up DFS-R for replication is a quick and straightforward process. You pre
|
||||
When you have multiple deployment servers sharing the same content, you need to configure the Bootstrap.ini file with information about which server to connect to based on where the client is located. In MDT, that can be done by using the DefaultGateway property.
|
||||
1. On MDT01, using Notepad, navigate to the **E:\\MDTProduction\\Control** folder and modify the Boostrap.ini file to look like this:
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=DefaultGateway, Default
|
||||
[DefaultGateway]
|
||||
@ -153,7 +153,7 @@ When you have multiple deployment servers sharing the same content, you need to
|
||||
2. In the **Advanced** tab, set the quota to **8192 MB**.
|
||||
In this scenario the size of the deployment share is known, but you might need to change the values for your environment. A good rule of thumb is to get the size of the 16 largest files and make sure they fit in the staging area. Here is a Windows PowerShell example that calculates the size of the 16 largest files in the E:\\MDTProduction deployment share:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
(Get-ChildItem E:\MDTProduction -Recurse | Sort-Object Length -Descending | Select-Object -First 16 | Measure-Object -Property Length -Sum).Sum /1GB
|
||||
```
|
||||
|
||||
|
@ -36,7 +36,7 @@ Before adding the more advanced components like scripts, databases, and web serv
|
||||
|
||||
If you have a small test environment, or simply want to assign settings to a very limited number of machines, you can edit the rules to assign settings directly for a given MAC Address. If you have many machines, it makes sense to use the database instead.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=MacAddress, Default
|
||||
[Default]
|
||||
@ -51,7 +51,7 @@ In the preceding sample, you set the PC00075 computer name for a machine with a
|
||||
|
||||
Another way to assign a computer name is to identify the machine via its serial number.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=SerialNumber, Default
|
||||
[Default]
|
||||
@ -66,7 +66,7 @@ In this sample, you set the PC00075 computer name for a machine with a serial nu
|
||||
|
||||
You also can configure the rules engine to use a known property, like a serial number, to generate a computer name on the fly.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -83,7 +83,7 @@ Be careful when using the serial number to assign computer names. A serial numbe
|
||||
|
||||
To avoid assigning a computer name longer than 15 characters, you can configure the rules in more detail by adding VBScript functions, as follows:
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -97,7 +97,7 @@ In the preceding sample, you still configure the rules to set the computer name
|
||||
|
||||
In the rules, you find built-in properties that use a Windows Management Instrumentation (WMI) query to determine whether the machine you are deploying is a laptop, desktop, or server. In this sample, we assume you want to add laptops to different OUs in Active Directory. Note that ByLaptopType is not a reserved word; rather, it is the name of the section to read.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=ByLaptopType, Default
|
||||
[Default]
|
||||
|
@ -23,7 +23,7 @@ In this topic, you will learn how to configure the MDT rules engine to use a Use
|
||||
|
||||
You can call a UserExit by referencing the script in your rules. Then you can configure a property to be set to the result of a function of the VBScript. In this example, we have a VBScript named Setname.vbs (provided in the book sample files, in the UserExit folder).
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -38,7 +38,7 @@ The UserExit=Setname.vbs calls the script and then assigns the computer name to
|
||||
|
||||
The Setname.vbs script takes the MAC Address passed from the rules. The script then does some string manipulation to add a prefix (PC) and remove the semicolons from the MAC Address.
|
||||
|
||||
``` syntax
|
||||
```vb
|
||||
Function UserExit(sType, sWhen, sDetail, bSkip)
|
||||
UserExit = Success
|
||||
End Function
|
||||
|
@ -170,7 +170,7 @@ If you need to add many applications, you can take advantage of the PowerShell s
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Import the snap-in and create the PSDrive by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
|
||||
New-PSDrive -Name "DS001" -PSProvider MDTProvider -Root "E:\MDTBuildLab"
|
||||
```
|
||||
@ -182,7 +182,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2005 SP1
|
||||
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2005 SP1 - x86"
|
||||
$CommandLine = "vcredist_x86.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2005SP1x86"
|
||||
@ -196,7 +196,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2005 SP1
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2005 SP1 - x64"
|
||||
$CommandLine = "vcredist_x64.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2005SP1x64"
|
||||
@ -210,7 +210,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2008 SP1
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2008 SP1 - x86"
|
||||
$CommandLine = "vcredist_x86.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2008SP1x86"
|
||||
@ -224,7 +224,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2008 SP1
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2008 SP1 - x64"
|
||||
$CommandLine = "vcredist_x64.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2008SP1x64"
|
||||
@ -238,7 +238,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2010 SP1
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2010 SP1 - x86"
|
||||
$CommandLine = "vcredist_x86.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2010SP1x86"
|
||||
@ -252,7 +252,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2010 SP1
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2010 SP1 - x64"
|
||||
$CommandLine = "vcredist_x64.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2010SP1x64"
|
||||
@ -266,7 +266,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2012 Upda
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2012 Update 4 - x86"
|
||||
$CommandLine = "vcredist_x86.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2012Ux86"
|
||||
@ -280,7 +280,7 @@ In these steps we assume that you have downloaded Microsoft Visual C++ 2012 Upda
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create the application by running the following commands in an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$ApplicationName = "Install - Microsoft Visual C++ 2012 Update 4 - x64"
|
||||
$CommandLine = "vcredist_x64.exe /Q"
|
||||
$ApplicationSourcePath = "E:\Downloads\VC++2012Ux64"
|
||||
@ -405,7 +405,7 @@ In MDT, there are always two rule files: the CustomSettings.ini file and the Boo
|
||||
For that reason, add only a minimal set of rules to Bootstrap.ini, such as which deployment server and share to connect to - the DEPLOYROOT value. Put the other rules in CustomSettings.ini because that file is updated immediately when you click OK. By taking the following steps, you will configure the rules for the MDT Build Lab deployment share:
|
||||
1. Using the Deployment Workbench, right-click the **MDT Build Lab deployment share** and select **Properties**.
|
||||
2. Select the **Rules** tab and modify using the following information:
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -444,7 +444,7 @@ For that reason, add only a minimal set of rules to Bootstrap.ini, such as which
|
||||
|
||||
3. Click **Edit Bootstrap.ini** and modify using the following information:
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -501,7 +501,7 @@ The CustomSettings.ini file is normally stored on the server, in the Deployment
|
||||
|
||||
The Bootstrap.ini file is available via the deployment share's Properties dialog box, or via the E:\\MDTBuildLab\\Control folder on MDT01.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -529,7 +529,7 @@ So, what are these settings?
|
||||
|
||||
The CustomSettings.ini file, whose content you see on the Rules tab of the deployment share Properties dialog box, contains most of the properties used in the configuration.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
|
@ -175,7 +175,7 @@ When you import drivers to the MDT driver repository, MDT creates a single insta
|
||||
- Surface Pro 3
|
||||
|
||||
The preceding folder names are selected because they match the actual make and model values that MDT reads from the machines during deployment. You can find out the model values for your machines via the following command in Windows PowerShell:
|
||||
``` syntax
|
||||
```powershell
|
||||
Get-WmiObject -Class:Win32_ComputerSystem
|
||||
```
|
||||
Or, you can use this command in a normal command prompt:
|
||||
@ -312,7 +312,7 @@ In this section, you will learn how to configure the MDT Build Lab deployment sh
|
||||
2. Right-click the **MDT Production** deployment share and select **Properties**.
|
||||
3. Select the **Rules** tab and modify using the following information:
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -349,7 +349,7 @@ In this section, you will learn how to configure the MDT Build Lab deployment sh
|
||||
```
|
||||
4. Click **Edit Bootstrap.ini** and modify using the following information:
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -393,7 +393,7 @@ The rules for the MDT Production deployment share are somewhat different from th
|
||||
### The Bootstrap.ini file
|
||||
|
||||
This is the MDT Production Bootstrap.ini without the user credentials (except domain information):
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
@ -405,7 +405,7 @@ SkipBDDWelcome=YES
|
||||
### The CustomSettings.ini file
|
||||
|
||||
This is the CustomSettings.ini file with the new join domain information:
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
[Default]
|
||||
|
@ -34,7 +34,7 @@ When MDT is integrated with Configuration Manager, the task sequence takes addit
|
||||
The task sequence uses instructions that allow you to reduce the number of task sequences in Configuration Manager and instead store settings outside the task sequence. Here are a few examples:
|
||||
- The following settings instruct the task sequence to install the HP Hotkeys package, but only if the hardware is a HP EliteBook 8570w. Note that you don't have to add the package to the task sequence.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Model
|
||||
[HP EliteBook 8570w]
|
||||
@ -42,7 +42,7 @@ The task sequence uses instructions that allow you to reduce the number of task
|
||||
```
|
||||
- The following settings instruct the task sequence to put laptops and desktops in different organizational units (OUs) during deployment, assign different computer names, and finally have the task sequence install the Cisco VPN client, but only if the machine is a laptop.
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority= ByLaptopType, ByDesktopType
|
||||
[ByLaptopType]
|
||||
|
@ -100,7 +100,7 @@ By default MDT stores the log files locally on the client. In order to capture a
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
2. Create and share the **E:\\Logs** folder by running the following commands in an elevated Windows PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
New-Item -Path E:\Logs -ItemType directory
|
||||
New-SmbShare -Name Logs$ -Path E:\Logs -ChangeAccess EVERYONE
|
||||
icacls E:\Logs /grant '"MDT_BA":(OI)(CI)(M)'
|
||||
|
@ -42,7 +42,7 @@ When preparing for the computer replace, you need to create a folder in which to
|
||||
1. On MDT01, log on as **CONTOSO\\Administrator**.
|
||||
|
||||
2. Create and share the **E:\\MigData** folder by running the following three commands in an elevated Windows PowerShell prompt:
|
||||
``` syntax
|
||||
```powershell
|
||||
New-Item -Path E:\MigData -ItemType directory
|
||||
New-SmbShare ?Name MigData$ ?Path E:\MigData
|
||||
-ChangeAccess EVERYONE
|
||||
|
@ -39,7 +39,7 @@ For the purposes of this topic, you already will have either downloaded and inst
|
||||
Figure 6. The C:\\MDT folder with the files added for the simulation environment.
|
||||
|
||||
10. Using an elevated Windows PowerShell prompt (run as Administrator), run the following commands. Press Enter after each command:
|
||||
``` syntax
|
||||
```powershell
|
||||
Set-Location C:\MDT
|
||||
.\Gather.ps1
|
||||
```
|
||||
|
@ -92,7 +92,7 @@ Figure 20. The result from the MDT Sample web service.
|
||||
After verifying the web service using Internet Explorer, you are ready to do the same test in the MDT simulation environment.
|
||||
|
||||
1. On PC0001, edit the CustomSettings.ini file in the **C:\\MDT** folder to look like the following:
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default, GetComputerName
|
||||
[Default]
|
||||
@ -108,7 +108,7 @@ After verifying the web service using Internet Explorer, you are ready to do the
|
||||
|
||||
2. Save the CustomSettings.ini file.
|
||||
3. Using an elevated Windows PowerShell prompt (run as Administrator), run the following commands. Press **Enter** after each command:
|
||||
``` syntax
|
||||
```powershell
|
||||
Set-Location C:\MDT
|
||||
.\Gather.ps1
|
||||
```
|
||||
|
@ -59,7 +59,7 @@ To support additional server-side logging in Configuration Manager, you create a
|
||||
|
||||
2. Type the following commands, pressing **Enter** after each one:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
New-Item -Path E:\Logs -ItemType directory
|
||||
New-SmbShare -Name Logs$ -Path E:\Logs -ChangeAccess EVERYONE
|
||||
icacls E:\Logs /grant '"CM_NAA":(OI)(CI)(M)'
|
||||
@ -74,7 +74,7 @@ This section will show you how to configure the rules (the Windows 10 x64 Settin
|
||||
|
||||
2. Using Notepad, edit the CustomSetting.ini file with the following settings:
|
||||
|
||||
``` syntax
|
||||
```ini
|
||||
[Settings]
|
||||
Priority=Default
|
||||
Properties=OSDMigrateConfigFiles,OSDMigrateMode
|
||||
|
@ -90,7 +90,7 @@ In order for the Configuration Manager Join Domain Account (CM\_JD) to join mach
|
||||
|
||||
2. In an elevated Windows PowerShell prompt (run as Administrator), run the following commands, pressing **Enter** after each command:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
|
||||
|
||||
Set-Location C:\Setup\Scripts
|
||||
|
@ -106,7 +106,7 @@ The following Windows PowerShell cmdlet or cmdlets perform the same function as
|
||||
|
||||
2. In the Windows PowerShell session type the following commands to partition a master boot record (MBR) disk for use with a FAT32 system partition and an NTFS-formatted operating system partition. This disk layout can support computers that use either UEFI or BIOS firmware:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
# The following command will set $Disk to all USB drives with >20 GB of storage
|
||||
|
||||
$Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot }
|
||||
@ -161,7 +161,7 @@ W:\Windows\System32\bcdboot W:\Windows /f ALL /s S:
|
||||
|
||||
5. Apply SAN policy—OFFLINE\_INTERNAL - “4” to prevent the operating system from automatically bringing online any internally connected disk. This is done by creating and saving a **san\_policy.xml** file on the disk. The following example illustrates this step:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="offlineServicing">
|
||||
@ -199,7 +199,7 @@ W:\Windows\System32\bcdboot W:\Windows /f ALL /s S:
|
||||
|
||||
7. Create an answer file (unattend.xml) that disables the use of Windows Recovery Environment with Windows To Go. You can use the following code sample to create a new answer file or you can paste it into an existing answer file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="oobeSystem">
|
||||
@ -312,7 +312,7 @@ Making sure that Windows To Go workspaces are effective when used off premises i
|
||||
|
||||
4. From the Windows PowerShell command prompt run:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
# The following command will set $Disk to all USB drives with >20 GB of storage
|
||||
|
||||
$Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot }
|
||||
@ -367,7 +367,7 @@ dism /apply-image /imagefile:n:\imagefolder\deploymentimages\mywtgimage.wim /ind
|
||||
|
||||
7. Next, we will need to edit the unattend.xml file to configure the first run (OOBE) settings. In this example we are hiding the Microsoft Software License Terms (EULA) page, configuring automatic updates to install important and recommended updates automatically, and identifying this workspace as part of a private office network. You can use other OOBE settings that you have configured for your organization if desired. For more information about the OOBE settings, see [OOBE](https://go.microsoft.com/fwlink/p/?LinkId=619172):
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="oobeSystem">
|
||||
@ -460,7 +460,7 @@ BitLocker recovery keys are the keys that can be used to unlock a BitLocker prot
|
||||
>[!NOTE]
|
||||
>If you used the [manual method for creating a workspace](https://go.microsoft.com/fwlink/p/?LinkId=619174) you should have already provisioned the Windows To Go drive. If so, you can continue on to the next step.
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
# The following command will set $Disk to all USB drives with >20 GB of storage
|
||||
|
||||
$Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot }
|
||||
@ -506,13 +506,13 @@ BitLocker recovery keys are the keys that can be used to unlock a BitLocker prot
|
||||
|
||||
5. In the same PowerShell session use the following cmdlet to add a recovery key to the drive:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
$BitlockerRecoveryProtector = Add-BitLockerKeyProtector W: -RecoveryPasswordProtector
|
||||
```
|
||||
|
||||
6. Next, use the following cmdlets to save the recovery key to a file:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
#The BitLocker Recovery key is essential if for some reason you forget the BitLocker password
|
||||
#This recovery key can also be backed up into Active Directory using manage-bde.exe or the
|
||||
#PowerShell cmdlet Backup-BitLockerKeyProtector.
|
||||
@ -522,7 +522,7 @@ BitLocker recovery keys are the keys that can be used to unlock a BitLocker prot
|
||||
|
||||
7. Then, use the following cmdlets to add the password as a secure string. If you omit the password the cmdlet will prompt you for the password before continuing the operation:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
# Create a variable to store the password
|
||||
$spwd = ConvertTo-SecureString -String <password> -AsplainText –Force
|
||||
Enable-BitLocker W: -PasswordProtector $spwd
|
||||
@ -586,7 +586,7 @@ The sample script creates an unattend file that streamlines the deployment proce
|
||||
|
||||
3. Configure the PowerShell execution policy. By default PowerShell’s execution policy is set to Restricted; that means that scripts won’t run until you have explicitly given them permission to. To configure PowerShell’s execution policy to allow the script to run, use the following command from an elevated PowerShell prompt:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
Set-ExecutionPolicy RemoteSigned
|
||||
```
|
||||
|
||||
@ -601,7 +601,7 @@ The sample script creates an unattend file that streamlines the deployment proce
|
||||
|
||||
#### Windows To Go multiple drive provisioning sample script
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Windows To Go multiple drive provisioning sample script.
|
||||
|
@ -146,7 +146,7 @@ You must ensure that you call the script at a time when it will receive elevated
|
||||
|
||||
The following examples show an installation of a custom compatibility-fix database based on an .msi file.
|
||||
|
||||
``` syntax
|
||||
```vb
|
||||
'InstallSDB.vbs
|
||||
Function Install
|
||||
Dim WshShell
|
||||
|
@ -104,7 +104,7 @@ It is possible to run the ScanState tool while the drive remains encrypted by su
|
||||
|
||||
User-group membership is not preserved during offline migrations. You must configure a **<ProfileControl>** section in the Config.xml file to specify the groups that the migrated users should be made members of. The following example places all migrated users into the Users group:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<Configuration>
|
||||
<ProfileControl>
|
||||
<localGroups>
|
||||
@ -242,7 +242,7 @@ Syntax: <failOnMultipleWinDir>1</failOnMultipleWinDir> or Syntax: &l
|
||||
|
||||
The following XML example illustrates some of the elements discussed earlier in this topic.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<offline>
|
||||
<winDir>
|
||||
<path>C:\Windows</path>
|
||||
|
@ -319,7 +319,7 @@ MigXmlHelper.GenerateDocPatterns ("<ScanProgramFiles>", "<IncludePatterns>", "<S
|
||||
|
||||
To create include data patterns for only the system drive:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
|
||||
<objectSet>
|
||||
<script>MigXmlHelper.GenerateDocPatterns ("FALSE","TRUE","TRUE")</script>
|
||||
@ -329,7 +329,7 @@ To create include data patterns for only the system drive:
|
||||
|
||||
To create an include rule to gather files for registered extensions from the %PROGRAMFILES% directory:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
|
||||
<objectSet>
|
||||
<script>MigXmlHelper.GenerateDocPatterns ("TRUE","TRUE","FALSE")</script>
|
||||
@ -339,7 +339,7 @@ To create an include rule to gather files for registered extensions from the %PR
|
||||
|
||||
To create exclude data patterns:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<exclude filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
|
||||
<objectSet>
|
||||
<script>MigXmlHelper.GenerateDocPatterns ("FALSE","FALSE","FALSE")</script>
|
||||
@ -440,7 +440,7 @@ To exclude the new text document.txt file as well as any .txt files in “new fo
|
||||
|
||||
To exclude Rule 1, there needs to be an exact match of the file name. However, for Rule 2, you can create a pattern to exclude files by using the file name extension.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<exclude>
|
||||
<objectSet>
|
||||
<pattern type="File">D:\Newfolder\[new text document.txt]</pattern>
|
||||
@ -453,7 +453,7 @@ To exclude Rule 1, there needs to be an exact match of the file name. However, f
|
||||
|
||||
If you do not know the file name or location of the file, but you do know the file name extension, you can use the **GenerateDrivePatterns** function. However, the rule will be less specific than the default include rule generated by the MigDocs.xml file, so it will not have precedence. You must use the <UnconditionalExclude> element to give this rule precedence over the default include rule. For more information about the order of precedence for XML migration rules, see [Conflicts and Precedence](usmt-conflicts-and-precedence.md).
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<unconditionalExclude>
|
||||
<objectSet>
|
||||
<script>MigXmlHelper.GenerateDrivePatterns ("*[*.txt]", "Fixed")</script>
|
||||
@ -465,7 +465,7 @@ If you do not know the file name or location of the file, but you do know the fi
|
||||
|
||||
If you want the <UnconditionalExclude> element to apply to both the system and user context, you can create a third component using the **UserandSystem** context. Rules in this component will be run in both contexts.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<component type="Documents" context="UserandSystem">
|
||||
<displayName>MigDocExcludes</displayName>
|
||||
<role role="Data">
|
||||
@ -490,7 +490,7 @@ The application data directory is the most common location that you would need t
|
||||
|
||||
This rule will include .pst files that are located in the default location, but are not linked to Microsoft Outlook. Use the user context to run this rule for each user on the computer.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
|
||||
<objectSet>
|
||||
<pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Outlook\*[*.pst]</pattern>
|
||||
@ -502,7 +502,7 @@ This rule will include .pst files that are located in the default location, but
|
||||
|
||||
For locations outside the user profile, such as the Program Files folder, you can add the rule to the system context component.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
|
||||
<objectSet>
|
||||
<pattern type="File">%CSIDL_PROGRAM_FILES%\*[*.pst]</pattern>
|
||||
|
@ -98,7 +98,7 @@ As the authorized administrator, it is your responsibility to protect the privac
|
||||
|
||||
Although it is not a requirement, it is good practice for <CustomFileName> to match the name of the file. For example, the following is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/migapp">
|
||||
```
|
||||
|
@ -95,7 +95,7 @@ The following example specifies that all locked files, regardless of their locat
|
||||
|
||||
Additionally, the order in the **<ErrorControl>** section implies priority. In this example, the first **<nonFatal>** tag takes precedence over the second **<fatal>** tag. This precedence is applied, regardless of how many tags are listed.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<ErrorControl>
|
||||
<fileError>
|
||||
<nonFatal errorCode="33">* [*]</nonFatal>
|
||||
@ -265,7 +265,7 @@ The **<ErrorControl>** section can be configured to conditionally ignore f
|
||||
|
||||
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<Policy>
|
||||
<HardLinkStoreControl>
|
||||
<fileLocked>
|
||||
|
@ -68,7 +68,7 @@ If you have an <include> rule in one component and a <locationModify>
|
||||
|
||||
The following .xml file migrates all files from C:\\Userdocs, including .mp3 files, because the <exclude> rule is specified in a separate component.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/UserDocs">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>User Documents</displayName>
|
||||
@ -102,7 +102,7 @@ The following .xml file migrates all files from C:\\Userdocs, including .mp3 fil
|
||||
|
||||
Specifying `migrate="no"` in the Config.xml file is the same as deleting the corresponding component from the migration .xml file. However, if you set `migrate="no"` for My Documents, but you have a rule similar to the one shown below in a migration .xml file (which includes all of the .doc files from My Documents), then only the .doc files will be migrated, and all other files will be excluded.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<pattern type="File">%CSIDL_PERSONAL%\* [*.doc] </pattern>
|
||||
@ -135,7 +135,7 @@ If there are conflicting rules within a component, the most specific rule is app
|
||||
|
||||
In the following example, mp3 files will not be excluded from the migration. This is because directory names take precedence over the file extensions.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<pattern type="File">C:\Data\* [*]</pattern>
|
||||
@ -390,7 +390,7 @@ The destination computer contains the following files:
|
||||
|
||||
You have a custom .xml file that contains the following code:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<pattern type="File">c:\data\* [*]</pattern>
|
||||
|
@ -36,7 +36,7 @@ Because the tables in this topic are wide, you may need to adjust the width of i
|
||||
|
||||
The following is a template for the sections that you need to migrate your application. The template is not functional on its own, but you can use it to write your own .xml file.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/migtestapp">
|
||||
<component type="Application">
|
||||
<!-- Name of the application -->
|
||||
@ -195,7 +195,7 @@ This table describes the behavior in the following example .xml file.
|
||||
|
||||
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/testfilemig">
|
||||
<component type="Application" context="System">
|
||||
<displayName>File Migration Test</displayName>
|
||||
@ -231,7 +231,7 @@ This table describes the behavior in the following example .xml file.
|
||||
|
||||
The behavior for this custom .xml file is described within the <`displayName`> tags in the code.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
|
||||
<component type="Documents" context="System">
|
||||
|
@ -209,7 +209,7 @@ You must use the **/nocompress** option with the **/HardLink** option.
|
||||
|
||||
The following XML sample specifies that files locked by an application under the \\Users directory can remain in place during the migration. It also specifies that locked files that are not located in the \\Users directory should result in the **File in Use** error. It is important to exercise caution when specifying the paths using the **File in Use<createhardlink>** tag in order to minimize scenarios that make the hard-link migration store more difficult to delete.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<Policies>
|
||||
<HardLinkStoreControl>
|
||||
<fileLocked>
|
||||
|
@ -37,7 +37,7 @@ In this topic:
|
||||
|
||||
The following .xml file migrates a single registry key.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Application" context="System">
|
||||
<displayName>Component to migrate only registry value string</displayName>
|
||||
@ -63,7 +63,7 @@ The following examples show how to migrate a folder from a specific drive, and f
|
||||
|
||||
- **Including subfolders.** The following .xml file migrates all files and subfolders from C:\\EngineeringDrafts to the destination computer.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>Component to migrate all Engineering Drafts Documents including subfolders</displayName>
|
||||
@ -82,7 +82,7 @@ The following examples show how to migrate a folder from a specific drive, and f
|
||||
|
||||
- **Excluding subfolders.** The following .xml file migrates all files from C:\\EngineeringDrafts, but it does not migrate any subfolders within C:\\EngineeringDrafts.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>Component to migrate all Engineering Drafts Documents without subfolders</displayName>
|
||||
@ -103,7 +103,7 @@ The following examples show how to migrate a folder from a specific drive, and f
|
||||
|
||||
The following .xml file migrates all files and subfolders of the EngineeringDrafts folder from any drive on the computer. If multiple folders exist with the same name, then all files with this name are migrated.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>Component to migrate all Engineering Drafts Documents folder on any drive on the computer </displayName>
|
||||
@ -123,7 +123,7 @@ The following .xml file migrates all files and subfolders of the EngineeringDraf
|
||||
|
||||
The following .xml file migrates all files and subfolders of the EngineeringDrafts folder from any location on the C:\\ drive. If multiple folders exist with the same name, they are all migrated.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>Component to migrate all Engineering Drafts Documents EngineeringDrafts folder from where ever it exists on the C: drive </displayName>
|
||||
@ -146,7 +146,7 @@ The following .xml file migrates all files and subfolders of the EngineeringDraf
|
||||
|
||||
The following .xml file migrates .mp3 files located in the specified drives on the source computer into the C:\\Music folder on the destination computer.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>All .mp3 files to My Documents</displayName>
|
||||
@ -176,7 +176,7 @@ The following examples show how to migrate a file from a specific folder, and ho
|
||||
|
||||
- **To migrate a file from a folder.** The following .xml file migrates only the Sample.doc file from C:\\EngineeringDrafts on the source computer to the destination computer.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>Component to migrate all Engineering Drafts Documents</displayName>
|
||||
@ -195,13 +195,13 @@ The following examples show how to migrate a file from a specific folder, and ho
|
||||
|
||||
- **To migrate a file from any location.** To migrate the Sample.doc file from any location on the C:\\ drive, use the <pattern> element, as the following example shows. If multiple files exist with the same name on the C:\\ drive, all of files with this name are migrated.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<pattern type="File"> C:\* [Sample.doc] </pattern>
|
||||
```
|
||||
|
||||
To migrate the Sample.doc file from any drive on the computer, use <script> as the following example shows. If multiple files exist with the same name, all files with this name are migrated.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<script>MigXmlHelper.GenerateDrivePatterns("* [sample.doc]", "Fixed")</script>
|
||||
```
|
||||
|
||||
|
@ -294,7 +294,7 @@ To migrate these files you author the following migration XML:
|
||||
|
||||
However, upon testing the migration you notice that the “New Text Document.txt” file isn’t included in the migration. To troubleshoot this failure, the migration can be repeated with the environment variable MIG\_ENABLE\_DIAG set such that the diagnostic log is generated. Upon searching the diagnostic log for the component “DATA1”, the following XML section is discovered:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<MigUnitList>
|
||||
<MigUnit Name="<System>\DATA1 (CMXEAgent)" Context="System" ConfidenceLevel="100" Group="Applications" Role="UserData" Agent="CMXEAgent" Selected="true" Supported="true">
|
||||
<Patterns Type="Include">
|
||||
@ -315,13 +315,13 @@ Analysis of this XML section reveals the migunit that was created when the migra
|
||||
|
||||
An analysis of the XML elements reference topic reveals that the <pattern> tag needs to be modified as follows:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<pattern type="File">c:\data\* [*]</pattern>
|
||||
```
|
||||
|
||||
When the migration is preformed again with the modified tag, the diagnostic log reveals the following:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<MigUnitList>
|
||||
<MigUnit Name="<System>\DATA1 (CMXEAgent)" Context="System" ConfidenceLevel="100" Group="Applications" Role="UserData" Agent="CMXEAgent" Selected="true" Supported="true">
|
||||
<Patterns Type="Include">
|
||||
@ -396,7 +396,7 @@ You author the following migration XML:
|
||||
|
||||
However, upon testing the migration you notice that all the text files are still included in the migration. In order to troubleshoot this issue, the migration can be performed with the environment variable MIG\_ENABLE\_DIAG set so that the diagnostic log is generated. Upon searching the diagnostic log for the component “DATA1”, the following XML section is discovered:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<MigUnitList>
|
||||
<MigUnit Name="<System>\DATA1 (CMXEAgent)" Context="System" ConfidenceLevel="100" Group="Applications" Role="UserData" Agent="CMXEAgent" Selected="true" Supported="true">
|
||||
<Patterns Type="Include">
|
||||
@ -453,7 +453,7 @@ Upon reviewing the diagnostic log, you confirm that the files are still migratin
|
||||
|
||||
Your revised migration XML script excludes the files from migrating, as confirmed in the diagnostic log:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<MigUnitList>
|
||||
<MigUnit Name="<System>\DATA1 (CMXEAgent)" Context="System" ConfidenceLevel="100" Group="Applications" Role="UserData" Agent="CMXEAgent" Selected="true" Supported="true">
|
||||
<Patterns Type="Include">
|
||||
|
@ -31,7 +31,7 @@ In this topic:
|
||||
|
||||
The following custom .xml file migrates the directories and files from C:\\EngineeringDrafts into the My Documents folder of every user. %CSIDL\_PERSONAL% is the virtual folder representing the My Documents desktop item, which is equivalent to CSIDL\_MYDOCUMENTS.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="User">
|
||||
<displayName>Engineering Drafts Documents to Personal Folder</displayName>
|
||||
@ -60,7 +60,7 @@ The following custom .xml file migrates the directories and files from C:\\Engin
|
||||
|
||||
The following custom .xml file reroutes .mp3 files located in the fixed drives on the source computer into the C:\\Music folder on the destination computer.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="System">
|
||||
<displayName>All .mp3 files to My Documents</displayName>
|
||||
@ -88,7 +88,7 @@ The following custom .xml file reroutes .mp3 files located in the fixed drives o
|
||||
|
||||
The following custom .xml file migrates the Sample.doc file from C:\\EngineeringDrafts into the My Documents folder of every user. %CSIDL\_PERSONAL% is the virtual folder representing the My Documents desktop item, which is equivalent to CSIDL\_MYDOCUMENTS.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/test">
|
||||
<component type="Documents" context="User">
|
||||
<displayName>Sample.doc into My Documents</displayName>
|
||||
|
@ -138,7 +138,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<addObjects>
|
||||
<object>
|
||||
<location type="Registry">%HklmWowSoftware%\Microsoft\Office\12.0\Common\Migration\Office [UpgradeVersion]</location>
|
||||
@ -212,7 +212,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<object>
|
||||
<location type="Registry">%HklmWowSoftware%\Microsoft\Office\12.0\Common\Migration\Office [Lang]</location>
|
||||
<attributes>DWORD</attributes>
|
||||
@ -275,7 +275,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<object>
|
||||
<location type="Registry">%HklmWowSoftware%\Microsoft\Office\12.0\Common\Migration\Office [Lang]</location>
|
||||
<attributes>DWORD</attributes>
|
||||
@ -455,7 +455,7 @@ For example,
|
||||
|
||||
In the code sample below, the <condition> elements, A and B, are joined together by the AND operator because they are in separate <conditions> sections. For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<detection>
|
||||
<conditions>
|
||||
<condition>A</condition>
|
||||
@ -468,7 +468,7 @@ In the code sample below, the <condition> elements, A and B, are joined to
|
||||
|
||||
However, in the code sample below, the <condition> elements, A and B, are joined together by the OR operator because they are in the same <conditions> section.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<detection>
|
||||
<conditions>
|
||||
<condition>A</condition>
|
||||
@ -826,7 +826,7 @@ For example:
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<condition negation="Yes">MigXmlHelper.DoesStringContentEqual("File","%USERNAME%","")</condition>
|
||||
```
|
||||
~~~
|
||||
@ -914,7 +914,7 @@ For example:
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<objectSet>
|
||||
<condition negation="Yes">MigXmlHelper.IsSameObject("File","%CSIDL_FAVORITES%","%CSIDL_COMMON_FAVORITES%")</condition>
|
||||
<pattern type="File">%CSIDL_FAVORITES%\* [*]</pattern>
|
||||
@ -1055,7 +1055,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<environment name="GlobalEnv">
|
||||
<conditions>
|
||||
<condition negation="Yes">MigXmlHelper.IsNative64Bit()</condition>
|
||||
@ -1152,13 +1152,13 @@ The following functions generate patterns out of the content of an object. These
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<content filter="MigXmlHelper.ExtractSingleFile(',','%system%')">
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<content filter="MigXmlHelper.ExtractSingleFile(NULL,'%CSIDL_COMMON_FONTS%')">
|
||||
```
|
||||
~~~
|
||||
@ -1243,7 +1243,7 @@ and
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<objectSet>
|
||||
<content filter='MigXmlHelper.ExtractDirectory (NULL, "1")'>
|
||||
<objectSet>
|
||||
@ -1365,7 +1365,7 @@ The following functions change the content of objects as they are migrated. Thes
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<contentModify script="MigXmlHelper.ConvertToString('1')">
|
||||
<objectSet>
|
||||
<pattern type="Registry">HKCU\Control Panel\Desktop [ScreenSaveUsePassword]</pattern>
|
||||
@ -1622,7 +1622,7 @@ Syntax:
|
||||
|
||||
The following code sample shows how the <description> element defines the "My custom component" description.:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<description>My custom component<description>
|
||||
```
|
||||
|
||||
@ -1677,7 +1677,7 @@ Syntax:
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<destinationCleanup>
|
||||
<objectSet>
|
||||
<pattern type="Registry">HKCU\Software\Lotus\123\99.0\DDE Preferences\* [*]</pattern>
|
||||
@ -1807,7 +1807,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<detects>
|
||||
<detect>
|
||||
<condition>MigXmlHelper.DoesFileVersionMatch("%Lotus123InstPath%\123w.exe","ProductVersion","9.*")</condition>
|
||||
@ -1878,7 +1878,7 @@ Syntax:
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<detection name="AdobePhotoshopCS">
|
||||
<conditions>
|
||||
<condition>MigXmlHelper.DoesObjectExist("Registry","HKCU\Software\Adobe\Photoshop\8.0")</condition>
|
||||
@ -1889,7 +1889,7 @@ For example:
|
||||
|
||||
and
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<role role="Settings">
|
||||
<detection>
|
||||
<conditions>
|
||||
@ -1945,7 +1945,7 @@ Syntax:
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<displayName>Command Prompt settings</displayName>
|
||||
```
|
||||
|
||||
@ -2012,7 +2012,7 @@ Syntax:
|
||||
|
||||
In this scenario, you want to generate the location of objects at run time depending on the configuration of the destination computer. For example, you must do this if an application writes data in the directory where it is installed, and users can install the application anywhere on the computer. If the application writes a registry value hklm\\software\\companyname\\install \[path\] and then updates this value with the location where the application is installed, then the only way for you to migrate the required data correctly is to define an environment variable. For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<environment>
|
||||
<variable name="INSTALLPATH">
|
||||
<script>MigXmlHelper.GetStringContent("Registry","\software\companyname\install [path]")</script>
|
||||
@ -2022,7 +2022,7 @@ In this scenario, you want to generate the location of objects at run time depen
|
||||
|
||||
Then you can use an include rule as follows. You can use any of the [<script> functions](#scriptfunctions) to perform similar tasks.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<pattern type="File">%INSTALLPATH%\ [*.xyz]</pattern>
|
||||
@ -2032,7 +2032,7 @@ Then you can use an include rule as follows. You can use any of the [<script&
|
||||
|
||||
Second, you can also filter registry values that contain data that you need. The following example extracts the first string (before the separator ",") in the value of the registry Hklm\\software\\companyname\\application\\ \[Path\].
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<environment>
|
||||
<variable name="APPPATH">
|
||||
<objectSet>
|
||||
@ -2050,7 +2050,7 @@ Second, you can also filter registry values that contain data that you need. The
|
||||
|
||||
In this scenario, you want to migrate five files named File1.txt, File2.txt, and so on, from %SYSTEMDRIVE%\\data\\userdata\\dir1\\dir2\\. To do this you must have the following <include> rule in an .xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<pattern type="File">%SYSTEMDRIVE%\data\userdata\dir1\dir2 [File1.txt]</pattern>
|
||||
@ -2064,7 +2064,7 @@ In this scenario, you want to migrate five files named File1.txt, File2.txt, and
|
||||
|
||||
Instead of typing the path five times, you can create a variable for the location as follows:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<environment>
|
||||
<variable name="DATAPATH">
|
||||
<text>%SYSTEMDRIVE%\data\userdata\dir1\dir2 </text>
|
||||
@ -2074,7 +2074,7 @@ Instead of typing the path five times, you can create a variable for the locatio
|
||||
|
||||
Then, you can specify the variable in an <include> rule as follows:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<pattern type="File">%DATAPATH% [File1.txt]</pattern>
|
||||
@ -2133,7 +2133,7 @@ Syntax:
|
||||
|
||||
For example, from the MigUser.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<exclude>
|
||||
<objectSet>
|
||||
<pattern type="File">%CSIDL_MYMUSIC%\* [*]</pattern>
|
||||
@ -2190,7 +2190,7 @@ Syntax:
|
||||
|
||||
Example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/miguser">
|
||||
<!-- This component migrates My Video files -->
|
||||
<component type="System" context="System">
|
||||
@ -2297,7 +2297,7 @@ Syntax:
|
||||
|
||||
For example, if you want to migrate all \*.doc files from the source computer, specifying the following code under the <component> element:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<extensions>
|
||||
<extension>doc</extension>
|
||||
<extensions>
|
||||
@ -2305,7 +2305,7 @@ For example, if you want to migrate all \*.doc files from the source computer, s
|
||||
|
||||
is the same as specifying the following code below the <rules> element:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.doc]", "Fixed")</script>
|
||||
@ -2418,7 +2418,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigUser.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<component type="Documents" context="User">
|
||||
<displayName _locID="miguser.myvideo">My Video</displayName>
|
||||
<paths>
|
||||
@ -2501,7 +2501,7 @@ The following functions return a Boolean value. You can use them to migrate cert
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
|
||||
<objectSet>
|
||||
<pattern type="File">%CSIDL_COMMON_VIDEO%\* [*]</pattern>
|
||||
@ -2517,7 +2517,7 @@ The following functions return a Boolean value. You can use them to migrate cert
|
||||
|
||||
In the following example, HKCU\\Control Panel\\International \[Locale\] will be included in the store, but it will not be migrated to the destination computer:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include filter="MigXmlHelper.NeverRestore()">
|
||||
<objectSet>
|
||||
<pattern type="Registry">HKCU\Control Panel\International [Locale]</pattern>
|
||||
@ -2634,7 +2634,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<addObjects>
|
||||
<object>
|
||||
<location type="Registry">%HklmWowSoftware%\Microsoft\Office\12.0\Common\Migration\Office [UpgradeVersion]</location>
|
||||
@ -2695,7 +2695,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<locationModify script="MigXmlHelper.RelativeMove('%CSIDL_APPDATA%\Microsoft\Office','%CSIDL_APPDATA%')">
|
||||
<objectSet>
|
||||
<pattern type="File">%CSIDL_APPDATA%\Microsoft\Office\ [Access10.pip]</pattern>
|
||||
@ -2740,7 +2740,7 @@ The following functions change the location of objects as they are migrated when
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<locationModify script="MigXmlHelper.ExactMove('HKCU\Keyboard Layout\Toggle [HotKey]')">
|
||||
<objectSet>
|
||||
<pattern type="Registry">HKCU\Keyboard Layout\Toggle []</pattern>
|
||||
@ -2817,7 +2817,7 @@ For example:
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<include>
|
||||
<objectSet>
|
||||
<pattern type="File">%CSIDL_COMMON_FAVORITES%\* [*]</pattern>
|
||||
@ -2923,7 +2923,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigUser.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<rules>
|
||||
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
|
||||
<objectSet>
|
||||
@ -2948,7 +2948,7 @@ These functions control how collisions are resolved.
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<merge script="MigXmlHelper.DestinationPriority()">
|
||||
<objectSet>
|
||||
<pattern type="Registry">HKCU\Software\Microsoft\Office\9.0\PhotoDraw\ [MyPictures]</pattern>
|
||||
@ -3037,7 +3037,7 @@ These functions control how collisions are resolved.
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<merge script="MigXmlHelper.SourcePriority()">
|
||||
<objectSet>
|
||||
<pattern type="Registry">%HklmWowSoftware%\Microsoft\Office\12.0\Common\Migration\Publisher [UpgradeVersion]</pattern>
|
||||
@ -3097,7 +3097,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/migapp">
|
||||
</migration>
|
||||
```
|
||||
@ -3138,7 +3138,7 @@ This filter helper function can be used to filter the migration of files based o
|
||||
|
||||
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<component context="System" type="Application">
|
||||
<displayName>File_size</displayName>
|
||||
<role role="Data">
|
||||
@ -3194,7 +3194,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<addObjects>
|
||||
<object>
|
||||
<location type="Registry">%HklmWowSoftware%\Microsoft\Office\12.0\Common\Migration\Office [UpgradeVersion]</location>
|
||||
@ -3230,7 +3230,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigUser.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<component type="Documents" context="User">
|
||||
<displayName _locID="miguser.mymusic">My Music</displayName>
|
||||
<paths>
|
||||
@ -3273,7 +3273,7 @@ This is an internal USMT element. Do not use this element.
|
||||
|
||||
You can use this element to specify multiple objects. You can specify multiple <pattern> elements for each <objectSet> element and they will be combined. If you are specifying files, you may want to use GenerateDrivePatterns with <script> instead. GenerateDrivePatterns is basically the same as a <pattern> rule, without the drive letter specification. For example, the following two lines of code are similar:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<pattern type="File">C:\Folder\* [Sample.doc]</pattern>
|
||||
<script>MigXmlHelper.GenerateDrivePatterns("\Folder\* [Sample.doc]","Fixed"</script>
|
||||
```
|
||||
@ -3336,13 +3336,13 @@ For example:
|
||||
|
||||
- To migrate a single registry key:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<pattern type="Registry">HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache [Persistent]</pattern>
|
||||
```
|
||||
|
||||
- To migrate the EngineeringDrafts folder and any subfolders from the C: drive:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<pattern type="File">C:\EngineeringDrafts\* [*]</pattern>
|
||||
```
|
||||
|
||||
@ -3352,13 +3352,13 @@ For example:
|
||||
|
||||
- To migrate the Sample.doc file from C:\\EngineeringDrafts:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<pattern type="File"> C:\EngineeringDrafts\ [Sample.doc]</pattern>
|
||||
```
|
||||
|
||||
- To migrate the Sample.doc file from where ever it exists on the C: drive use pattern in the following way. If multiple files exist with the same name on the C: drive, then all of these files will be migrated.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<pattern type="File"> C:\* [Sample.doc] </pattern>
|
||||
```
|
||||
|
||||
@ -3484,7 +3484,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigUser.xml file. For more examples, see the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<component type="System" context="User">
|
||||
<displayName _locID="miguser.startmenu">Start Menu</displayName>
|
||||
<paths>
|
||||
@ -3571,7 +3571,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigUser.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<component type="Documents" context="User">
|
||||
<displayName _locID="miguser.mymusic">My Music</displayName>
|
||||
<paths>
|
||||
@ -3679,7 +3679,7 @@ Examples:
|
||||
|
||||
To migrate the Sample.doc file from any drive on the source computer, use <script> as follows. If multiple files exist with the same name, all such files will get migrated.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<script>MigXmlHelper.GenerateDrivePatterns("* [sample.doc]", "Fixed")</script>
|
||||
```
|
||||
|
||||
@ -3744,7 +3744,7 @@ These functions return either a string or a pattern.
|
||||
~~~
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<variable name="MSNMessengerInstPath">
|
||||
<script>MigXmlHelper.GetStringContent("Registry","%HklmWowSoftware%\Microsoft\MSNMessenger [InstallationDirectory]")</script>
|
||||
</variable>
|
||||
@ -3849,7 +3849,7 @@ If GenerateUserPattens('File','%userprofile% \[\*.doc\]','FALSE') is called whil
|
||||
|
||||
The following is example code for this scenario. The first <rules> element migrates all.doc files on the source computer with the exception of those inside C:\\Documents and Settings. The second <rules> elements will migrate all .doc files from C:\\Documents and Settings with the exception of the .doc files in the profiles of the other users. Because the second <rules> element will be processed in each migrated user context, the end result will be the desired behavior. The end result is the one we expected.
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<rules context="System">
|
||||
<include>
|
||||
<objectSet>
|
||||
@ -3915,7 +3915,7 @@ This helper function invokes the document finder to scan the system for all file
|
||||
|
||||
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<!-- This component migrates data in user context -->
|
||||
<component type="Documents" context="User">
|
||||
<displayName>MigDocUser</displayName>
|
||||
@ -3942,7 +3942,7 @@ The following scripts have no return value. You can use the following errors wit
|
||||
|
||||
- **AskForLogoff()**. Prompts the user to log off at the end of the migration. For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<processing when="apply-success">
|
||||
<script>MigXmlHelper.AskForLogoff()</script>
|
||||
</processing>
|
||||
@ -3952,7 +3952,7 @@ The following scripts have no return value. You can use the following errors wit
|
||||
|
||||
- **KillExplorer()**. Stops Explorer.exe for the current user context. This allows access to certain keys and files that are kept open when Explorer.exe is running. For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<processing when="pre-apply">
|
||||
<script>MigXmlHelper.KillExplorer()</script>
|
||||
</processing>
|
||||
@ -3960,7 +3960,7 @@ The following scripts have no return value. You can use the following errors wit
|
||||
|
||||
- **RegisterFonts(FileEncodedLocation)**. Registers the given font or all of the fonts in the given directory. For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<processing when="apply-success">
|
||||
<script>MigXmlHelper.RegisterFonts("%CSIDL_COMMON_FONTS%")</script>
|
||||
</processing>
|
||||
@ -3970,7 +3970,7 @@ The following scripts have no return value. You can use the following errors wit
|
||||
|
||||
- **RestartExplorer().** Restarts Explorer.exe at the end of the migration. For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<processing when="post-apply">
|
||||
<script>MigXmlHelper.RestartExplorer()</script>
|
||||
</processing>
|
||||
@ -4020,7 +4020,7 @@ Syntax:
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<variable name="QuickTime5or6DataSys">
|
||||
<text>%CSIDL_COMMON_APPDATA%\QuickTime</text>
|
||||
</variable>
|
||||
@ -4045,7 +4045,7 @@ Syntax:
|
||||
|
||||
The following .xml file excludes all .mp3 files from migration. For additional examples of how to use this element, see the [Exclude Files and Settings](usmt-exclude-files-and-settings.md).
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/excludefiles">
|
||||
<component context="System" type="Documents">
|
||||
<displayName>Test</displayName>
|
||||
@ -4116,7 +4116,7 @@ Syntax:
|
||||
|
||||
The following example is from the MigApp.xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<environment>
|
||||
<variable name="HklmWowSoftware">
|
||||
<text>HKLM\Software</text>
|
||||
@ -4168,7 +4168,7 @@ Syntax:
|
||||
|
||||
For example:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<version>4.*</version>
|
||||
```
|
||||
|
||||
|
@ -20,20 +20,20 @@ When creating custom .xml files, note the following requirements:
|
||||
|
||||
- **The file must be in Unicode Transformation Format-8 (UTF-8).** You must save the file in this format, and you must specify the following syntax at the beginning of each .xml file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
```
|
||||
|
||||
- **The file must have a unique migration urlid**. The urlid of each file that you specify on the command line must be different. If two migration .xml files have the same urlid, the second .xml file that is specified on the command line will not be processed. This is because USMT uses the urlid to define the components within the file. For example, you must specify the following syntax at the beginning of each file:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/<CustomFileName>">
|
||||
```
|
||||
|
||||
- **Each component in the file must have a display name in order for it to appear in the Config.xml file.** This is because the Config.xml file defines the components by the display name and the migration urlid. For example, specify the following syntax:
|
||||
|
||||
``` syntax
|
||||
```xml
|
||||
<displayName>My Application</displayName>
|
||||
```
|
||||
|
||||
|
@ -36,7 +36,7 @@ The Volume Activation Management Tool (VAMT) PowerShell cmdlets can be used to p
|
||||
cd “C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\VAMT 3.0”
|
||||
```
|
||||
- Import the VAMT PowerShell module. To import the module, type the following at a command prompt:
|
||||
``` syntax
|
||||
```powershell
|
||||
Import-Module .\VAMT.psd1
|
||||
```
|
||||
Where **Import-Module** imports a module only into the current session. To import the module into all sessions, add an **Import-Module** command to a Windows PowerShell profile. For more information about profiles, type `get-help about_profiles`.
|
||||
|
@ -43,7 +43,7 @@ Dism.exe /Online /Enable-Feature /FeatureName:NetFX3 /All /Source:D:\Sources\SxS
|
||||
|
||||
In Windows 10, you can use Windows PowerShell for many of the functions performed by DISM.exe. The equivalent command in Windows 10 using PowerShell is:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
Enable-WindowsOptionalFeature -Online -FeatureName NetFx3 -All
|
||||
-Source D:\Sources\SxS -LimitAccess
|
||||
```
|
||||
@ -132,7 +132,7 @@ Figure 6. The updated Volume Activation Management Tool.
|
||||
|
||||
VAMT also can be used to create reports, switch from MAK to KMS, manage Active Directory-based activation, and manage Office 2010 and Office 2013 volume activation. VAMT also supports PowerShell (instead of the old command-line tool). For example, if you want to get information from the VAMT database, you can type:
|
||||
|
||||
``` syntax
|
||||
```powershell
|
||||
Get-VamtProduct
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user