param( [string] $Folder = "Applications\Configuration", [string] $DPDrive = "DS001", [string] $DPShare = "\\$env:ComputerName\DeploymentShare$", [switch] $Confirm, [switch] $Verbose, [switch] $WhatIf ) $LocalPath = split-path -parent $MyInvocation.MyCommand.Definition if (!(test-path "$($DPDrive)`:\")) { Add-PSSnapin Microsoft.BDD.PSSnapIn -ErrorAction SilentlyContinue | out-null restore-MDTPErsistentDrive -Verbose:$Verbose -Confirm:$Confirm -Whatif:$Whatif |out-null if ((!(test-path "$($DPDrive)`:\")) -band (test-path $DPShare) ) { New-PSDrive -Name $DPDrive -PSProvider MDTProvider -Root $DPShare -Verbose:$Verbose -Confirm:$Confirm -Whatif:$Whatif |out-null } if (!(test-path "$($DPDrive)`:\")) { throw "$DPDrive is not Mounted and not Persisted." } } foreach ( $NEwPath in "$($DPDrive)`:\$Folder" ) { if(!(test-path $NewPath)) { new-item -type directory $NewPath -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose |out-null } } $CONFIGXPTS = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPTS' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP Autostart Terminal Service' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'sc config termservice start= auto' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP Autostart Terminal Service' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPRDP = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPRDP' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP Enable Remote Desktop' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP Enable RDP' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -Dependency @( $CONFIGXPTS.item('guid') ) -NoSource $CONFIGXPBITS = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPBITS' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP Autostart BITS Service' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'sc config BITS start= auto' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP Autostart BITS Service' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPNOBSODAUTOREBOOT = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPNOBSODAUTOREBOOT' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP No BSOD AutoReboot' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 0 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP No BSOD AutoReboot' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPNOERRREP = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPNOERRREP' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP Disable Error Reporting' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SOFTWARE\Microsoft\PCHealth\ErrorReporting" /v DoReport /t REG_DWORD /d 0 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP Disable Error Reporting' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPNOWINDOWSTOUR = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPNOWINDOWSTOUR' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP Disable Windows Tour bubble popup' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Applets\Tour" /v RunCount /t REG_DWORD /d 0 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP Disable Windows Tour bubble popup' -SupportedPlatform @( 'All x86 Windows XP' ) -NoSource $CONFIGXPFORCECLASSICCPL = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPFORCECLASSICCPL' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP Force Classic Control Panel' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v ForceClassicControlPanel /t REG_DWORD /d 0 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP Force Classic Control Panel' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPCLEARPAGEFILEATSHUTDOWN = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPCLEARPAGEFILEATSHUTDOWN' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP Clear Page File At Shutdown' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v ClearPageFileAtShutdown /t REG_DWORD /d 1 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP Clear Page File At Shutdown' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPWFWAVDISABLENOTIFY = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPWFWAVDISABLENOTIFY' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP WFW AntiVirus Disable Notify' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v AntiVirusDisableNotify /t REG_DWORD /d 1 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP WFW AntiVirus Disable Notify' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPWFWFIRSTRUNDISABLED = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPWFWFIRSTRUNDISABLED' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP WFW First Run Disabled' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FirstRunDisabled /t REG_DWORD /d 1 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP WFW First Run Disabled' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPWFWUPDDISABLENOTIFY = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPWFWUPDDISABLENOTIFY' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP WFW Updates Disable Notify' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v UpdatesDisableNotify /t REG_DWORD /d 1 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP WFW Updates Disable Notify' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -NoSource $CONFIGXPWFWDISABLENOTIFY = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXPWFWDISABLENOTIFY' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP WFW Disable Notify' -Version '1.0' -Publisher 'DeployWindowsNet' -CommandLine 'reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FirewallDisableNotify /t REG_DWORD /d 1 /f' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP WFW Disable Notify' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -Dependency @( $CONFIGXPWFWAVDISABLENOTIFY.item('guid'), $CONFIGXPWFWFIRSTRUNDISABLED.item('guid'), $CONFIGXPWFWUPDDISABLENOTIFY.item('guid') ) -NoSource $CONFIGXP = import-MDTApplication -path "$($DPDrive)`:\$Folder" -ShortName 'CONFIGXP' -Whatif:$WhatIf -Confirm:$Confirm -Verbose:$Verbose -Name 'CONFIG XP' -Version '1.0' -Publisher 'DeployWindowsNet' -Reboot 'False' -enable 'True' -hide 'True' -DisplayName 'CONFIG XP' -SupportedPlatform @( 'All x86 Windows XP', 'All x64 Windows XP Professional' ) -Dependency @( $CONFIGXPRDP.item('guid'), $CONFIGXPBITS.item('guid'), $CONFIGXPNOBSODAUTOREBOOT.item('guid'), $CONFIGXPNOERRREP.item('guid'), $CONFIGXPNOWINDOWSTOUR.item('guid'), $CONFIGXPFORCECLASSICCPL.item('guid'), $CONFIGXPCLEARPAGEFILEATSHUTDOWN.item('guid'), $CONFIGXPWFWDISABLENOTIFY.item('guid') ) -NoSource return $CONFIGXP