<#
DISCLAIMER:
These pattern scripts are not supported underneath any Lenovo commonplace help
program or service. The pattern scripts are supplied AS IS with out guarantee
of any form. Lenovo additional disclaims all implied warranties together with,
with out limitation, any implied warranties of merchantability or of health for
a explicit objective. The whole danger arising out of the use or efficiency of
the pattern scripts and documentation stays with you. In no occasion shall
Lenovo, its authors, or anybody else concerned in the creation, manufacturing, or
supply of the scripts be liable for any damages in anyway (together with,
with out limitation, damages for loss of enterprise earnings, enterprise interruption,
loss of enterprise data, or different pecuniary loss) arising out of the use
of or lack of ability to use the pattern scripts or documentation, even if Lenovo
has been suggested of the risk of such damages.
#>
<#
.SYNOPSIS
Script to set up and configure Lenovo System Replace.
.DESCRIPTION
Script will set up Lenovo System Replace and set the obligatory registry subkeys and values that downloads/installs
reboot sort 3 packages on the system. Sure UI settings are configured for an optimum finish person expertise.
The default Scheduled Process created by System Replace will be disabled. A customized Scheduled Process for System Replace will be created.
#>
##### Set up System Replace
$pkg = “system_update_5.07.0110“
$switches = “/verysilent /norestart“
Begin-Course of “.$pkg“ –ArgumentList $switches –Wait
##### Set SU AdminCommandLine
$RegKey = “HKLM:SOFTWAREPoliciesLenovoSystem UpdateUserSettingsGeneral“
$RegName = “AdminCommandLine“
$RegValue = “/CM -search A -action INSTALL -includerebootpackages 3 -noicon -noreboot -exporttowmi“
# Create Subkeys if they do not exist
if (!(Take a look at-Path $RegKey)) Out-Null
New-ItemProperty –Path $RegKey –Title $RegName –Worth $RegValue
else Out-Null
##### Configure SU interface
$ui = “HKLM:SOFTWAREWOW6432NodeLenovoSystem UpdatePreferencesUserSettingsGeneral“
$values = @{
“AskBeforeClosing“ = “NO“
“DisplayLicenseNotice“ = “NO“
“MetricsEnabled“ = “NO“
“DebugEnable“ = “YES“
}
if (Take a look at-Path $ui) {
foreach ($merchandise in $values.GetEnumerator() ) {
New-ItemProperty –Path $ui –Title $merchandise.Key –Worth $merchandise.Worth –Drive
}
}
<#
Run SU and wait till the Tvsukernel course of finishes.
As soon as the Tvsukernel ends, Autopilot circulate will proceed.
#>
$su = Be part of-Path –Path ${env:ProgramFiles(x86)} –ChildPath “LenovoSystem Updatetvsu.exe“
&$su /CM | Out-Null
Wait-Course of –Title Tvsukernel
# Disable the default System Replace scheduled duties
Get-ScheduledTask –TaskPath “TVT“ | Disable-ScheduledTask
##### Disable Scheduler Capacity.
# This will stop System Replace from creating the default scheduled duties when updating to future releases.
$sa = “HKLM:SOFTWAREWOW6432NodeLenovoSystem UpdatePreferencesUserSettingsScheduler“
Set-ItemProperty –Path $sa –Title “SchedulerAbility“ –Worth “NO“
##### Create a customized scheduled process for System Replace
$taskAction = New-ScheduledTaskAction –Execute $su –Argument ‘/CM‘
$taskTrigger = New-ScheduledTaskTrigger –Weekly –DaysOfWeek Monday –At 9am
$taskUserPrincipal = New-ScheduledTaskPrincipal –UserId ‘SYSTEM‘
$taskSettings = New-ScheduledTaskSettingsSet –Compatibility Win8
$process = New-ScheduledTask –Motion $taskAction –Principal $taskUserPrincipal –Set off $taskTrigger –Settings $taskSettings
Register-ScheduledTask –TaskName ‘Run-TVSU‘ –InputObject $process –Drive