Jump to content


Stonywall

Established Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Stonywall

  1. Will assume Windows 10 Professional, okay...?

    The BIOS OEM Windows 10 (or other OS) embedded license will automatically activate an OEM or Retail version of the same OS on that computer when installed.

    You can deploy Windows 10 Retail from MDT and after it installs and reboots, the OS will check the BIOS for the key and retrieve activation authorization from the Microsoft license servers.
    I am currently doing this type of deployment for a couple clients and it's working well.

    This also works for computers that have been "upgraded" to Windows 10 from another OS.  As long as the BIOS contains the embedded license for the upgraded OS (like Windows 8 ) it will work.  If the computer was not "upgraded", it will not activate when you install Windows 10 on it.

    Then there is something else called Windows reimaging rights... (link) but that's another long discussion and likely not needed for your deployment scenario.

    The key to making it work is you HAVE to match the OS version that was installed. If you had Windows 10 Home Installed, then you have to deploy that OS version. If you had Windows 10 Professional installed, that is the OS you have to deploy.

    You can usually get recovery media, that you can import into MDT from the manufacturer's support site, or from other "sources" on the internet.
    Note: The Windows Media Creation Tool from Microsoft doesn't contain an Install.WIM file, it has an Install.ESD instead which cannot be imported into MDT.  You would need to convert the ESD to a WIM first. (recommend no compression if converting...)

    Hope this helps you out.

  2. baffee,

    If you are seeing this when booted into WinPE, and not running the task sequence from within Windows 10 1809 OS, the issue is likely the WIM file being used by MDT to build the WinPE boot WIM being pushed out by your WDS server.

    By default MDT will use the WIM from the most up-to-date OS installed.  In your case, that will be Windows 10 1809.  This can cause unintended issues, as you've just experienced.

    To fix the issue, you will need to make sure you have the 1803 ADK installed and make a change to MDT and do a full Deployment Share Update.
    Change is detailed here:  http://stonywall.com/2016/11/14/mdt-2013-update-2-not-using-adk-for-winpe-boot/

    After updating the Deployment Share, don't forget to replace your WDS boot WIM with the newly created one in <MDT Install Folder>\<DeploymentShareName>\boot\  (e.g. D :\DeploymentShare\Boot\ )

    Hope this helps you out.

  3. I have modified the script a lot to make it more modular and incorporated enhancements and fixes for MDT 2013 8456.

    It's currently setup for Windows 10 Enterprise x64 Evaluation. Just comment the line and uncomment the other for the Windows 10 Enterprise x64 VLK edition.

     

    This script has been updated to automatically install the ADK WinPE addon, since it was removed from the ADK main installer.

     

    Hope you like it.

     

     

    MDT_Deploy.zip

  4. Had a few issues due to code changes in the re-release of MDT 2013 Update 1, along with some updates to the driver files. I have attached my modified code. Hopefully it help someone.

    # ***************************************************************************
    # 
    # This Script:        Niall Brady      - http://www.windows-noob.com
    #                                      - August 24 2015.
    #
    #                     This script is customized for deploying Windows 10 Enterprise x64 
    #                     to the Microsoft Surface Pro 3. It does this by configuring 
    #                     this server with Windows ADK 10, MDT 2013 Update 1 with Surface Pro 3 
    #                     drivers, updates the deployment share and populates WDS
    #                     with the MDT boot images before starting WDS.
    #
    #                     All you have to do is run the script, and once complete
    #                     PXE the Surface Pro 3 and enjoy the result !
    #
    #                     This script contains code from other peoples fine 
    #                     work including:-
    #                     
    #                     Nickolaj Andersen - http://www.scconfigmgr.com
    #                     Chris Steding     - http://www.compit.se
    #                     Brandon Linton    - http://blogs.technet.com/b/brandonlinton/
    #                     Trevor Sullivan   - http://trevorsullivan.net/
    #                   
    #                     Do yourself a favor and checkout their websites.
    #
    # Setup your folder structure like so or change $SourcePath to your desire      
    #
    #                     D:\Source
    #                     D:\Source\Drivers
    #                     D:\Source\Operating Systems\Windows 10 Enterprise x64
    #                     D:\Source\Applications\Core Applications
    #                     D:\Source\Applications\Drivers
    #                     D:\Source\Applications\Optional
    #                     D:\Source\Applications\Reference Applications
    #
    #
    # Usage:              Copy the script to the server D:\ 
    #                     Copy your source files to the folder structure above
    #                     If you have already downloaded the Surface Pro 3 drivers, ADK & MDT, copy the files to D:\Source            
    #                     If the files do not exist in the folder D:\Source the script will download them for you. 
    #                     Edit the variables in the script below to meet your needs and enjoy.
    #
    # **************************************************************************
    # This scripts needs unrestricted access 
    #
    #
    clear
    Write-Host "This scripts needs unrestricted access (Set-ExecutionPolicy Unrestricted.) " -nonewline -ForegroundColor Green
    Write-Host "The setup takes around 30 minutes depending on your internet speed." -nonewline -ForegroundColor Green
    Write-Host "At the end of the process, if there are any errors they will be shown in red text, review them to see what failed." -ForegroundColor Green
    #
    # Download the setup files if needed
    # Below you can set the sourcepath variable to whatever drive\folder you want.
    #
    #
    $DriverReleaseDate = "150818_1"
    $DriverReleaseURL = "http://download.microsoft.com/download/2/0/7/2073C22F-2F31-4F4A-8059-E54C91C564A9/SurfacePro3_Win10_150818_1.zip"
    $SourcePath = "D:\Source"
    
    # These 2 lines with help from Trevor !
    $ADKPath = '{0}\Windows Kits\10\ADK' -f $SourcePath;
    $ArgumentList1 = '/layout "{0}" /quiet' -f $ADKPath;
    
    # Check if the folder exists, if not, create it
     if (Test-Path $SourcePath){
     Write-Host "The folder $SourcePath exists."
     } else{
     Write-Host "The folder $SourcePath does not exist, creating..." -NoNewline
     New-Item $SourcePath -type directory | Out-Null
     Write-Host "done!" -ForegroundColor Green
     }
     
    # Check if these files exists, if not, download them
     $file1 = $SourcePath+"\adksetup.exe"
     $file2 = $SourcePath+"\MicrosoftDeploymentToolkit2013_x64.msi"
     $file3 = $SourcePath+"\Surface Ethernet Adapter.zip"
     $file4 = $SourcePath+"\SurfacePro3_Win10_$DriverReleaseDate.zip"
     #$file5 = $SourcePath+"\SurfacePro3PenDriverOct62014.zip"
    
    if (Test-Path $file1){
     write-host "The file $file1 exists."
     } else {
     
    # Download Windows Assessment and Deployment Kit (ADK 10)
    		Write-Host "Downloading Adksetup.exe " -nonewline
    		$clnt = New-Object System.Net.WebClient
    		$url = "http://download.microsoft.com/download/8/1/9/8197FEB9-FABE-48FD-A537-7D8709586715/adk/adksetup.exe"
    		$clnt.DownloadFile($url,$file1)
    		Write-Host "done!" -ForegroundColor Green
     }
     
    if (Test-Path $ADKPath){
     Write-Host "The folder $ADKPath exists."
     } else{
    Write-Host "Downloading Windows ADK 10 which is approx 3GB in size, please wait..."  -nonewline
    Start-Process -FilePath "$SourcePath\adksetup.exe" -Wait -ArgumentList $ArgumentList1
    Write-Host "done!" -ForegroundColor Green
     }
     
    
     if (Test-Path $file2){
     write-host "The file $file2 exists."
     } else {
     
    # Download Microsoft Deployment Toolkit 2013 Update 1
    		Write-Host "Downloading Microsoft Deployment Toolkit 2013 Update 1.." -nonewline
    		$clnt = New-Object System.Net.WebClient
    		$url = "http://download.microsoft.com/download/0/D/E/0DE81822-D03F-4075-93B6-DDEAA0E095F7/install/MicrosoftDeploymentToolkit2013_x64.msi"
    		$clnt.DownloadFile($url,$file2)
    		Write-Host "done!" -ForegroundColor Green
    
     }
    
     if (Test-Path $file3){
     write-host "The file $file3 exists."
     } else {
     
    # Download Surface Pro 3 Ethernet drivers
    		Write-Host "Downloading Surface Pro 3 Ethernet drivers.." -nonewline
    		$clnt = New-Object System.Net.WebClient
    		$url = "http://download.microsoft.com/download/2/0/7/2073C22F-2F31-4F4A-8059-E54C91C564A9/Surface Ethernet Adapter.zip"
    		$clnt.DownloadFile($url,$file3)
    		Write-Host "done!" -ForegroundColor Green
    
     }
    
    # unzip the file
            Write-Host "unzipping $file3 "  -nonewline
            $shell_app = new-object -com shell.application
            $zip_file = $shell_app.namespace($file3)
    
            if (Test-Path "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3\Surface100mbEthernetAdapter") { $destination = $shell_app.namespace("$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3\Surface100mbEthernetAdapter") } else { mkdir "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3\Surface100mbEthernetAdapter" ; $destination = $shell_app.namespace("$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3\Surface100mbEthernetAdapter")}
            $destination.Copyhere($zip_file.items(), 0x14)
            Write-Host "done!" -ForegroundColor Green
    
    
     if (Test-Path $file4){
     write-host "The file $file4 exists."
     
     } else {
     
    # Download Microsoft Surface Pro 3 drivers
    		Write-Host "Downloading Surface Pro 3 $DriverReleaseDate drivers.." -nonewline
    		$clnt = New-Object System.Net.WebClient
    		$url = $DriverReleaseURL
    		$clnt.DownloadFile($url,$file4)
    		Write-Host "done!" -ForegroundColor Green
     }
    
     # unzip the drivers file
            Write-Host "unzipping $file4 "  -nonewline
            $shell_app = new-object -com shell.application
            $zip_file = $shell_app.namespace($file4)
            if (Test-Path "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3") { $destination = $shell_app.namespace("$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3") } else { mkdir "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3" ; $destination = $shell_app.namespace("$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3")}
            $destination.Copyhere($zip_file.items(), 0x14)
            Write-Host "done!" -ForegroundColor Green
    
    # if (Test-Path $file5){
    # write-host "The file $file5 exists."
    # } else {
     
    # Download Surface Pro 3 Pen drivers (depreciated)
    #		Write-Host "Downloading Surface Pro 3 pen drivers.." -nonewline
    #		$clnt = New-Object System.Net.WebClient
    #		$url = "http://download.microsoft.com/download/2/0/7/2073C22F-2F31-4F4A-8059-E54C91C564A9/SurfacePro3PenDriverOct62014.zip"
    #		$clnt.DownloadFile($url,$file5)
    #		Write-Host "done!" -ForegroundColor Green
    # }
    
    # unzip the file
    #        Write-Host "unzipping $file5 "  -nonewline
    #        $shell_app = new-object -com shell.application
    #        $zip_file = $shell_app.namespace($file5)
    #
    #        if (Test-Path "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3") { $destination = $shell_app.namespace("$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3") } else { mkdir "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3" ; $destination = $shell_app.namespace("$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3")}
    #        $destination.Copyhere($zip_file.items(), 0x14)
    #        Write-Host "done!" -ForegroundColor Green
    
    		
    		
    # This installs the Feature .NET Framework
    
    Write-Host "Installing .NET "  -nonewline
           
    Import-Module ServerManager
    Add-WindowsFeature as-net-framework
    
    Start-Sleep -s 10
    
    # This installs Windows Deployment Service
    Write-Host "Installing Windows Deployment Services"  -nonewline
    Import-Module ServerManager
    Install-WindowsFeature -Name WDS -IncludeManagementTools
    Start-Sleep -s 10
    
    # Install ADK Deployment Tools,  Windows Preinstallation Enviroment
    Write-Host "Installing Windows ADK 10"  -nonewline
    Start-Process -FilePath "$ADKPath\adksetup.exe" -Wait -ArgumentList " /Features OptionId.DeploymentTools OptionId.WindowsPreinstallationEnvironment OptionId.ImagingAndConfigurationDesigner OptionId.UserStateMigrationTool /norestart /quiet /ceip off"
    Start-Sleep -s 20
    
    # Install Microsoft Deployment Toolkit 2013
    
    $PSScriptRoot = Split-Path -Path $MyInvocation.MyCommand.Path
    
    msiexec /qb /i "$SourcePath\MicrosoftDeploymentToolkit2013_x64.msi" | Out-Null
    
    Start-Sleep -s 10
    
    # Configure MDT 2013 Update 1
    # ***************************************************************************
    # Author:    Brandon Linton 
    # 
    # Purpose:   This PowerShell script will execute all tasks to create a working
    #            MDT Deployment Share Including:
    #            Create Folder for share
    #            Share MDT Deployment Folder
    #            Creates an example folder structure and selection profiles.
    #            Note that there should be no one actively adding items to the
    #            deployment share while running this script, as some of the
    #            operations performed could cause duplicated or lost items.
    # Usage:     Copy this file to an appropriate location.  Edit the constant
    #            variables below to meet your needs and enjoy.
    # ------------- DISCLAIMER --------------------------------------------------
    # This script code is provided as is with no guarantee or warranty concerning
    # the usability or impact on systems.
    # ------------- DISCLAIMER --------------------------------------------------
    #
    # **************************************************************************
    
    # Initialize
    Add-PSSnapIn Microsoft.BDD.PSSnapIn -ErrorAction SilentlyContinue
    
    # Constants
    #$Computer = get-content env:computername
    $Computer = [System.Net.Dns]::GetHostByName(($env:computerName)).HostName
    $FolderPath = "D:\DeploymentShare"
    $TSFolder1 = "001"
    $ShareName = "DeploymentShare$"
    $NetPath = "\\$Computer\DeploymentShare$"
    $MDTDescription = "MDT Deployment Share"
    $OStoDeploy = "Windows 10 Enterprise x64"
    $OStoDeployShortName = "Windows 10"
    $TaskSequenceFolderName1 = "Production"
    $TaskSequenceFolderName2 = "Test"
    $TaskSequenceFolderName3 = "Server Deployments"
    $TaskSequenceFolderName4 = "Application Installation Only"
    
    # Make MDT Directory
    if (Test-Path "$FolderPath"){
     write-host "'$FolderPath' already exists, will not recreate it."
     } else {
    mkdir "$FolderPath"
    }
    
    # Create MDT Shared Folder
    $Type = 0
    $objWMI = [wmiClass] 'Win32_share'
    $objWMI.create($FolderPath, $ShareName, $Type)
    
    
    # Create PS Drive for MDT
    new-PSDrive -Name "DS001" -PSProvider "MDTProvider" -Root "$FolderPath" -Description "$MDTDescription" -NetworkPath "$NetPath"  -Verbose | add-MDTPersistentDrive -Verbose
    
    # Create OS Folders
    new-item -path "DS001:\Operating Systems" -enable "True" -Name $OStoDeployShortName -Comments "" -ItemType "folder" -Verbose
    
    # Create Driver Folders
    new-item -path "DS001:\Out-of-Box Drivers" -enable "True" -Name "WinPE x64" -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Out-of-Box Drivers" -enable "True" -Name $OStoDeployShortName -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Out-of-Box Drivers\$OStoDeployShortName" -enable "True" -Name "Microsoft Corporation" -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Out-of-Box Drivers\$OStoDeployShortName\Microsoft Corporation" -enable "True" -Name "Surface Pro 3" -Comments "" -ItemType "folder" -Verbose
    
    # Create Packages Folders
    new-item -path "DS001:\Packages" -enable "True" -Name "Language Packs" -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Packages" -enable "True" -Name "MSU" -Comments "" -ItemType "folder" -Verbose
    
    # Create Task Sequence Folders
    new-item -path "DS001:\Task Sequences" -enable "True" -Name $TaskSequenceFolderName1 -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Task Sequences" -enable "True" -Name $TaskSequenceFolderName2 -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Task Sequences" -enable "False" -Name $TaskSequenceFolderName3 -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Task Sequences" -enable "True" -Name $TaskSequenceFolderName4 -Comments "" -ItemType "folder" -Verbose
    
    # Create Application Folders
    new-item -path "DS001:\Applications" -enable "True" -Name "Applications" -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Applications" -enable "True" -Name "Bundled Applications" -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Applications" -enable "True" -Name "Drivers" -Comments "" -ItemType "folder" -Verbose
    new-item -path "DS001:\Applications" -enable "True" -Name "OS Updates" -Comments "" -ItemType "folder" -Verbose
    
    # Create Selection Profiles
    new-item -path "DS001:\Selection Profiles" -enable "True" -Name "Surface Pro 3" -Comments "" -Definition "<SelectionProfile><Include path=`"Out-of-Box Drivers\$OStoDeployShortName\Microsoft Corporation\Surface Pro 3`" /></SelectionProfile>" -ReadOnly "False" -Verbose
    new-item -path "DS001:\Selection Profiles" -enable "True" -Name "WinPE x64" -Comments "" -Definition "<SelectionProfile><Include path=`"Out-of-Box Drivers\WinPE x64`" /></SelectionProfile>" -ReadOnly "False" -Verbose
    
    # Import Operating System Source Files
    import-mdtoperatingsystem -path "DS001:\Operating Systems\$OStoDeployShortName" -SourcePath "$SourcePath\Operating Systems\$OStoDeploy" -DestinationFolder "$OStoDeploy" -Verbose
    
    # Import MSU
    # import-mdtpackage -path "DS001:\Packages\MSU" -SourcePath "$SourcePath\MSU" -Verbose
    
    # Import Applications
    # Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
    # import-MDTApplication -path "DS001:\Applications\Core Applications" -enable "True" -Name "Office 365 Pro Plus x86" -ShortName "Office 365 Pro Plus" -Version "x86" -Publisher "" -Language "" -CommandLine "Setup.EXE /configure Install_Production.xml" -WorkingDirectory ".\Applications\Office 365 Pro Plus x86" -ApplicationSourcePath "D:\Source\Applications\Core Applications\Microsoft Office 365 Pro Plus x86" -DestinationFolder "Office 365 Pro Plus x86" -Verbose
    
    # Import Drivers
    import-mdtdriver -path "DS001:\Out-of-Box Drivers\$OStoDeployShortName\Microsoft Corporation\Surface Pro 3" -sourcePath "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3" -Verbose
    
    #import Network drivers into WinPE x64
    import-mdtdriver -path "DS001:\Out-of-Box Drivers\WinPE x64" -SourcePath "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3\SurfacePro3_Win10_150818_1\Drivers\Network\SurfaceGigabitEthernetAdapter" -Verbose
    import-mdtdriver -path "DS001:\Out-of-Box Drivers\WinPE x64" -SourcePath "$SourcePath\Drivers\Microsoft Corporation\Surface Pro 3\Surface100mbEthernetAdapter" -Verbose
    
    # Create Task Sequence
    import-mdttasksequence -path "DS001:\Task Sequences\Production" -Name "Surface Pro 3 - $OStoDeploy" -Template "Client.xml" -Comments "" -ID "$TSFolder1" -Version "1.0" -OperatingSystemPath "DS001:\Operating Systems\$OSToDeployShortName\Windows 10 Enterprise in Windows 10 Enterprise x64 install.wim" -FullName "Windows User" -OrgName "Contoso" -HomePage "http://contoso.com/" -AdminPassword "Password" -Verbose
    
    #############################################
    # This will replace the standard customsettings.ini with the below
    # edit variables with your own values
    #
    $JoinDomain="Contoso.com"
    $DomainAdmin="Administrator"
    $DomainAdminDomain="CONTOSO"
    $DomainAdminPassword="Password"
    
    $CSFile = @"
    [Settings]
    Priority=TaskSequenceID, Model, Default
    Properties=MyCustomProperty, MaskedVariables
    
    [Default]
    _SMSTSOrgName=Contoso
    MaskedVariables=_SMSTSReserved2,OSDUserStateKeyPassword
    
    ScanStateArgs=/v:5 /o /c
    LoadStateArgs=/v:5 /c /lac /lae
    
    BitsPerPel=32
    VRefresh=60
    XResolution=1
    YResolution=1
    
    OSInstall=Y
    
    SkipRoles=YES
    SkipCapture=YES
    SkipTimeZone=YES
    SkipUserData=YES
    SkipBitLocker=YES
    SkipProductKey=YES
    SkipAdminPassword=YES
    #SkipAppsOnUpgrade=YES
    SkipComputerBackup=YES
    SkipDeploymentType=YES
    SkipLocaleSelection=YES
    
    JoinDomain=$JoinDomain
    DomainAdmin=$DomainAdmin
    DomainAdminDomain=$DomainAdminDomain
    DomainAdminPassword=$DomainAdminPassword
    MachineObjectOU=OU=Workstations,DC=contoso,DC=com
    
    UILanguage=en-US
    UserLocale=en-CA
    KeyboardLocale=en-US
    TimeZoneName=Mountain Standard Time
    
    #WsusServer=http://wsus.contoso.com:8530
    
    WUMU_ExcludeKB001=982861
    WUMU_ExcludeKB002=976002
    WUMU_ExcludeKB003=2267621
    WUMU_ExcludeKB004=2434419
    WUMU_ExcludeKB005=2496898
    WUMU_ExcludeKB006=2533552
    WUMU_ExcludeKB007=2604521
    WUMU_ExcludeKB008=2673774
    WUMU_ExcludeKB009=2694771
    WUMU_ExcludeKB010=2726535
    WUMU_ExcludeKB011=2841134
    
    
    #[Surface Pro 3]
    #XResolution=2160
    #YResolution=1440
    "@ 
    
    # The closing part of the here-string needs to be the first characters on the line
    
    Remove-Item -Path "$FolderPath\Control\CustomSettings.ini" -Force
    New-Item -Path "$FolderPath\Control\CustomSettings.ini" -ItemType File -Value $CSFile
    
    ##############################################
    # replace the standard bootstrap.ini with our own
    # fill in the variables below with your chosen values
    # you can even use local user/passwords on this server
    
    $MDTServer="MDTServer"
    $OrgName="Contoso"
    $UserID="Administrator"
    $UserPassword="Password"
    $UserDomain="CONTOSO"
    
    $BSFile = @"
    [Settings]
    Priority=Default
    
    [Default]
    _SMSTSOrgName=$OrgName
    
    UserID=$UserID
    UserDomain=$UserDomain
    UserPassword=$UserPassword
    
    DeployRoot=$NetPath
    "@ 
    
    # The closing part of the here-string needs to be the first characters on the line
    
    Remove-Item -Path "$FolderPath\Control\BootStrap.ini" -Force
    New-Item -Path "$FolderPath\Control\BootStrap.ini" -ItemType File -Value $BSFile
    
    ##############################################
    
    # make modifications to the Task Sequence
    # $FolderPath = "D:\DeploymentShare"
    $TSXMLFile = "$FolderPath\Control\$TSFolder1\ts.xml"
    # load the task sequence XML file
    [xml]$TSSettingsXML = Get-Content $TSXMLFile
    # replace select profile with Surface Pro 3
    $TSSettingsXML.Sequence.Group.Step | Where-Object {$_.Name -like "*Inject Driver*"} | ForEach-Object {
        $CurrentObject = $_
        if ($CurrentObject.RunIn -like "WinPEandFullOS") {
            $CurrentObject.defaultVarList.variable | Where-Object { $_.Name -like "DriverSelectionProfile" } | ForEach-Object {
                $_."#text" = "Surface Pro 3"
            }
            }
    # replace Auto with all for drivers to use from the selected profile
        if ($CurrentObject.RunIn -like "WinPEandFullOS") {
           $CurrentObject.defaultVarList.variable | Where-Object { $_.Name -like "DriverInjectionMode" } | ForEach-Object {
                $_."#text" = "ALL"
            }
        }
    }
    $TSSettingsXML.Save($TSXMLFile)
    
    # add the Surface Pro 3 WMI query
    # $FolderPath = "D:\DeploymentShare"
    $TSXMLFile = "$FolderPath\Control\$TSFolder1\ts.xml"
    [xml]$TSSettingsXML = Get-Content $TSXMLFile
    
    $InjectDriversElement = $TSSettingsXML.Sequence.Group.Step | Where-Object {($_.Name -like "*Inject Driver*") -and ($_.runIn -like "WinPEandFullOS")}
    $ConditionElement = $InjectDriversElement.AppendChild($TSSettingsXML.CreateElement("condition"))
    $ExpressionElement = $ConditionElement.AppendChild($TSSettingsXML.CreateElement("expression"))
    $ExpressionElement.SetAttribute("type", "SMS_TaskSequence_WMIConditionExpression")
    $VariableNameElement = $ExpressionElement.AppendChild($TSSettingsXML.CreateElement("variable"))
    $VariableNameElement.SetAttribute("name", "Namespace")
    $VariableNameTextNode = $VariableNameElement.AppendChild($TSSettingsXML.CreateTextNode("root\cimv2"))
    $VariableQueryElement = $ExpressionElement.AppendChild($TSSettingsXML.CreateElement("variable"))
    $VariableQueryElement.SetAttribute("name", "Query")
    $VariableQueryTextNode = $VariableQueryElement.AppendChild($TSSettingsXML.CreateTextNode('SELECT * FROM Win32_ComputerSystem WHERE Model Like "%Surface Pro 3%"'))
    $TSSettingsXML.Save($TSXMLFile)
    
    ##############################################
    # Disable the X86 boot wim and change the Selection Profile for the X64 boot wim
    $XMLFile = "$FolderPath\Control\Settings.xml"
                [xml]$SettingsXML = Get-Content $XMLFile
                $SettingsXML.Settings."SupportX86" = "False"
                $SettingsXML.Settings."Boot.x64.SelectionProfile" = "WinPE x64"
                $SettingsXML.Save($XMLFile)
    
    #Update the Deployment Share to create the boot wims and iso files
    update-MDTDeploymentShare -path "DS001:" -Force -Verbose
    Start-Sleep -s 60
    
    #Attach the boot wim images to WDS
    $WDSPath = 'D:\RemoteInstall'
    wdsutil /Verbose /Progress /Initialize-Server /RemInst:$WDSPath
    Start-Sleep -s 10
    Write-Host "Attempting to start WDS..." -NoNewline
    wdsutil /Verbose /Start-Server
    Start-Sleep -s 10
    Write-Host "setting PXE response policy..." -NoNewline
    # this sets WDS to reply to all computers that PXE boot
    wdsutil /Set-Server /AutoAddPolicy 
    # if you don't want that behavior then Rem that line and unrem the next two lines, after adding the correct MAC address
    # $MacAddress="001122334455"
    # New-WdsClient -DeviceID $MacAddress -DeviceName "SurfacePro3" -BootImagePath "Boot\x64\Images\LiteTouchPE_x64.wim"
    #
    Start-Sleep -s 10
    Write-Host "Importing Boot image..." -NoNewline 
    Import-WdsBootImage -Path $FolderPath\Boot\LiteTouchPE_x64.wim -NewImageName "LiteTouchPE_x64" –SkipVerify
    
    # All done
    Write-Host "The installation and configuration is done. If you saw any WDS errors then please restart the server and verify that the WDS service is started." -nonewline -ForegroundColor Green
    
    

    Setup MDT 2013 Update 1 for Microsoft Surface Pro 3 - Updated September 2015.ps1.txt

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.