Mick's IT Blogs

My blog is here to help solve issues I have encountered and solved, publish scripts I have written, and educate others in understanding areas that are not well covered.

Mick's IT Blogs

Information Technology Zone

07 July 2014

SCCM: Adjust Screen Resolution during Build

Sometimes the screen resolution in a build does not set to the maximum. Resolution can be set with PowerShell, but the scripting requirements and complexity is too much, IMO. AutoIT offers an easy way to automate this process. I have written this script to do just that. There is documentation within the script. You will need to have the AutoIT compiler for this. Here is the link to download it.


 #Region ;**** Directives created by AutoIt3Wrapper_GUI ****  
 #AutoIt3Wrapper_Outfile=install.exe  
 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****  
 ; Open Screen Resolution  
 Run( "control desk.cpl" )  
 Sleep( 2000 )  
 ; Tab to Resolution  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 ; Open Resolution Drop Down  
 Send( "{Enter}" )  
 Sleep( 250 )  
 ; Move Resolution Up to max. You may need to add more up arrows.  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 Send( "{UP}" )  
 Sleep( 250 )  
 ; Accept resolution  
 Send( "{Enter}" )  
 Sleep( 250 )  
 ; Move to OK button  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 Send( "{TAB}" )  
 Sleep( 250 )  
 ; Apply New Resolution  
 Send( "{Enter}" )  
 Sleep( 5000 )  
 ; Accept New Resolution  
 Send( "k" )  
   

27 June 2014

PowerShell: SCCM Client Installer

Installing the SCCM client takes a few minutes. This script was written so that it will wait for the ccmsetup.exe to complete. I have encountered issues with the setup not completing before the system reboots during a build process. That is the reason I wrote this script. There are verifications in this script and it does write a log file. If you don't want the logs, just remove those parts of the script. This script was originally written for SCCM 2007, but it will work on 2012 too. You can download it from here.


 <#  
 .NAME  
   Mick Pletcher  
 .DATE  
   13 June 2014  
 .SYNOPSIS  
   SCCM 2007  
 .DESCRIPTION  
   <A detailed description of the script>  
 .PARAMETER <paramName>  
   <Description of script parameter>  
 .EXAMPLE  
   <An example of using the script>  
 #>  
   
 #Declare Global Memory  
 Set-Variable -Name BuildLog -Scope Global -Force  
 Set-Variable -Name Errors -Value $null -Scope Global -Force  
 Set-Variable -Name LogFile -Scope Global -Force  
 Set-Variable -Name RelativePath -Scope Global -Force  
 Set-Variable -Name Sequence -Scope Global -Force  
 Set-Variable -Name Title -Scope Global -Force  
   
 Function DeclareGlobalVariables {  
      $Global:BuildLog = $Env:windir+"\Logs\BuildLogs\Build.log"  
      $Global:LogFile = $Env:windir+"\Logs\BuildLogs\SCCM2007Client.log"  
      $Global:Sequence = "01"  
      $Global:Title = "SCCM 2007 Client"  
 }  
   
 Function ConsoleTitle ($Title){  
      $host.ui.RawUI.WindowTitle = $Title  
 }  
   
 Function GetRelativePath {   
      $Global:RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"   
 }  
   
 Function UninstallMSI ($ProgName,$GUID) {  
      $EXE = $Env:windir+"\system32\msiexec.exe"  
      $Switches = [char]32+"/qb- /norestart"  
      $Parameters = "/x "+$GUID+$Switches  
      $Output = "Uninstall"+$ProgName+"....."  
      Write-Host "Uninstall"$ProgName"....." -NoNewline  
      $ErrCode = (Start-Process -FilePath $EXE -ArgumentList $Parameters -Wait -Passthru).ExitCode  
      If (($ErrCode -eq 0) -or ($ErrCode -eq 3010)) {  
           $Output = $Output+"Success"  
           Write-Host "Success" -ForegroundColor Yellow  
      } elseIf ($ErrCode -eq 1605) {  
           $Output = $Output+"Not Present"  
           Write-Host "Not Present" -ForegroundColor Green  
      } else {  
           $Output = $Output+"Failed with error code "+$ErrCode  
           Write-Host "Failed with error code "$ErrCode -ForegroundColor Red  
           $Global:Errors++  
      }  
      Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force  
 }  
   
 Function InstallMSI ($ProgName,$MSI,$Switches) {  
      $EXE = $Env:windir+"\system32\msiexec.exe"  
      $Parameters = "/i "+[char]34+$MSI+[char]34+[char]32+$Switches  
      $Output = "Install"+$ProgName+"....."  
      Write-Host "Install"$ProgName"....." -NoNewline  
      $ErrCode = (Start-Process -FilePath $EXE -ArgumentList $Parameters -Wait -Passthru).ExitCode  
      If (($ErrCode -eq 0) -or ($ErrCode -eq 3010)) {  
           $Output = $Output+"Success"  
           Write-Host "Success" -ForegroundColor Yellow  
      } else {  
           $Output = $Output+"Failed with error code "+$ErrCode  
           Write-Host "Failed with error code "$ErrCode -ForegroundColor Red  
           $Global:Errors++  
      }  
      Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force  
 }  
   
 Function InstallEXE ($ProgName,$EXE,$Switches){  
      $Output = "Install "+$ProgName+"....."  
      Write-Host "Install "$ProgName"....." -NoNewline  
      $ErrCode = (Start-Process -FilePath $EXE -ArgumentList $Switches -Wait -Passthru).ExitCode  
      If (($ErrCode -eq 0) -or ($ErrCode -eq 3010)) {  
           $Output = $Output+"Success"  
           Write-Host "Success" -ForegroundColor Yellow  
      } else {  
           $Output = $Output+"Failed with error code "+$ErrCode  
           Write-Host "Failed with error code "$ErrCode -ForegroundColor Red  
           $Global:Errors++  
      }  
      Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force  
 }  
   
 Function InstallMSP ($ProgName,$MSP,$Switches) {  
      $EXE = $Env:windir+"\system32\msiexec.exe"  
      $Parameters = "/p "+[char]34+$MSP+[char]34+[char]32+$Switches  
      $Output = "Install"+$ProgName+"....."  
      Write-Host "Install"$ProgName"....." -NoNewline  
      $ErrCode = (Start-Process -FilePath $EXE -ArgumentList $Parameters -Wait -Passthru).ExitCode  
      If (($ErrCode -eq 0) -or ($ErrCode -eq 3010)) {  
           $Output = $Output+"Success"  
           Write-Host "Success" -ForegroundColor Yellow  
      } else {  
           $Output = $Output+"Failed with error code "+$ErrCode  
           Write-Host "Failed with error code "$ErrCode -ForegroundColor Red  
           $Global:Errors++  
      }  
      Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force  
 }  
   
 Function WaitForProcessEnd ($Process) {  
      $Proc = Get-Process $Process -ErrorAction SilentlyContinue  
      $Output = "Waiting for"+$Process+"to complete....."  
      Write-Host "Waiting for"$Process" to complete....." -NoNewline  
      If ($Proc -ne $null) {  
           Do {  
                Start-Sleep -Seconds 5  
                $Proc = Get-Process $Process -ErrorAction SilentlyContinue  
           } While ($Proc -ne $null)  
           $Output = $Output+"Completed"  
           Write-Host "Completed" -ForegroundColor Yellow  
      } else {  
           $Output = $Output+"Already Completed"  
           Write-Host "Already Completed" -ForegroundColor Yellow  
      }  
      Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force  
 }  
   
 Function ProcessLogFile {  
      If ((Test-Path $Env:windir"\Logs") -eq $false) {  
           New-Item -ItemType Directory -Path $Env:windir"\Logs"  
      }  
      If ((Test-Path $Env:windir"\Logs\ApplicationLogs") -eq $false) {  
           New-Item -ItemType Directory -Path $Env:windir"\Logs\ApplicationLogs"  
      }  
      If ((Test-Path $Env:windir"Logs\BuildLogs") -eq $false) {  
           New-Item -ItemType Directory -Path $Env:windir"\Logs\BuildLogs"  
      }  
      If ($Global:Errors -eq $null) {  
           If (Test-Path $Global:LogFile) {  
                Remove-Item $Global:LogFile -Force  
           }  
           $File1 = $Global:LogFile.Split(".")  
           $Filename1 = $File1[0]+"_ERROR"+"."+$File1[1]  
           If (Test-Path $Filename1) {  
                Remove-Item $Filename1 -Force  
           }  
           $Global:Errors = 0  
      } elseIf ($Global:Errors -ne 0) {  
           If (Test-Path $Global:LogFile) {  
                $Global:LogFile.ToString()  
                $File1 = $Global:LogFile.Split(".")  
                $Filename1 = $File1[0]+"_ERROR"+"."+$File1[1]  
                Rename-Item $Global:LogFile -NewName $Filename1 -Force  
           }  
      } else {  
           $LogTitle = $Global:Sequence+" - "+$Global:Title  
           Out-File -FilePath $Global:BuildLog -InputObject $LogTitle -Append -Force  
      }  
 }  
   
 cls  
 DeclareGlobalVariables  
 GetRelativePath  
 ConsoleTitle $Global:Title  
 ProcessLogFile  
 UninstallMSI "Microsoft SCCM 2007 Client" $Global:RelativePath"i386\client.msi"  
 InstallMSI "Microsoft XML 6" $Global:RelativePath"i386\msxml6.msi" "/qb- /norestart"  
 InstallEXE "Microsoft SCCM 2007" $Global:RelativePath"ccmsetup.exe" "SMSSITECODE=ENT SMSCACHESIZE=5120"  
 WaitForProcessEnd "CCMSETUP"  
 InstallMSP "KB977203" $Global:RelativePath"i386\sccm2007ac-sp2-kb977203-x86.msp" "/qb- /norestart"  
 InstallMSP "KB2659258" $Global:RelativePath"i386\sccm2007ac-sp2-kb2659258-x86-enu.msp" "/qb- /norestart"  
 ProcessLogFile  
 Start-Sleep -Seconds 5  
   

PowerShell: Pinning Shortcuts to the Taskbar and Start Menu

There are already scripts out there that will do this, but I have taken it a little further. I have added checking to make sure the application is installed first so that the script does not error out. I have also added on-screen display to show if it was successful or not. I originally started off of the answer here and then expanded. One weird thing I encountered while writing this was that it treated excel 2010 differently than all other shortcuts. That is why you will see the extra three lines of code specifically for excel. You can download the script from here.


 <#  
 .NAME  
   Mick Pletcher  
 .DATE  
   11 May 2014  
 .SYNOPSIS  
   Taskbar Shortcuts  
 .DESCRIPTION  
   Create taskbar shortcuts  
 .PARAMETER <paramName>  
   <Description of script parameter>  
 .EXAMPLE  
   <An example of using the script>  
 #>  
   
 #Declare Global Memory  
 Set-Variable -Name Architecture -Scope Global -Force  
 Set-Variable -Name RelativePath -Scope Global -Force  
 Set-Variable -Name Title -Value "Application Shortcuts" -Scope Global -Force  
   
 Function ConsoleTitle ($Title){  
      $host.ui.RawUI.WindowTitle = $Title  
 }  
   
 Function GetRelativePath {   
      $Global:RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"   
 }  
   
 Function GetArchitecture {  
      $Global:Architecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture  
      $Global:Architecture = $Global:Architecture.OSArchitecture  
      #Returns 32-bit or 64-bit  
 }  
   
 Function PinToStartMenu ($AppName,$PinnedApp,$App) {  
      Write-Host "Pin"$AppName" on Start Menu....." -NoNewline  
      If ((Test-Path $App) -eq $true) {  
           If ((Test-Path $PinnedApp) -eq $false) {  
                $sa = new-object -c shell.application  
                $AppSplit = $App.split("\")  
                $AppSplitCount = $AppSplit.Count  
                $Filename = $AppSplit[$AppSplitCount-1]  
                For ($i=0; $i -lt $AppSplitCount-1) {  
                     $DirectoryPath = $DirectoryPath+$AppSplit[$i]  
                     If ($i -ne $AppSplitCount-2) {  
                          $DirectoryPath = $DirectoryPath+"\"  
                     }  
                     $i++  
                }  
                $pn = $sa.namespace($DirectoryPath).parsename($Filename)  
                $pn.invokeverb('startpin')  
                If ((Test-Path $PinnedApp) -eq $true) {  
                     Write-Host "Success" -ForegroundColor Yellow  
                } else {  
                     Write-Host "Failed " -ForegroundColor Red  
                }  
           } else {  
                Write-Host "Already Present" -ForegroundColor Yellow  
           }  
      } else {  
           Write-Host "Application not installed" -ForegroundColor Green  
      }  
 }  
   
 Function PinToTaskbar ($AppName,$PinnedApp,$App) {  
      Write-Host "Pin"$AppName" to Taskbar....." -NoNewline  
      If ((Test-Path $App) -eq $true) {  
           If ((Test-Path $PinnedApp) -eq $false) {  
                $sa = new-object -c shell.application  
                $AppSplit = $App.split("\")  
                $AppSplitCount = $AppSplit.Count  
                $Filename = $AppSplit[$AppSplitCount-1]  
                For ($i=0; $i -lt $AppSplitCount-1) {  
                     $DirectoryPath = $DirectoryPath+$AppSplit[$i]  
                     If ($i -ne $AppSplitCount-2) {  
                          $DirectoryPath = $DirectoryPath+"\"  
                     }  
                     $i++  
                }  
                $pn = $sa.namespace($DirectoryPath).parsename($Filename)  
                $pn.invokeverb('taskbarpin')  
                If ((Test-Path $PinnedApp) -eq $true) {  
                     Write-Host "Success" -ForegroundColor Yellow  
                } else {  
                     Write-Host "Failed " -ForegroundColor Red  
                }  
           } else {  
                Write-Host "Already Present" -ForegroundColor Yellow  
           }  
      } else {  
           Write-Host "Application not installed" -ForegroundColor Green  
      }  
 }  
   
 Function UnpinFromStartMenu ($AppName,$PinnedApp,$App) {  
      Write-Host "Unpin"$AppName" from Start Menu....." -NoNewline  
      If ((Test-Path $PinnedApp) -eq $true) {  
           $sa = new-object -c shell.application  
           $AppSplit = $App.split("\")  
           $AppSplitCount = $AppSplit.Count  
           $Filename = $AppSplit[$AppSplitCount-1]  
           For ($i=0; $i -lt $AppSplitCount-1) {  
                $DirectoryPath = $DirectoryPath+$AppSplit[$i]  
                If ($i -ne $AppSplitCount-2) {  
                     $DirectoryPath = $DirectoryPath+"\"  
                }  
                $i++  
           }  
           $pn = $sa.namespace($DirectoryPath).parsename($Filename)  
           $pn.invokeverb('startunpin')  
           If ((Test-Path $PinnedApp) -eq $false) {  
                Write-Host "Success" -ForegroundColor Yellow  
           } else {  
                Write-Host "Failed " -ForegroundColor Red  
           }  
      } else {  
           Write-Host "Already Removed" -ForegroundColor Yellow  
      }  
 }  
   
 Function UnpinFromTaskbar ($AppName,$PinnedApp,$App) {  
      Write-Host "Unpin"$AppName" from Taskbar....." -NoNewline  
      If ((Test-Path $PinnedApp) -eq $true) {  
           $AppSplit = $App.split("\")  
           $AppSplitCount = $AppSplit.Count  
           $Filename = $AppSplit[$AppSplitCount-1]  
           $DirectoryPath = $App.Trim($Filename)  
           $DirectoryPath = $DirectoryPath.Trim("\")  
           If ($Filename -eq "EXCEL.EXE") {  
                $DirectoryPath = "c"+$DirectoryPath  
           }  
           $sa = new-object -c shell.application  
           $pn = $sa.namespace($DirectoryPath).parsename($Filename)  
           $pn.invokeverb('taskbarunpin')  
           If ((Test-Path $PinnedApp) -eq $false) {  
                Write-Host "Success" -ForegroundColor Yellow  
           } else {  
                Write-Host "Failed " -ForegroundColor Red  
           }  
      } else {  
           Write-Host "Already Removed" -ForegroundColor Yellow  
      }  
 }  
   
 cls  
 GetRelativePath  
 ConsoleTitle $Global:Title  
 GetArchitecture  
 If ($Global:Architecture -eq "32-bit") {  
      UnpinFromStartMenu "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Outlook.lnk" "C:\Program Files\Microsoft Office\Office14\OUTLOOK.EXE"  
      UnpinFromStartMenu "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Word.lnk" "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"  
      UnpinFromStartMenu "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Excel.lnk" "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE"  
      UnpinFromStartMenu "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft PowerPoint.lnk" "C:\Program Files\Microsoft Office\Office14\POWERPNT.EXE"  
      UnpinFromStartMenu "eDocs DM" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Open Text eDocs Email Marker.lnk" "C:\Program Files\Open Text\Email Filing\DMMarkEmail.exe"  
      PinToStartMenu "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Outlook.lnk" "C:\Program Files\Microsoft Office\Office14\OUTLOOK.EXE"  
      PinToStartMenu "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Word.lnk" "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"  
      PinToStartMenu "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Excel.lnk" "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE"  
      PinToStartMenu "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft PowerPoint.lnk" "C:\Program Files\Microsoft Office\Office14\POWERPNT.EXE"  
      UnpinFromTaskbar "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Outlook 2010.lnk" "C:\Program Files\Microsoft Office\Office14\OUTLOOK.EXE"  
      UnpinFromTaskbar "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Word 2010.lnk" "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"  
      UnpinFromTaskbar "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Excel 2010.lnk" "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE"  
      UnpinFromTaskbar "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft PowerPoint 2010.lnk" "C:\Program Files\Microsoft Office\Office14\POWERPNT.EXE"  
      PinToTaskbar "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Outlook 2010.lnk" "C:\Program Files\Microsoft Office\Office14\OUTLOOK.EXE"  
      PinToTaskbar "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Word 2010.lnk" "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"  
      PinToTaskbar "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Excel 2010.lnk" "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE"  
      PinToTaskbar "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft PowerPoint 2010.lnk" "C:\Program Files\Microsoft Office\Office14\POWERPNT.EXE"  
 } else {  
      UnpinFromStartMenu "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Outlook.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE"  
      UnpinFromStartMenu "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Word.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE"  
      UnpinFromStartMenu "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Excel.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"  
      UnpinFromStartMenu "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft PowerPoint.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE"  
      PinToStartMenu "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Outlook.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE"  
      PinToStartMenu "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Word.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE"  
      PinToStartMenu "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft Excel.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"  
      PinToStartMenu "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Microsoft PowerPoint.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE"  
      UnpinFromTaskbar "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Outlook 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE"  
      UnpinFromTaskbar "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Word 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE"  
      UnpinFromTaskbar "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Excel 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"  
      UnpinFromTaskbar "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft PowerPoint 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE"  
      PinToTaskbar "Outlook" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Outlook 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE"  
      PinToTaskbar "Word" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Word 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE"  
      PinToTaskbar "Excel" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Excel 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE"  
      PinToTaskbar "PowerPoint" $Env:APPDATA"\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft PowerPoint 2010.lnk" "C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE"  
 }  
 

29 May 2014

PowerShell: Enable Wake-On-LAN

This script will enable WOL and test to make sure it has been set. It will return whether it was a success or failure both to a log file and the screen. This script was written to also be incorporated with my new build logging process that I am getting ready to release soon. If you do not want this, just delete the buildlog and sequence variables out, along with their use in the ProcessLogFile function.




 <#  
 .SYNOPSIS  
   Wake-On-LAN  
 .DESCRIPTION  
   Enable Wake-On-LAN  
 .PARAMETER <paramName>  
   <Description of script parameter>  
 .EXAMPLE  
   <An example of using the script>  
 #>  
 #Declare Global Memory  
 Set-Variable -Name AppLog -Scope Global -Force  
 Set-Variable -Name BuildLog -Scope Global -Force  
 Set-Variable -Name Errors -Value $null -Scope Global -Force  
 Set-Variable -Name LogFile -Scope Global -Force  
 Set-Variable -Name RelativePath -Scope Global -Force  
 Set-Variable -Name Sequence -Scope Global -Force  
 Set-Variable -Name Title -Scope Global -Force  
 Function ConsoleTitle ($Title){  
      $host.ui.RawUI.WindowTitle = $Title  
 }  
 Function DeclareGlobalVariables {  
      $Global:AppLog = "/lvx "+$Env:windir + "\Logs\ApplicationLogs\WakeOnLAN.log"  
      $Global:BuildLog = $Env:windir + "\Logs\BuildLogs\Build.log"  
      $Global:LogFile = $Env:windir + "\Logs\BuildLogs\WakeOnLAN.log"  
      $Global:Sequence = "08"  
      $Global:Title = "Wake On LAN"  
 }  
 Function GetRelativePath {   
      $Global:RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"   
 }  
 Function EnableWOL {  
      # Get all physical ethernet adaptors  
      $nics = Get-WmiObject Win32_NetworkAdapter -filter "AdapterTypeID = '0' `  
      AND PhysicalAdapter = 'true' `  
      AND NOT Description LIKE '%Centrino%' `  
      AND NOT Description LIKE '%wireless%' `  
      AND NOT Description LIKE '%virtual%' `  
      AND NOT Description LIKE '%WiFi%' `  
      AND NOT Description LIKE '%Bluetooth%'"  
      foreach ($nic in $nics) {  
           $nicName = $nic.Name  
           $Output = "NIC:"+$nicName+[char]10  
           Write-Host "NIC:"$nicName  
           $Output = $Output + "Allow the computer to turn off this device....."  
           Write-Host "Allow the computer to turn off this device....." -NoNewline  
           $nicPower = Get-WmiObject MSPower_DeviceEnable -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }  
           If ($nicPower.Enable -ne $True) {  
                $nicPower.Enable = $True  
                $Temp = $nicPower.psbase.Put()  
           }  
           If ($nicPower.Enable -eq $True) {  
                $Output = $Output + "Enabled"  
                Write-Host "Enabled" -ForegroundColor Yellow  
           } else {  
                $Output = $Output + "Failed"  
                Write-Host "Failed" -ForegroundColor Red  
           }  
           $Output = $Output + [char]10  
           $Output = $Output + "Allow this device to wake the computer....."  
           Write-Host "Allow this device to wake the computer....." -NoNewline  
           $nicPowerWake = Get-WmiObject MSPower_DeviceWakeEnable -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }  
           If ($nicPowerWake.Enable -ne $True) {  
                $nicPowerWake.Enable = $True  
                $Temp = $nicPowerWake.psbase.Put()  
           }  
           If ($nicPowerWake.Enable -eq $True) {  
                $Output = $Output + "Enabled"  
                Write-Host "Enabled" -ForegroundColor Yellow  
           } else {  
                $Output = $Output + "Failed"  
                Write-Host "Failed" -ForegroundColor Red  
           }  
           $Output = $Output + [char]10  
           $Output = $Output + "Only allow a magic packet to wake the computer....."  
           Write-Host "Only allow a magic packet to wake the computer....." -NoNewline  
           $nicMagicPacket = Get-WmiObject MSNdis_DeviceWakeOnMagicPacketOnly -Namespace root\wmi | where {$_.instancename -match [regex]::escape($nic.PNPDeviceID) }  
           If ($nicMagicPacket.EnableWakeOnMagicPacketOnly -ne $True) {  
                $nicMagicPacket.EnableWakeOnMagicPacketOnly = $True  
                $Temp = $nicMagicPacket.psbase.Put()  
           }  
           If ($nicMagicPacket.EnableWakeOnMagicPacketOnly -eq $True) {  
                $Output = $Output + "Enabled"  
                Write-Host "Enabled" -ForegroundColor Yellow  
           } else {  
                $Output = $Output + "Failed"  
                Write-Host "Failed" -ForegroundColor Red  
           }  
      }  
      Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force  
 }  
 Function ProcessLogFile {  
      If ((Test-Path $Env:windir"\Logs") -eq $false) {  
           New-Item -ItemType Directory -Path $Env:windir"\Logs"  
      }  
      If ((Test-Path $Env:windir"\Logs\ApplicationLogs") -eq $false) {  
           New-Item -ItemType Directory -Path $Env:windir"\Logs\ApplicationLogs"  
      }  
      If ((Test-Path $Env:windir"\Logs\BuildLogs") -eq $false) {  
           New-Item -ItemType Directory -Path $Env:windir"\Logs\BuildLogs"  
      }  
      If ($Global:Errors -eq $null) {  
           If (Test-Path $Global:LogFile) {  
                Remove-Item $Global:LogFile -Force  
           }  
           $File1 = $Global:LogFile.Split(".")  
           $Filename1 = $File1[0]+"_ERROR"+"."+$File1[1]  
           If (Test-Path $Filename1) {  
                Remove-Item $Filename1 -Force  
           }  
           $Global:Errors = 0  
      } elseIf ($Global:Errors -ne 0) {  
           If (Test-Path $Global:LogFile) {  
                $Global:LogFile.ToString()  
                $File1 = $Global:LogFile.Split(".")  
                $Filename1 = $File1[0]+"_ERROR"+"."+$File1[1]  
                Rename-Item $Global:LogFile -NewName $Filename1 -Force  
           }  
      } else {  
           $LogTitle = $Global:Sequence + " - "+$Global:Title  
           Out-File -FilePath $Global:BuildLog -InputObject $LogTitle -Append -Force  
      }  
 }  
 Function ExitPowerShell {  
      If ($Global:Errors -ne $null) {  
           Exit 1  
      }  
 }  
 cls  
 GetRelativePath  
 DeclareGlobalVariables  
 ConsoleTitle $Global:Title  
 ProcessLogFile  
 EnableWOL  
 ProcessLogFile  
 ExitPowerShell  
 Start-Sleep -Seconds 10  

22 May 2014

Executing Command Line on Remote Systems

I have been a huge fan of PsExec ever since I became and SCCM Administrator. The problem with PsExec is that it transmits credentials in clear text. There is a great alternative to this and it is PAExec. It is freeware and can be redistributed. It has all of the same functionality as PsExec with a few additional minor features. You can get the software at PowerAdmin.

02 May 2014

PowerShell: Enable or Disable Internet Explorer Active X Components

This script will enable or disable Internet Explorer Active X components. All you have to do is pass the user friendly name of the component, component's GUID, and the flag. The app will verify if the change actually takes place and returns a success or failure status.

You can download this from here.


<#
.SYNOPSIS
   Enable/Disable IE Active X Components
.DESCRIPTION
   
.PARAMETER <paramName>
   <Description of script parameter>
.EXAMPLE
   EnableIEActiveXControl "Application Name" "GUID" "Value"
   EnableIEActiveXControl "Flash for IE" "{D27CDB6E-AE6D-11CF-96B8-444553540000}" "0x00000000"
#>

#Declare Global Memory
Set-Variable -Name Errors -Value $null -Scope Global -Force
Set-Variable -Name LogFile -Value "c:\windows\waller\Logs\BuildLogs\AdobeFlashPlayer.log" -Scope Global -Force
Set-Variable -Name RelativePath -Scope Global -Force

Function ConsoleTitle ($Title){
    $host.ui.RawUI.WindowTitle = $Title
}

Function GetRelativePath { 
    $Global:RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\" 
}

Function DisableIEActiveXControl ($AppName,$GUID,$Flag) {
    $Key = "HKLM:\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility\"+$GUID
    If ((Test-Path $Key) -eq $true) {
        Write-Host $AppName"....." -NoNewline
        Set-ItemProperty -Path $Key -Name "Compatibility Flags" -Value $Flag -Force
        $Var = Get-ItemProperty -Path $Key -Name "Compatibility Flags"
        If ($Var."Compatibility Flags" -eq 1024) {
            Write-Host "Disabled" -ForegroundColor Yellow
        } else {
            Write-Host "Enabled" -ForegroundColor Red
        }
    }
}

Function EnableIEActiveXControl ($AppName,$GUID,$Flag) {
    $Key = "HKLM:\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility\"+$GUID
    If ((Test-Path $Key) -eq $true) {
        Write-Host $AppName"....." -NoNewline
        Set-ItemProperty -Path $Key -Name "Compatibility Flags" -Value $Flag -Force
        $Var = Get-ItemProperty -Path $Key -Name "Compatibility Flags"
        If ($Var."Compatibility Flags" -eq 0) {
            Write-Host "Enabled" -ForegroundColor Yellow
        } else {
            Write-Host "Disabled" -ForegroundColor Red
        }
    }
}

cls
#DisableIEActiveXControl "Flash for IE" "{D27CDB6E-AE6D-11CF-96B8-444553540000}" "0x00000400"
EnableIEActiveXControl "Flash for IE" "{D27CDB6E-AE6D-11CF-96B8-444553540000}" "0x00000000"
Start-Sleep -Seconds 5

01 May 2014

PowerShell: Installing Dell CCTK and Configuring BIOS Settings

This script will install the Dell CCTK and set specified BIOS settings. Unlike the CCTK that allows you to create a multiplatform file to run against any Dell model machine, this script takes a different approach so that there is a description, logging, and verification of each BIOS setting. This script will first install the CCTK that needs to be in the same directory as the script. It then executes the CCTKSetting function that allows for you to enter each desired setting. There are four variables passed into the function. The first is a description. The second is the actual name of the BIOS setting. The third is the desired value for the setting. Finally, the fourth is only for the bootorder setting. There has to be an additional value passed for this setting.

When executed, the script writes both to the screen and a log file the settings that were changed. Since this is a multiplatform, I have included a return message "unavailable" for those settings not present of the machine this was executed on.

NOTE: If you use this script in a build process and make changes to embsataraid, the OS will likely fail to load. This setting has to be changed before the OS is layed down.

You can download this script here.


<#
.Author
   Mick Pletcher
.Date
   01 May 2014
.SYNOPSIS
   Dell Client Configuration Toolkit
.DESCRIPTION
   Installs CCTK
.PARAMETER <paramName>
   <Description of script parameter>
.EXAMPLE
   <An example of using the script>
#>

#Declare Global Memory
Set-Variable -Name Errors -Value $null -Scope Global -Force
Set-Variable -Name LogFile -Value $Env:windir"\Logs\BuildLogs\CCTK.log" -Scope Global -Force
Set-Variable -Name BuildLog -Value $Env:windir"\Logs\BuildLogs\Build.log" -Scope Global -Force
Set-Variable -Name RelativePath -Scope Global -Force

Function ConsoleTitle ($Title){
    $host.ui.RawUI.WindowTitle = $Title
}

Function GetRelativePath { 
    $Global:RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\" 
}

Function InstallCCTK {
    $MSI = "/i "+[char]34+$Global:RelativePath+"cctk.msi"+[char]34
    $Switches = [char]32+"/qb- /norestart /lvx C:\Windows\logs\ApplicationLogs\CCTK.log"
    $Argument = $MSI+$Switches
    $Output = "Install CCTK....."
    Write-Host "Install CCTK....." -NoNewline
    $ErrCode = (Start-Process -FilePath msiexec.exe -ArgumentList $Argument -Wait -Passthru).ExitCode
    If ($ErrCode -eq 0) {
        $Output = $Output+"Success"
        Write-Host "Success" -ForegroundColor Yellow
    } else {
        $Output = $Output+"Failed with error code "+$ErrCode
        Write-Host "Failed with error code "$ErrCode -ForegroundColor Red
        $Global:Errors++
    }
    Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force
}

Function CCTKSetting ($Name,$Option,$Setting,$Drives) {
    $EXE = $Env:PROGRAMFILES+"\Dell\CCTK\X86\cctk.exe"
    If ($Option -ne "bootorder") {
        $Argument = "--"+$Option+"="+$Setting
    } else {
        $Argument = "bootorder"+[char]32+"--"+$Setting+"="+$Drives
    }
    $Output = $Name+"....."
    Write-Host $Name"....." -NoNewline
    $ErrCode = (Start-Process -FilePath $EXE -ArgumentList $Argument -Wait -Passthru).ExitCode
    If ($ErrCode -eq 0) {
        If ($Drives -eq "") {
            $Output = $Output+$Setting
            Write-Host $Setting -ForegroundColor Yellow
        } else {
            $Output = $Output+$Drives
            Write-Host $Drives -ForegroundColor Yellow
        }
    } elseIf ($ErrCode -eq 119) {
        $Output = $Output+"Unavailable"
        Write-Host "Unavailable" -ForegroundColor Green
    } else {
        $Output = $Output+"Failed with error code "+$ErrCode
        Write-Host "Failed with error code "$ErrCode -ForegroundColor Red
        $Global:Errors++
    }
    Out-File -FilePath $Global:LogFile -InputObject $Output -Append -Force
}

Function ProcessLogFile {
    If ((Test-Path $Env:windir"\logs") -eq $false) {
        New-Item -ItemType Directory -Path $Env:windir"\logs"
    }
    If ((Test-Path $Env:windir"\Logs\BuildLogs") -eq $false) {
        New-Item -ItemType Directory -Path $Env:windir"\Logs\BuildLogs"
    }
    If ((Test-Path $Env:windir"\Logs\ApplicationLogs") -eq $false) {
        New-Item -ItemType Directory -Path $Env:windir"\Logs\ApplicationLogs"
    }
    If ($Global:Errors -eq $null) {
        If (Test-Path $Global:LogFile) {
            Remove-Item $Global:LogFile -Force
        }
        $File1 = $Global:LogFile.Split(".")
        $Filename1 = $File1[0]+"_ERROR"+"."+$File1[1]
        If (Test-Path $Filename1) {
            Remove-Item $Filename1 -Force
        }
        $Global:Errors = 0
    } elseIf ($Global:Errors -ne 0) {
        If (Test-Path $Global:LogFile) {
            $Global:LogFile.ToString()
            $File1 = $Global:LogFile.Split(".")
            $Filename1 = $File1[0]+"_ERROR"+"."+$File1[1]
            Rename-Item $Global:LogFile -NewName $Filename1 -Force
        }
    } else {
        Out-File -FilePath $Global:BuildLog -InputObject "08-Dell Client Configuration Toolkit" -Append -Force
    }
}

cls
ConsoleTitle "Dell Client Configuration Toolkit"
GetRelativePath
ProcessLogFile
InstallCCTK
CCTKSetting "PowerLoss" "acpower" "last" ""
CCTKSetting "Advanced Battery Charge" "advbatterychargecfg" "enable" ""
CCTKSetting "On-Board AGP Slot" "agpslot" "enable" ""
CCTKSetting "Resume from Suspended Mode" "alarmresume" "enable" ""
CCTKSetting "Ambient Light Sensor" "amblightsen" "enable" ""
CCTKSetting "Auto On" "autoon" "disable" ""
CCTKSetting "Battery Charge" "batteryslicecfg" "express" ""
CCTKSetting "Bluetooth Devices" "bluetoothdevice" "enable" ""
CCTKSetting "Camera" "camera" "enable" ""
CCTKSetting "Cellular Radio" "cellularradio" "enable" ""
CCTKSetting "Chassis Intrustion" "chasintrusion" "disable" ""
CCTKSetting "Clear BIOS Event Log" "clearsel" "yes" ""
CCTKSetting "Disable WiFi for Ethernet" "controlwwanradio" "enable" ""
CCTKSetting "CPU eXecute Disable" "cpuxdsupport" "disable" ""
CCTKSetting "C states" "cstatesctrl" "enable" ""
CCTKSetting "System Power Mode" "deepsleepctrl" "disable" ""
CCTKSetting "Dell Reliable Memory Technology" "drmt" "enable" ""
CCTKSetting "Built-in NIC" "embnic1" "on" ""
CCTKSetting "Embedded SATA RAID Controller" "embsataraid" "raid" ""
CCTKSetting "Embedded SD Card" "embsdcard" "on" ""
CCTKSetting "Energy Star logo" "energystarlogo" "enable" ""
CCTKSetting "Serial ATA (e-sata) port" "esataport" "auto" ""
CCTKSetting "Express Battery Charge" "expresscharge" "enable" ""
CCTKSetting "Fastboot" "fastboot" "automatic" ""
CCTKSetting "Ready Boost" "flashcachemodule" "enable" ""
CCTKSetting "HDD Acoustic Mode" "hddacousticmode" "performance" ""
CCTKSetting "HDD Protection" "hddprotection" "on" ""
CCTKSetting "HDD Free Fall Protection" "hdfreefallprotect" "enable" ""
CCTKSetting "Hot Docking" "hotdock" "enable" ""
CCTKSetting "WxAN Hotkey" "htkeywxanradio" "enable" ""
CCTKSetting "CPU Hardware Prefetcher" "hwprefetcher" "enable" ""
CCTKSetting "Hardware Prefetcher" "hwswprefetch" "enable" ""
CCTKSetting "CD drive" "idecdrom" "auto" ""
CCTKSetting "Latitude ON" "instanton" "disable" ""
CCTKSetting "Integrated Sound Device" "integratedaudio" "enable" ""
CCTKSetting "Integrated USB Hub" "integratedusbhub" "highspeed" ""
CCTKSetting "Internal Mini PCI Slot" "internalminipci" "enable" ""
CCTKSetting "Internal USB Ports" "internalusb" "on" ""
CCTKSetting "Ultra Wide Band (UWB) Card" "interwirelessuwb" "enable" ""
CCTKSetting "Intel Rapid Start Technology" "intlrapidstart" "enable" ""
CCTKSetting "Intel Smart Connect" "intlsmartconnect" "disable" ""
CCTKSetting "Keyboard Click Sound" "keyboardclick" "enable" ""
CCTKSetting "Keyboard Illumination" "keyboardillumination" "auto" ""
CCTKSetting "Booting to Latitude ON" "latitudeon" "disable" ""
CCTKSetting "Ability to boot to the Latitude ON" "latitudeonflash" "disable" ""
CCTKSetting "Limit Maximum CPUID Function" "limitcpuidvalue" "off" ""
CCTKSetting "Hyper Threading" "logicproc" "enable" ""
CCTKSetting "Microphone" "microphone" "enable" ""
CCTKSetting "Multiple CPU Cores" "multicpucore" "enable" ""
CCTKSetting "Multiple Displays" "multidisplay" "enable" ""
CCTKSetting "Number Lock" "numlock" "on" ""
CCTKSetting "Onboard 1394 Controller" "onboard1394" "enable" ""
CCTKSetting "Onboard Modem" "onboardmodem" "enable" ""
CCTKSetting "Onreader" "onreader" "disable" ""
CCTKSetting "PCI Slots" "pcislots" "enable" ""
CCTKSetting "<F12> boot menu" "postf12key" "enable" ""
CCTKSetting "<F2> boot menu" "postf2key" "enable" ""
CCTKSetting "MEBx hotkey" "postmebxkey" "on" ""
CCTKSetting "Power Button" "powerbutton" "enable" ""
CCTKSetting "Primary Battery Charging" "primarybatterycfg" "express" ""
CCTKSetting "Primary IDE Master Channel" "primidemast" "auto" ""
CCTKSetting "Primary Parallel IDE Slave Channel" "primideslav" "auto" ""
CCTKSetting "Rear Single USB Ports" "rearsingleusb" "on" ""
CCTKSetting "Report Keyboard Errors" "rptkeyerr" "enable" ""
CCTKSetting "Selective USB feature" "safeusb" "disable" ""
CCTKSetting "SATA port 0" "sata0" "auto" ""
CCTKSetting "SATA port 1" "sata1" "auto" ""
CCTKSetting "SATA port 2" "sata2" "auto" ""
CCTKSetting "SATA port 3" "sata3" "auto" ""
CCTKSetting "SATA port 4" "sata4" "auto" ""
CCTKSetting "SATA port 5" "sata5" "auto" ""
CCTKSetting "SATA port 6" "sata6" "auto" ""
CCTKSetting "SATA port 7" "sata7" "auto" ""
CCTKSetting "SATA Controllers" "satactrl" "enable" ""
CCTKSetting "Serial Port 1" "serial1" "auto" ""
CCTKSetting "Serial Port 2" "serial2" "auto" ""
CCTKSetting "Serial Port Communication" "serialcomm" "on" ""
CCTKSetting "Smart Card Reader" "smartcardreader" "enable" ""
CCTKSetting "SMART Errors" "smarterrors" "enable" ""
CCTKSetting "Built-In Speaker" "speakervol" "enable" ""
CCTKSetting "Speedstep" "speedstep" "automatic" ""
CCTKSetting "POST Splash Screen" "splashscreen" "enable" ""
CCTKSetting "ACPI Standby State" "standbystate" "s3" ""
CCTKSetting "Tablet Buttons" "tabletbuttons" "enable" ""
CCTKSetting "Trusted Execution" "trustexecution" "off" ""
CCTKSetting "Intel Turbo Boost" "turbomode" "enable" ""
CCTKSetting "USB 3.0" "usb30" "enable" ""
CCTKSetting "USB port 00" "usbport00" "enable" ""
CCTKSetting "USB port 01" "usbport01" "enable" ""
CCTKSetting "USB port 02" "usbport02" "enable" ""
CCTKSetting "USB port 03" "usbport03" "enable" ""
CCTKSetting "USB port 04" "usbport04" "enable" ""
CCTKSetting "USB port 05" "usbport05" "enable" ""
CCTKSetting "USB port 06" "usbport06" "enable" ""
CCTKSetting "USB port 07" "usbport07" "enable" ""
CCTKSetting "USB port 08" "usbport08" "enable" ""
CCTKSetting "USB port 09" "usbport09" "enable" ""
CCTKSetting "USB port 10" "usbport10" "enable" ""
CCTKSetting "USB port 11" "usbport11" "enable" ""
CCTKSetting "USB port 12" "usbport12" "enable" ""
CCTKSetting "USB port 13" "usbport13" "enable" ""
CCTKSetting "USB port 14" "usbport14" "enable" ""
CCTKSetting "USB port 15" "usbport15" "enable" ""
CCTKSetting "User Accessible USB ports" "usbports" "enable" ""
CCTKSetting "External USB Ports" "usbportsexternal" "enable" ""
CCTKSetting "Front USB Ports" "usbportsfront" "enable" ""
CCTKSetting "USB PowerShare" "usbpowershare" "enable" ""
CCTKSetting "USB Rear Dual Stack" "usbreardual" "on" ""
CCTKSetting "USB Second Rear Dual Stack" "usbreardual2stack" "on" ""
CCTKSetting "USB Rear Quad Ports" "usbrearquad" "on" ""
CCTKSetting "USB Wake" "usbwake" "disable" ""
CCTKSetting "Virtualization" "virtualization" "enable" ""
CCTKSetting "Virtualization Technology for Direct I/O" "vtfordirectio" "on" ""
CCTKSetting "Wake-on-LAN" "wakeonlan" "lanorwlan" ""
CCTKSetting "WiFi Locator" "wifilocator" "enable" ""
CCTKSetting "Wireless Adapter" "wirelessadapter" "enable" ""
CCTKSetting "Wireless LAN Module" "wirelesslan" "enable" ""
CCTKSetting "Ultra Wide Band (UWB) Switch" "wirelessuwb" "enable" ""
CCTKSetting "Bluetooth Control Switch" "wirelesswitchbluetoothctrl" "enable" ""
CCTKSetting "Cellular Control Switch" "wirelesswitchcellularctrl" "enable" ""
CCTKSetting "Wireless Gigabit Switch" "wirelesswitchwigigctrl" "enable" ""
CCTKSetting "Disable Floppy" "bootorder" "disabledevice" "floppy"
CCTKSetting "Boot Order" "bootorder" "sequence" "hdd.1,hdd.2,cdrom,usbdev,embnic"
ProcessLogFile
Start-Sleep -Seconds 10