Added Files
This commit is contained in:
@@ -0,0 +1,520 @@
|
||||
#requires -Version 5.0 -Modules BitsTransfer, CimCmdlets -RunAsAdministrator
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Install manufacturer/vendor specific software
|
||||
|
||||
.DESCRIPTION
|
||||
Install manufacturer/vendor specific software
|
||||
For now, just HP is supported.
|
||||
|
||||
.NOTES
|
||||
The OEM Info is no longer displayed in newer Builds of Windows 10!
|
||||
Starting with Windows 10 Build 20H2 the Logo and other OEM Info is no longer displayed.
|
||||
Focus will be the installation of Tools to support the vendor specific drivers and tooling
|
||||
|
||||
Request:
|
||||
If you are interessted in Dell or Lenovo support, please open a issue/ticket.
|
||||
We look for pilot/beta users, due to missing hardware the development is a bit hard.
|
||||
|
||||
Changelog:
|
||||
1.0.7: Download the latest HP versions and install it silently
|
||||
1.0.6: Fallback to older HP Support Assistant version (Due to Silent Install Issues)
|
||||
1.0.5: Moved the installer path
|
||||
1.0.4: Rewrite big parts and create a cleanup helper
|
||||
1.0.3: Replace old WMI call with CIM - Fix Write-Output
|
||||
1.0.2: Update HP tooling (Files)
|
||||
1.0.1: Update Lenovo tooling (Files)
|
||||
|
||||
Version 1.0.7
|
||||
|
||||
.LINK
|
||||
http://enatec.io
|
||||
#>
|
||||
[CmdletBinding(ConfirmImpact = 'Low')]
|
||||
param ()
|
||||
|
||||
begin
|
||||
{
|
||||
Write-Output -InputObject 'Manufacturer specific config and software installation'
|
||||
|
||||
#region Defaults
|
||||
$SCT = 'SilentlyContinue'
|
||||
$STP = 'Stop'
|
||||
|
||||
# Splat the defaults
|
||||
$paramSimpleDefaults = @{
|
||||
ErrorAction = $SCT
|
||||
WarningAction = $SCT
|
||||
}
|
||||
|
||||
# Change this, if needed
|
||||
$Company = 'enabling Technology'
|
||||
|
||||
# Do not change this!
|
||||
$RegistryPath = ('HKLM:\Software\' + $Company + '\BaseImage')
|
||||
|
||||
# Get the Info
|
||||
$Manufacturer = (Get-ItemPropertyValue -Path $RegistryPath -Name HardwareManufacturer @paramSimpleDefaults)
|
||||
|
||||
# Set the Path Info
|
||||
$OemInfoPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation'
|
||||
|
||||
# Read the Info from CIM
|
||||
$ManufacturerModel = ((Get-CimInstance -ClassName Win32_Computersystem @paramSimpleDefaults) | Select-Object -ExpandProperty Model)
|
||||
|
||||
$null = (Set-MpPreference -EnableControlledFolderAccess Disabled -Force @paramSimpleDefaults)
|
||||
|
||||
|
||||
if (-not $ManufacturerModel)
|
||||
{
|
||||
$ManufacturerModel = 'Unknown'
|
||||
}
|
||||
|
||||
if ($Manufacturer)
|
||||
{
|
||||
switch ($Manufacturer)
|
||||
{
|
||||
'HP'
|
||||
{
|
||||
$ManufacturerTooling = 'HP'
|
||||
}
|
||||
'Hewlett-Packard'
|
||||
{
|
||||
$ManufacturerTooling = 'HP'
|
||||
}
|
||||
'Dell'
|
||||
{
|
||||
$ManufacturerTooling = 'Dell'
|
||||
Write-Warning -Message 'Dell support is in still in development'
|
||||
}
|
||||
'LENOVO'
|
||||
{
|
||||
$ManufacturerTooling = 'LENOVO'
|
||||
Write-Warning -Message 'Lenovo support is in still in development'
|
||||
}
|
||||
'Microsoft Corporation'
|
||||
{
|
||||
$ManufacturerTooling = 'HYPERV'
|
||||
Write-Warning -Message 'Microsoft Hyper-V is not (yet) supported, but planned'
|
||||
Return
|
||||
}
|
||||
'VMware, Inc.'
|
||||
{
|
||||
$ManufacturerTooling = 'VMware'
|
||||
Write-Warning -Message 'VMware is not (yet) supported'
|
||||
Return
|
||||
}
|
||||
'Parallels Software International Inc.'
|
||||
{
|
||||
$ManufacturerTooling = 'Parallels'
|
||||
Write-Warning -Message 'Parallels is not (yet) supported'
|
||||
Return
|
||||
}
|
||||
Default
|
||||
{
|
||||
$ManufacturerTooling = $null
|
||||
Write-Warning -Message 'Unknown and/or unsupported manufacturer'
|
||||
Return
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$ManufacturerTooling = $null
|
||||
Write-Warning -Message 'Unknown and/or unsupported manufacturer'
|
||||
Return
|
||||
}
|
||||
|
||||
# Splat the defaults for New-ItemProperty
|
||||
$paramNewItemProperty = @{
|
||||
Path = $OemInfoPath
|
||||
PropertyType = 'String'
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WhatIf = $false
|
||||
ErrorAction = $SCT
|
||||
WarningAction = $SCT
|
||||
}
|
||||
|
||||
# Splat the defaults for Copy-Item
|
||||
$paramCopyItem = @{
|
||||
Destination = "$env:windir\SYSTEM32\SYSTEM.BMP"
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
ErrorAction = $SCT
|
||||
WarningAction = $SCT
|
||||
}
|
||||
#endregion Defaults
|
||||
|
||||
#region RemoveOEMInfo
|
||||
function Remove-OEMInfo
|
||||
{
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Cleanup the OEM Info
|
||||
|
||||
.DESCRIPTION
|
||||
Cleanup the OEM Info from the registry
|
||||
|
||||
.PARAMETER Path
|
||||
The Registry Path
|
||||
|
||||
.EXAMPLE
|
||||
PS C:\> Remove-OEMInfo
|
||||
|
||||
.EXAMPLE
|
||||
PS C:\> Remove-OEMInfo -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation'
|
||||
|
||||
.NOTES
|
||||
Internal Helper
|
||||
#>
|
||||
[CmdletBinding(ConfirmImpact = 'None',
|
||||
SupportsShouldProcess)]
|
||||
param
|
||||
(
|
||||
[Parameter(ValueFromPipeline,
|
||||
ValueFromPipelineByPropertyName,
|
||||
Position = 0)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias('OemInfoPath')]
|
||||
[string]
|
||||
$Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation'
|
||||
)
|
||||
|
||||
begin
|
||||
{
|
||||
#region Defaults
|
||||
$SCT = 'SilentlyContinue'
|
||||
#endregion Defaults
|
||||
|
||||
#region
|
||||
$ValuesToClean = @(
|
||||
'Model'
|
||||
'Manufacturer'
|
||||
'Logo'
|
||||
'SupportAppURL'
|
||||
'SupportURL'
|
||||
'SupportHours'
|
||||
'SupportPhone'
|
||||
)
|
||||
#endregion
|
||||
}
|
||||
|
||||
process
|
||||
{
|
||||
if ($pscmdlet.ShouldProcess('OEM Info', 'Delete'))
|
||||
{
|
||||
# Cleanup the OEM Info
|
||||
foreach ($ValueToClean in $ValuesToClean)
|
||||
{
|
||||
$paramGetItemPropertyValue = @{
|
||||
Path = $Path
|
||||
Name = $ValueToClean
|
||||
ErrorAction = $SCT
|
||||
WarningAction = $SCT
|
||||
}
|
||||
|
||||
if (Get-ItemPropertyValue @paramGetItemPropertyValue)
|
||||
{
|
||||
$paramRemoveItemProperty = @{
|
||||
Path = $Path
|
||||
Name = $ValueToClean
|
||||
Force = $true
|
||||
WhatIf = $false
|
||||
ErrorAction = $SCT
|
||||
WarningAction = $SCT
|
||||
Confirm = $false
|
||||
}
|
||||
$null = (Remove-ItemProperty @paramRemoveItemProperty)
|
||||
}
|
||||
|
||||
$ValueToClean = $null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion RemoveOEMInfo
|
||||
}
|
||||
|
||||
process
|
||||
{
|
||||
#region HP
|
||||
if ($ManufacturerTooling -eq 'HP')
|
||||
{
|
||||
# Cleanup the OEM Info
|
||||
$null = (Remove-OEMInfo @paramSimpleDefaults)
|
||||
|
||||
# Copy the OEM Logo
|
||||
if (Test-Path -Path "$env:HOMEDRIVE\install\ManufacturerSpecific\hp\SYSTEM.BMP" @paramSimpleDefaults)
|
||||
{
|
||||
$null = (Copy-Item -Path "$env:HOMEDRIVE\install\ManufacturerSpecific\hp\SYSTEM.BMP" @paramCopyItem)
|
||||
}
|
||||
|
||||
# Set the new OEM Info
|
||||
if ($ManufacturerModel)
|
||||
{
|
||||
$null = (New-ItemProperty -Name 'Model' -Value $ManufacturerModel @paramNewItemProperty)
|
||||
}
|
||||
|
||||
$null = (New-ItemProperty -Name 'Manufacturer' -Value 'HP Inc.' @paramNewItemProperty)
|
||||
$null = (New-ItemProperty -Name 'Logo' -Value 'C:\\WINDOWS\\SYSTEM32\\SYSTEM.BMP' @paramNewItemProperty)
|
||||
$null = (New-ItemProperty -Name 'SupportAppURL' -Value 'hpsupportassistant://GetAssist?LaunchPoint=51' @paramNewItemProperty)
|
||||
$null = (New-ItemProperty -Name 'SupportURL' -Value 'http://support.hp.com' @paramNewItemProperty)
|
||||
|
||||
# Install the HP Tools
|
||||
#region HPDefaults
|
||||
$BitsTransferPolicy = 'Always'
|
||||
$BitsTransferPriority = 'High'
|
||||
$HPSilentSwitchesExtractDefault = '/s /e /f'
|
||||
$HPSilentSwitchesDefault = '/s /a /s /v" /qn"'
|
||||
$PowerShellExecutable = ($PSHome + '\powershell.exe')
|
||||
$ErrorMessage = 'Installer not found!'
|
||||
$DriverTempDir = "$env:HOMEDRIVE\install\temp"
|
||||
#endregion HPDefaults
|
||||
|
||||
#region sp108770
|
||||
$paramTestPath = @{
|
||||
Path = $DriverTempDir
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (-not (Test-Path @paramTestPath))
|
||||
{
|
||||
$paramNewItem = @{
|
||||
Path = $DriverTempDir
|
||||
ItemType = 'Directory'
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
}
|
||||
$null = (New-Item @paramNewItem)
|
||||
}
|
||||
|
||||
$RequestContent = 'https://ftp.hp.com/pub/softpaq/sp108501-109000/sp108770.exe'
|
||||
|
||||
$DriverExtractDest = "$env:HOMEDRIVE\install\sp108770"
|
||||
|
||||
$paramTestPath = @{
|
||||
Path = $DriverExtractDest
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (-not (Test-Path @paramTestPath))
|
||||
{
|
||||
$paramNewItem = @{
|
||||
Path = $DriverExtractDest
|
||||
ItemType = 'Directory'
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
}
|
||||
$null = (New-Item @paramNewItem)
|
||||
}
|
||||
|
||||
[string]$Installer = ($DriverTempDir + '\sp108770.exe')
|
||||
|
||||
$paramTestPath = @{
|
||||
Path = $Installer
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (-not (Test-Path @paramTestPath))
|
||||
{
|
||||
# Use BitsTransfer to download the latest installer
|
||||
$paramStartBitsTransfer = @{
|
||||
Source = $RequestContent
|
||||
Destination = $Installer
|
||||
Priority = $BitsTransferPriority
|
||||
TransferPolicy = $BitsTransferPolicy
|
||||
ErrorAction = $STP
|
||||
}
|
||||
$null = (Start-BitsTransfer @paramStartBitsTransfer)
|
||||
}
|
||||
|
||||
$HPSilentSwitchesExtract = ($HPSilentSwitchesExtractDefault + ' "' + $DriverExtractDest + '"')
|
||||
$paramStartProcess = @{
|
||||
FilePath = $PowerShellExecutable
|
||||
WorkingDirectory = $DriverExtractDest
|
||||
ArgumentList = ($Installer + ' ' + $HPSilentSwitchesExtract)
|
||||
NoNewWindow = $true
|
||||
Wait = $true
|
||||
}
|
||||
$null = (Start-Process @paramStartProcess)
|
||||
|
||||
$HPInstaller = ($DriverExtractDest + '\InstallHPSA.exe')
|
||||
|
||||
$paramTestPath = @{
|
||||
Path = $HPInstaller
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (Test-Path @paramTestPath)
|
||||
{
|
||||
$HPSilentSwitches = $HPSilentSwitchesDefault
|
||||
$paramStartProcess = @{
|
||||
FilePath = $PowerShellExecutable
|
||||
WorkingDirectory = $DriverExtractDest
|
||||
ArgumentList = ($HPInstaller + ' ' + $HPSilentSwitches)
|
||||
NoNewWindow = $true
|
||||
Wait = $true
|
||||
}
|
||||
$null = (Start-Process @paramStartProcess)
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Warning -Message $ErrorMessage
|
||||
}
|
||||
#endregion sp108770
|
||||
|
||||
#region sp107493
|
||||
$RequestContent = 'https://ftp.hp.com/pub/softpaq/sp107001-107500/sp107493.exe'
|
||||
|
||||
$DriverExtractDest = "$env:HOMEDRIVE\install\sp107493"
|
||||
|
||||
$paramTestPath = @{
|
||||
Path = $DriverExtractDest
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (-not (Test-Path @paramTestPath))
|
||||
{
|
||||
$paramNewItem = @{
|
||||
Path = $DriverExtractDest
|
||||
ItemType = 'Directory'
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
}
|
||||
$null = (New-Item @paramNewItem)
|
||||
}
|
||||
|
||||
[string]$Installer = ($DriverTempDir + '\sp107493.exe')
|
||||
|
||||
$paramTestPath = @{
|
||||
Path = $Installer
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (-not (Test-Path @paramTestPath))
|
||||
{
|
||||
# Use BitsTransfer to download the latest installer
|
||||
$paramStartBitsTransfer = @{
|
||||
Source = $RequestContent
|
||||
Destination = $Installer
|
||||
Priority = $BitsTransferPriority
|
||||
TransferPolicy = $BitsTransferPolicy
|
||||
ErrorAction = $STP
|
||||
}
|
||||
$null = (Start-BitsTransfer @paramStartBitsTransfer)
|
||||
}
|
||||
|
||||
$HPSilentSwitchesExtract = ($HPSilentSwitchesExtractDefault + ' "' + $DriverExtractDest + '"')
|
||||
$paramStartProcess = @{
|
||||
FilePath = $PowerShellExecutable
|
||||
WorkingDirectory = $DriverExtractDest
|
||||
ArgumentList = ($Installer + ' ' + $HPSilentSwitchesExtract)
|
||||
NoNewWindow = $true
|
||||
Wait = $true
|
||||
}
|
||||
$null = (Start-Process @paramStartProcess)
|
||||
|
||||
$HPInstaller = ($DriverExtractDest + '\InstallCmdWrapper.exe')
|
||||
|
||||
$paramTestPath = @{
|
||||
Path = $HPInstaller
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (Test-Path @paramTestPath)
|
||||
{
|
||||
$HPSilentSwitches = $HPSilentSwitchesDefault
|
||||
$paramStartProcess = @{
|
||||
FilePath = $PowerShellExecutable
|
||||
WorkingDirectory = $DriverExtractDest
|
||||
ArgumentList = ($HPInstaller + ' ' + $HPSilentSwitches)
|
||||
NoNewWindow = $true
|
||||
Wait = $true
|
||||
}
|
||||
$null = (Start-Process @paramStartProcess)
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Warning -Message $ErrorMessage
|
||||
}
|
||||
#endregion sp107493
|
||||
}
|
||||
#endregion HP
|
||||
|
||||
#region LENOVO
|
||||
if ($ManufacturerTooling -eq 'LENOVO')
|
||||
{
|
||||
# Cleanup the OEM Info
|
||||
$null = (Remove-OEMInfo @paramSimpleDefaults)
|
||||
|
||||
# Copy the OEM Logo
|
||||
if (Test-Path -Path 'Lenovo\SYSTEM.BMP' @paramSimpleDefaults)
|
||||
{
|
||||
$null = (Copy-Item -Path "$env:HOMEDRIVE\install\ManufacturerSpecific\Lenovo\SYSTEM.BMP" @paramCopyItem)
|
||||
}
|
||||
|
||||
# Set the new OEM Info
|
||||
if ($ManufacturerModel)
|
||||
{
|
||||
$null = (New-ItemProperty -Name 'Model' -Value $ManufacturerModel @paramNewItemProperty)
|
||||
}
|
||||
|
||||
$null = (New-ItemProperty -Name 'Manufacturer' -Value 'Lenovo' @paramNewItemProperty)
|
||||
$null = (New-ItemProperty -Name 'Logo' -Value 'C:\\WINDOWS\\SYSTEM32\\SYSTEM.BMP' @paramNewItemProperty)
|
||||
$null = (New-ItemProperty -Name 'SupportURL' -Value 'https://support.lenovo.com/' @paramNewItemProperty)
|
||||
}
|
||||
#endregion LENOVO
|
||||
|
||||
#region Dell
|
||||
if ($ManufacturerTooling -eq 'Dell')
|
||||
{
|
||||
# Cleanup the OEM Info
|
||||
$null = (Remove-OEMInfo @paramSimpleDefaults)
|
||||
|
||||
# Copy the OEM Logo
|
||||
if (Test-Path -Path "$env:HOMEDRIVE\install\ManufacturerSpecific\Dell\SYSTEM.BMP" @paramSimpleDefaults)
|
||||
{
|
||||
$null = (Copy-Item -Path "$env:HOMEDRIVE\install\ManufacturerSpecific\Dell\SYSTEM.BMP" @paramCopyItem)
|
||||
}
|
||||
|
||||
# Set the new OEM Info
|
||||
if ($ManufacturerModel)
|
||||
{
|
||||
$null = (New-ItemProperty -Name 'Model' -Value $ManufacturerModel @paramNewItemProperty)
|
||||
}
|
||||
|
||||
$null = (New-ItemProperty -Name 'Manufacturer' -Value 'Dell' @paramNewItemProperty)
|
||||
$null = (New-ItemProperty -Name 'Logo' -Value 'C:\\WINDOWS\\SYSTEM32\\SYSTEM.BMP' @paramNewItemProperty)
|
||||
$null = (New-ItemProperty -Name 'SupportURL' -Value 'https://www.dell.com/support/home/' @paramNewItemProperty)
|
||||
}
|
||||
#endregion Dell
|
||||
}
|
||||
|
||||
end
|
||||
{
|
||||
$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force @paramSimpleDefaults)
|
||||
}
|
||||
|
||||
#region LICENSE
|
||||
<#
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021, enabling Technology
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#>
|
||||
#endregion LICENSE
|
||||
|
||||
#region DISCLAIMER
|
||||
<#
|
||||
DISCLAIMER:
|
||||
- Use at your own risk, etc.
|
||||
- This is open-source software, if you find an issue try to fix it yourself. There is no support and/or warranty in any kind
|
||||
- This is a third-party Software
|
||||
- The developer of this Software is NOT sponsored by or affiliated with Microsoft Corp (MSFT) or any of its subsidiaries in any way
|
||||
- The Software is not supported by Microsoft Corp (MSFT)
|
||||
- By using the Software, you agree to the License, Terms, and any Conditions declared and described above
|
||||
- If you disagree with any of the Terms, and any Conditions declared: Just delete it and build your own solution
|
||||
#>
|
||||
#endregion DISCLAIMER
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
@@ -0,0 +1,10 @@
|
||||
title LenovoSpecific
|
||||
set Module=LenovoSpecific
|
||||
echo start %Module% %time% =================== >>%logfile_setup%
|
||||
|
||||
rem install Lenovo System Update for Windows
|
||||
echo system_update_5.07.0106.exe /VERYSILENT /SUPPRESSMSGBOXES /LOG='c:\temp\LenovoSysupdate.log' /NOCANCEL /NORESTART /CLOSEAPPLICATIONS /NORESTARTAPPLICATIONS >>%logfile_setup%
|
||||
@system_update_5.07.0106.exe /VERYSILENT /SUPPRESSMSGBOXES /LOG='c:\temp\LenovoSysupdate.log' /NOCANCEL /NORESTART /CLOSEAPPLICATIONS /NORESTARTAPPLICATIONS >>%logfile_setup%
|
||||
|
||||
echo stop %Module% %time% =================== >>%logfile_setup%
|
||||
echo.>>%logfile_setup%
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
@@ -0,0 +1,110 @@
|
||||
<Configuration ID="722e6ccf-aeaf-447b-90ea-489e3a00c6fe">
|
||||
<!-- Name the configuration -->
|
||||
<Info Description="enabling Technology default Click 2 Run installation" />
|
||||
<!-- Set plattform and update channel - The only supported channel for this kind is PerpetualVL2019 - Can be changed for Microsoft 365 activations -->
|
||||
<Add OfficeClientEdition="64" Channel="PerpetualVL2019">
|
||||
<!-- Office Suite -->
|
||||
<Product ID="ProPlus2019Volume" PIDKEY="NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP">
|
||||
<!-- Default languages to install -->
|
||||
<Language ID="de-de" />
|
||||
<Language ID="en-us" />
|
||||
<!-- Exclude some components -->
|
||||
<ExcludeApp ID="Access" />
|
||||
<ExcludeApp ID="Groove" />
|
||||
<ExcludeApp ID="Lync" />
|
||||
<ExcludeApp ID="OneDrive" />
|
||||
<ExcludeApp ID="Publisher" />
|
||||
</Product>
|
||||
<!-- Viso -->
|
||||
<Product ID="VisioPro2019Volume" PIDKEY="9BGNQ-K37YR-RQHF2-38RQ3-7VCBB">
|
||||
<!-- Default languages to install -->
|
||||
<Language ID="de-de" />
|
||||
<Language ID="en-us" />
|
||||
<!-- Exclude some components -->
|
||||
<ExcludeApp ID="Access" />
|
||||
<ExcludeApp ID="Groove" />
|
||||
<ExcludeApp ID="Lync" />
|
||||
<ExcludeApp ID="OneDrive" />
|
||||
<ExcludeApp ID="Publisher" />
|
||||
</Product>
|
||||
<!-- Project -->
|
||||
<Product ID="ProjectPro2019Volume" PIDKEY="B4NPR-3FKK7-T2MBV-FRQ4W-PKD2B">
|
||||
<!-- Default languages to install -->
|
||||
<Language ID="de-de" />
|
||||
<Language ID="en-us" />
|
||||
<!-- Exclude some components -->
|
||||
<ExcludeApp ID="Access" />
|
||||
<ExcludeApp ID="Groove" />
|
||||
<ExcludeApp ID="Lync" />
|
||||
<ExcludeApp ID="OneDrive" />
|
||||
<ExcludeApp ID="Publisher" />
|
||||
</Product>
|
||||
</Add>
|
||||
<!-- We use KMS -->
|
||||
<Property Name="SharedComputerLicensing" Value="0" />
|
||||
<!-- No default Pin's -->
|
||||
<Property Name="PinIconsToTaskbar" Value="FALSE" />
|
||||
<!-- -->
|
||||
<Property Name="SCLCacheOverride" Value="0" />
|
||||
<!-- Will only work inside the Domain network or via VPN -->
|
||||
<Property Name="AUTOACTIVATE" Value="1" />
|
||||
<!-- Kill all running Office apps -->
|
||||
<Property Name="FORCEAPPSHUTDOWN" Value="TRUE" />
|
||||
<!-- Needed for KMS -->
|
||||
<Property Name="DeviceBasedLicensing" Value="0" />
|
||||
<!-- -->
|
||||
<Updates Enabled="TRUE" />
|
||||
<!-- Remove all installed MSI -->
|
||||
<RemoveMSI />
|
||||
<!-- configure the Office apps -->
|
||||
<AppSettings>
|
||||
<!-- Who is the owner of the Office Apps -->
|
||||
<Setup Name="Company" Value="enabling Technology" />
|
||||
<!-- Settings for the proofing tools - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\shared tools\proofing tools\spelling" Name="germanpostreform" Value="1" Type="REG_DWORD" App="office16" Id="L_UseGermanpostreformruleswhenrunningspellcheck" />
|
||||
<!-- Settings common - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\office\16.0\common" Name="disabledocumentchat" Value="0" Type="REG_DWORD" App="office16" Id="L_DocumentChat" />
|
||||
<User Key="software\microsoft\office\16.0\common" Name="qmenable" Value="0" Type="REG_DWORD" App="office16" Id="L_EnableCustomerExperienceImprovementProgram" />
|
||||
<User Key="software\microsoft\office\16.0\common" Name="updatereliabilitydata" Value="1" Type="REG_DWORD" App="office16" Id="L_UpdateReliabilityPolicy" />
|
||||
<User Key="software\microsoft\office\16.0\common" Name="linkedin" Value="1" Type="REG_DWORD" App="office16" Id="L_AllowLinkedInFeatures" />
|
||||
<User Key="software\microsoft\office\16.0\common" Name="default ui theme" Value="0" Type="REG_DWORD" App="office16" Id="L_DefaultUIThemeUser" />
|
||||
<User Key="software\microsoft\office\16.0\common" Name="insiderslabbehavior" Value="1" Type="REG_DWORD" App="office16" Id="L_OfficeInsiderUserExperience" />
|
||||
<User Key="software\microsoft\office\16.0\common\feedback" Name="enabled" Value="0" Type="REG_DWORD" App="office16" Id="L_SendFeedback" />
|
||||
<User Key="software\microsoft\office\16.0\common\ptwatson" Name="ptwoptin" Value="0" Type="REG_DWORD" App="office16" Id="L_ImproveProofingTools" />
|
||||
<User Key="software\microsoft\office\16.0\common\security" Name="useisopasswordverifier" Value="1" Type="REG_DWORD" App="office16" Id="L_SetPasswordHashFormatAsISOCompliant" />
|
||||
<User Key="software\microsoft\office\16.0\common\im" Name="turnoffpresenceintegration" Value="0" Type="REG_DWORD" App="office16" Id="L_TurnOffPresenceIntegration" />
|
||||
<User Key="software\microsoft\office\16.0\common\im" Name="turnoffpresenceicon" Value="0" Type="REG_DWORD" App="office16" Id="L_ConfigurePresenceIcons" />
|
||||
<User Key="software\microsoft\office\16.0\common\internet" Name="allow8bitmime" Value="0" Type="REG_DWORD" App="office16" Id="L_WebArchiveencoding" />
|
||||
<User Key="software\microsoft\office\16.0\common\general" Name="shownfirstrunoptin" Value="1" Type="REG_DWORD" App="office16" Id="L_DisableOptinWizard" />
|
||||
<User Key="software\microsoft\office\16.0\firstrun" Name="disablemovie" Value="1" Type="REG_DWORD" App="office16" Id="L_DisableMovie" />
|
||||
<User Key="software\microsoft\office\16.0\firstrun" Name="bootedrtm" Value="1" Type="REG_DWORD" App="office16" Id="L_DisableOfficeFirstrun" />
|
||||
<User Key="software\microsoft\office\16.0\osm" Name="enableupload" Value="0" Type="REG_DWORD" App="office16" Id="L_OfficeInventoryAgentUpload" />
|
||||
<User Key="software\microsoft\office\16.0\osm" Name="enablefileobfuscation" Value="0" Type="REG_DWORD" App="office16" Id="L_OfficeInventoryAgentFilemetadataObfuscation" />
|
||||
<User Key="software\microsoft\office\16.0\osm" Name="enablelogging" Value="0" Type="REG_DWORD" App="office16" Id="L_EnableLogging" />
|
||||
<!-- Settings for Excel - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\office\16.0\excel" Name="dontshowwhatsnew" Value="1" Type="REG_DWORD" App="office16" Id="L_DontShowWhatsNewInformationExcel" />
|
||||
<User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" Type="REG_DWORD" App="excel16" Id="L_SaveExcelfilesas" />
|
||||
<!-- Settings for OneNote - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\office\16.0\onenote" Name="dontshowwhatsnew" Value="1" Type="REG_DWORD" App="office16" Id="L_DontShowWhatsNewInformationOneNote" />
|
||||
<User Key="software\microsoft\office\16.0\onenote\options" Name="email attachment" Value="1" Type="REG_DWORD" App="onent16" Id="L_AllowOneNoteemailattachments" />
|
||||
<User Key="software\microsoft\office\16.0\onenote\options" Name="disablepresence" Value="0" Type="REG_DWORD" App="onent16" Id="L_NotebookPresence" />
|
||||
<!-- Settings for Outlook - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\office\16.0\outlook" Name="dontshowwhatsnew" Value="1" Type="REG_DWORD" App="office16" Id="L_DontShowWhatsNewInformationOutlook" />
|
||||
<User Key="software\microsoft\office\16.0\outlook\options\pubcal" Name="restrictedaccessonly" Value="1" Type="REG_DWORD" App="outlk16" Id="L_Accesstopublishedcalendars" />
|
||||
<User Key="software\microsoft\office\16.0\outlook\options\calendar" Name="weeknum" Value="1" Type="REG_DWORD" App="outlk16" Id="L_Calendarweeknumbers" />
|
||||
<User Key="software\microsoft\office\16.0\outlook\options" Name="enableconflictlogging" Value="2" Type="REG_DWORD" App="outlk16" Id="L_TurnOnLoggingForAllConflicts" />
|
||||
<User Key="software\microsoft\office\16.0\outlook\preferences" Name="disablemanualarchive" Value="1" Type="REG_DWORD" App="outlk16" Id="L_DisableFileArchive" />
|
||||
<!-- Settings for PowerPoint - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\office\16.0\powerpoint" Name="dontshowwhatsnew" Value="1" Type="REG_DWORD" App="office16" Id="L_DontShowWhatsNewInformationPowerPoint" />
|
||||
<User Key="software\microsoft\office\16.0\powerpoint\options" Name="defaultformat" Value="27" Type="REG_DWORD" App="ppt16" Id="L_SavePowerPointfilesas" />
|
||||
<!-- Settings for Visio - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\office\16.0\visio" Name="dontshowwhatsnew" Value="1" Type="REG_DWORD" App="office16" Id="L_DontShowWhatsNewInformationVisio" />
|
||||
<!-- Settings for Word - Customized by Intune/DSC later -->
|
||||
<User Key="software\microsoft\office\16.0\word" Name="dontshowwhatsnew" Value="1" Type="REG_DWORD" App="office16" Id="L_DontShowWhatsNewInformationWord" />
|
||||
<User Key="software\microsoft\office\16.0\word\options" Name="defaultformat" Value="" Type="REG_SZ" App="word16" Id="L_SaveWordfilesas" />
|
||||
</AppSettings>
|
||||
<!-- Do NOT show the EULA -->
|
||||
<Display Level="None" AcceptEULA="TRUE" />
|
||||
<!-- No logging -->
|
||||
<Logging Level="Off" />
|
||||
</Configuration>
|
||||
Binary file not shown.
@@ -0,0 +1,671 @@
|
||||
#requires -Version 5.0 -Modules CimCmdlets -RunAsAdministrator
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Set the Install Image in the Registry
|
||||
|
||||
.DESCRIPTION
|
||||
Set the Install Image in the Registry.
|
||||
Save several infos to the registry, we use that with some tools later.
|
||||
|
||||
.PARAMETER Company
|
||||
Name of the Company, used to create a registry Tree
|
||||
|
||||
.PARAMETER ImageName
|
||||
Name of the Install Image
|
||||
|
||||
.PARAMETER ImageDescription
|
||||
Description of the Install Image
|
||||
|
||||
.PARAMETER ImageVersion
|
||||
Version of the Install Image.
|
||||
String is used here!
|
||||
|
||||
.NOTES
|
||||
Changelog:
|
||||
2.0.0: Completly rewritten and renamed
|
||||
1.0.2: Add Image Name & Version
|
||||
1.0.1: Fixed the site issue (Termination Error)
|
||||
1.0.0: Initial public beta
|
||||
|
||||
Version 2.0.0
|
||||
|
||||
.LINK
|
||||
http://enatec.io
|
||||
#>
|
||||
[CmdletBinding(ConfirmImpact = 'None')]
|
||||
param
|
||||
(
|
||||
[Parameter(ValueFromPipeline,
|
||||
ValueFromPipelineByPropertyName)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias('InstallCompany')]
|
||||
[string]
|
||||
$Company = 'enabling Technology',
|
||||
[Parameter(ValueFromPipeline,
|
||||
ValueFromPipelineByPropertyName)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias('InstallImageName')]
|
||||
[string]
|
||||
$ImageName = 'ETPOSD',
|
||||
[Parameter(ValueFromPipeline,
|
||||
ValueFromPipelineByPropertyName)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias('InstallImageDescription')]
|
||||
[string]
|
||||
$ImageDescription = 'enabling Technology progressive OS deployment',
|
||||
[Parameter(ValueFromPipeline,
|
||||
ValueFromPipelineByPropertyName)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias('InstallImageVersion')]
|
||||
[string]
|
||||
$ImageVersion = 'Test Build'
|
||||
)
|
||||
|
||||
begin
|
||||
{
|
||||
Write-Output -InputObject 'Set the Install Image in the Registry'
|
||||
|
||||
#region GlobalDefaults
|
||||
$SCT = 'SilentlyContinue'
|
||||
|
||||
$RegSz = 'String'
|
||||
$DefaultInfo = 'Unknown'
|
||||
|
||||
# Target Path
|
||||
$RegistryPath = ('HKLM:\Software\' + $Company + '\BaseImage')
|
||||
#endregion GlobalDefaults
|
||||
|
||||
#region HelperFunctions
|
||||
function Get-ComputerSplit
|
||||
{
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Find the own name via DNS, use the Hostname as fallback
|
||||
|
||||
.DESCRIPTION
|
||||
Find the own name via DNS, use the Hostname as fallback
|
||||
|
||||
.PARAMETER ComputerName
|
||||
The Computer(s) to use
|
||||
|
||||
.EXAMPLE
|
||||
Get-ComputerSplit -ComputerName Value
|
||||
Describe what this call does
|
||||
|
||||
.NOTES
|
||||
Stolen from PsSharedGoods (MIT Licensed)
|
||||
|
||||
.LINK
|
||||
https://github.com/EvotecIT/PSSharedGoods
|
||||
#>
|
||||
[CmdletBinding(ConfirmImpact = 'Low')]
|
||||
param(
|
||||
[string[]] $ComputerName = $ComputerName
|
||||
)
|
||||
|
||||
begin
|
||||
{
|
||||
# Just in case
|
||||
if ($null -eq $ComputerName)
|
||||
{
|
||||
$ComputerName = ($Env:COMPUTERNAME)
|
||||
}
|
||||
}
|
||||
|
||||
process
|
||||
{
|
||||
try
|
||||
{
|
||||
# Do we have a registered Hostname in DNS?
|
||||
$LocalComputerDNSName = ([Net.Dns]::GetHostByName($Env:COMPUTERNAME).HostName)
|
||||
}
|
||||
catch
|
||||
{
|
||||
# Fallback
|
||||
$LocalComputerDNSName = ($Env:COMPUTERNAME)
|
||||
}
|
||||
|
||||
# Cleanup
|
||||
$ComputersLocal = $null
|
||||
|
||||
[Array] $Computers = foreach ($_ in $ComputerName)
|
||||
{
|
||||
if ($_ -eq '' -or $null -eq $_)
|
||||
{
|
||||
$_ = ($Env:COMPUTERNAME)
|
||||
}
|
||||
|
||||
if ($_ -ne $Env:COMPUTERNAME -and $_ -ne $LocalComputerDNSName)
|
||||
{
|
||||
$_
|
||||
}
|
||||
else
|
||||
{
|
||||
$ComputersLocal = ($_)
|
||||
}
|
||||
}
|
||||
, @($ComputersLocal, $Computers)
|
||||
}
|
||||
}
|
||||
|
||||
function Get-CimData
|
||||
{
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Get CIM Data
|
||||
|
||||
.DESCRIPTION
|
||||
Get CIM Data
|
||||
|
||||
.PARAMETER ComputerName
|
||||
Parameter description
|
||||
|
||||
.PARAMETER Protocol
|
||||
'Default', 'Dcom', 'Wsman', default is 'Default'
|
||||
|
||||
.PARAMETER Class
|
||||
CIM Class
|
||||
|
||||
.PARAMETER Properties
|
||||
CIM Property or Properties
|
||||
|
||||
.EXAMPLE
|
||||
Get-CimData -Class 'win32_bios' -ComputerName AD1,EVOWIN
|
||||
|
||||
Get-CimData -Class 'win32_bios'
|
||||
|
||||
# Get-CimClass to get all classes
|
||||
|
||||
.NOTES
|
||||
Stolen from PsSharedGoods (MIT Licensed)
|
||||
|
||||
.LINK
|
||||
https://github.com/EvotecIT/PSSharedGoods
|
||||
#>
|
||||
[CmdletBinding(ConfirmImpact = 'Low')]
|
||||
param([string] $Class,
|
||||
[string] $NameSpace = 'root\cimv2',
|
||||
[string[]] $ComputerName = $Env:COMPUTERNAME,
|
||||
[ValidateSet('Default', 'Dcom', 'Wsman')][string] $Protocol = 'Default',
|
||||
[string] $Properties = '*')
|
||||
|
||||
begin
|
||||
{
|
||||
$SCT = 'SilentlyContinue'
|
||||
$ExcludeProperties = 'CimClass', 'CimInstanceProperties', 'CimSystemProperties', 'SystemCreationClassName', 'CreationClassName'
|
||||
}
|
||||
|
||||
process
|
||||
{
|
||||
[Array] $ComputersSplit = (Get-ComputerSplit -ComputerName $ComputerName)
|
||||
$CimObject = @(# requires removal of this property for query
|
||||
[string[]] $PropertiesOnly = $Properties | Where-Object -FilterScript {
|
||||
$_ -ne 'PSComputerName'
|
||||
}
|
||||
|
||||
$Computers = $ComputersSplit[1]
|
||||
|
||||
if ($Computers.Count -gt 0)
|
||||
{
|
||||
if ($Protocol -eq 'Default')
|
||||
{
|
||||
(Get-CimInstance -ClassName $Class -ComputerName $Computers -ErrorAction $SCT -Property $PropertiesOnly -Namespace $NameSpace | Select-Object -Property $Properties -ExcludeProperty $ExcludeProperties)
|
||||
}
|
||||
else
|
||||
{
|
||||
$Option = (New-CimSessionOption -Protocol)
|
||||
$Session = (New-CimSession -ComputerName $Computers -SessionOption $Option -ErrorAction $SCT)
|
||||
$Info = (Get-CimInstance -ClassName $Class -CimSession $Session -ErrorAction $SCT -Property $PropertiesOnly -Namespace $NameSpace | Select-Object -Property $Properties -ExcludeProperty $ExcludeProperties)
|
||||
$null = (Remove-CimSession -CimSession $Session -ErrorAction $SCT)
|
||||
|
||||
$Info
|
||||
}
|
||||
}
|
||||
|
||||
$Computers = $ComputersSplit[0]
|
||||
|
||||
if ($Computers.Count -gt 0)
|
||||
{
|
||||
$Info = (Get-CimInstance -ClassName $Class -ErrorAction $SCT -Property $PropertiesOnly -Namespace $NameSpace | Select-Object -Property $Properties -ExcludeProperty $ExcludeProperties)
|
||||
$Info | Add-Member -Name 'PSComputerName' -Value $Computers -MemberType NoteProperty -Force
|
||||
|
||||
$Info
|
||||
}
|
||||
)
|
||||
|
||||
$CimComputers = ($CimObject.PSComputerName | Sort-Object -Unique)
|
||||
|
||||
foreach ($Computer in $ComputerName)
|
||||
{
|
||||
if ($CimComputers -notcontains $Computer)
|
||||
{
|
||||
Write-Warning -Message ('Get-CimData - No data for computer {0}. Most likely an error on receiving side.' -f $Computer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end
|
||||
{
|
||||
return $CimObject
|
||||
}
|
||||
}
|
||||
#endregion HelperFunctions
|
||||
|
||||
$paramSetMpPreference = @{
|
||||
EnableControlledFolderAccess = 'Disabled'
|
||||
Force = $true
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (Set-MpPreference @paramSetMpPreference)
|
||||
}
|
||||
|
||||
process
|
||||
{
|
||||
# Create Path if needed
|
||||
$paramTestPath = @{
|
||||
Path = $RegistryPath
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
if (-not (Test-Path @paramTestPath))
|
||||
{
|
||||
$paramNewItem = @{
|
||||
Path = $RegistryPath
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-Item @paramNewItem)
|
||||
}
|
||||
|
||||
# Set Date/Time
|
||||
$InstallDate = (Get-Date -Format 'yyyy-MM-dd')
|
||||
$InstallTime = (Get-Date -Format 'HH:mm')
|
||||
|
||||
# Get system info
|
||||
$paramGetCimData = @{
|
||||
Class = 'Win32_ComputerSystem'
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$HardwareInfo = (Get-CimData @paramGetCimData)
|
||||
|
||||
# Windows Info
|
||||
$paramGetCimInstance = @{
|
||||
ClassName = 'Win32_OperatingSystem'
|
||||
Property = 'CSName', 'Caption', 'Version', 'OSArchitecture'
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$WindowsVersionInfo = (Get-CimInstance @paramGetCimInstance | Select-Object -Property CSName, Caption, Version, OSArchitecture)
|
||||
|
||||
# Release ID (e.g. 1903)
|
||||
$paramGetItemProperty = @{
|
||||
Path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
|
||||
Name = 'ReleaseId'
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$WindowsReleaseId = ((Get-ItemProperty @paramGetItemProperty ).ReleaseId)
|
||||
|
||||
# Network Info
|
||||
$paramGetCimInstance = @{
|
||||
ClassName = 'Win32_NetworkAdapterConfiguration'
|
||||
select = 'IPAddress'
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$WindowsNicInfo = (Get-CimInstance @paramGetCimInstance | Where-Object -FilterScript {
|
||||
$_.IPAddress
|
||||
} | Select-Object -ExpandProperty IPAddress | Where-Object -FilterScript {
|
||||
$_ -notlike '*:*'
|
||||
})
|
||||
|
||||
#region ImageName
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'ImageName'
|
||||
PropertyType = $RegSz
|
||||
Value = $ImageName
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion ImageName
|
||||
|
||||
#region ImageDescription
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'ImageDescription'
|
||||
PropertyType = $RegSz
|
||||
Value = $ImageDescription
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion ImageDescription
|
||||
|
||||
#region ImageVersion
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'ImageVersion'
|
||||
PropertyType = $RegSz
|
||||
Value = $ImageVersion
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion ImageVersion
|
||||
|
||||
#region KMSAware
|
||||
$paramTestConnection = @{
|
||||
ComputerName = 'kms.enatec.net'
|
||||
Quiet = $true
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
[bool]$KMSAwareValue = (Test-Connection @paramTestConnection)
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'KMSAware'
|
||||
PropertyType = $RegSz
|
||||
Value = $KMSAwareValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion KMSAware
|
||||
|
||||
#region InstallDate
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallDate'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallDate
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallDate
|
||||
|
||||
#region InstallTime
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallTime'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallTime
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallTime
|
||||
|
||||
#region InstallHostname
|
||||
if ((($HardwareInfo).Name))
|
||||
{
|
||||
$InstallHostnameValue = (($HardwareInfo).Name)
|
||||
}
|
||||
else
|
||||
{
|
||||
$InstallHostnameValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallHostname'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallHostnameValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallHostname
|
||||
|
||||
#region InstallIP
|
||||
if ($WindowsNicInfo)
|
||||
{
|
||||
$InstallIPValue = $WindowsNicInfo
|
||||
}
|
||||
else
|
||||
{
|
||||
$InstallIPValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallIP'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallIPValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallIP
|
||||
|
||||
#region InstallSite
|
||||
if (Test-Connection -ComputerName echo.enatec.net -Quiet -WarningAction $SCT -ErrorAction $SCT)
|
||||
{
|
||||
$InstallSiteValue = 'FRA1'
|
||||
}
|
||||
elseif (Test-Connection -ComputerName friend.enatec.net -Quiet -WarningAction $SCT -ErrorAction $SCT)
|
||||
{
|
||||
$InstallSiteValue = 'FRA2'
|
||||
}
|
||||
elseif (Test-Connection -ComputerName join.enatec.net -Quiet -WarningAction $SCT -ErrorAction $SCT)
|
||||
{
|
||||
$InstallSiteValue = 'VPN'
|
||||
}
|
||||
else
|
||||
{
|
||||
$InstallSiteValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallSite'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallSiteValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallSite
|
||||
|
||||
#region HardwareManufacturer
|
||||
if ((($HardwareInfo).Manufacturer))
|
||||
{
|
||||
$HardwareManufacturerValue = (($HardwareInfo).Manufacturer)
|
||||
}
|
||||
else
|
||||
{
|
||||
$HardwareManufacturerValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'HardwareManufacturer'
|
||||
PropertyType = $RegSz
|
||||
Value = $HardwareManufacturerValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion HardwareManufacturer
|
||||
|
||||
#region HardwareModel
|
||||
if ((($HardwareInfo).Model))
|
||||
{
|
||||
$HardwareModelValue = (($HardwareInfo).Model)
|
||||
}
|
||||
else
|
||||
{
|
||||
$HardwareModelValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'HardwareModel'
|
||||
PropertyType = $RegSz
|
||||
Value = $HardwareModelValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion HardwareModel
|
||||
|
||||
#region InstallOperationsystem
|
||||
if ((($WindowsVersionInfo).Caption))
|
||||
{
|
||||
$InstallOperationsystemValue = (($WindowsVersionInfo).Caption)
|
||||
}
|
||||
else
|
||||
{
|
||||
$InstallOperationsystemValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallOperationsystem'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallOperationsystemValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallOperationsystem
|
||||
|
||||
#region InstallArchitecture
|
||||
if ((($WindowsVersionInfo).OSArchitecture))
|
||||
{
|
||||
$InstallArchitectureValue = (($WindowsVersionInfo).OSArchitecture)
|
||||
}
|
||||
else
|
||||
{
|
||||
$InstallArchitectureValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallArchitecture'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallArchitectureValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallArchitecture
|
||||
|
||||
#region InstallReleaseId
|
||||
if ($WindowsReleaseId)
|
||||
{
|
||||
$InstallReleaseIdValue = $WindowsReleaseId
|
||||
}
|
||||
else
|
||||
{
|
||||
$InstallReleaseIdValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallReleaseId'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallReleaseIdValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallReleaseId
|
||||
|
||||
#region InstallVersion
|
||||
if ((($WindowsVersionInfo).Version))
|
||||
{
|
||||
$InstallVersionValue = (($WindowsVersionInfo).Version)
|
||||
}
|
||||
else
|
||||
{
|
||||
$InstallVersionValue = $DefaultInfo
|
||||
}
|
||||
|
||||
$paramNewItemProperty = @{
|
||||
Path = $RegistryPath
|
||||
Name = 'InstallVersion'
|
||||
PropertyType = $RegSz
|
||||
Value = $InstallVersionValue
|
||||
Force = $true
|
||||
Confirm = $false
|
||||
WarningAction = $SCT
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (New-ItemProperty @paramNewItemProperty)
|
||||
#endregion InstallVersion
|
||||
}
|
||||
|
||||
end
|
||||
{
|
||||
$paramSetMpPreference = @{
|
||||
EnableControlledFolderAccess = 'Enabled'
|
||||
Force = $true
|
||||
ErrorAction = $SCT
|
||||
}
|
||||
$null = (Set-MpPreference @paramSetMpPreference)
|
||||
}
|
||||
|
||||
#region LICENSE
|
||||
<#
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021, enabling Technology
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#>
|
||||
#endregion LICENSE
|
||||
|
||||
#region DISCLAIMER
|
||||
<#
|
||||
DISCLAIMER:
|
||||
- Use at your own risk, etc.
|
||||
- This is open-source software, if you find an issue try to fix it yourself. There is no support and/or warranty in any kind
|
||||
- This is a third-party Software
|
||||
- The developer of this Software is NOT sponsored by or affiliated with Microsoft Corp (MSFT) or any of its subsidiaries in any way
|
||||
- The Software is not supported by Microsoft Corp (MSFT)
|
||||
- By using the Software, you agree to the License, Terms, and any Conditions declared and described above
|
||||
- If you disagree with any of the Terms, and any Conditions declared: Just delete it and build your own solution
|
||||
#>
|
||||
#endregion DISCLAIMER
|
||||
@@ -0,0 +1,415 @@
|
||||
@ECHO OFF
|
||||
|
||||
:: ********************************************************************************************************************
|
||||
::
|
||||
:: enabling Technology progressive OS deployment
|
||||
:: Client System Bootstrapper for Windows 10 Enterprise Installations
|
||||
::
|
||||
:: Version 1.0.0
|
||||
::
|
||||
:: Tested with Windows 10 Enterprise Release 2004 and Release 2009
|
||||
::
|
||||
:: Please review all the scripts BEFORE you install it on any of your systems.
|
||||
:: This installation/configuration is customized to our internal requirements and might not fit for everyone!
|
||||
::
|
||||
:: ********************************************************************************************************************
|
||||
|
||||
SETLOCAL
|
||||
|
||||
:: check if runs as Administrator
|
||||
OPENFILES >nul 2>&1
|
||||
IF %errorlevel%==0 (
|
||||
GOTO MakeNonCancelable
|
||||
) ELSE (
|
||||
ECHO You are not running as Administrator...
|
||||
ECHO This batch cannot do it's job without elevation!
|
||||
ECHO.
|
||||
ECHO Right-click and select ^'Run as Administrator^' and try again...
|
||||
ECHO.
|
||||
ECHO Press any key to exit...
|
||||
PAUSE >nul
|
||||
|
||||
EXIT
|
||||
)
|
||||
|
||||
:MakeNonCancelable
|
||||
:: prevent CTRL + C
|
||||
IF "%~1" EQU "NonCancelable" GOTO NonCancelable
|
||||
START "" /B CMD /C "%~F0" NonCancelable
|
||||
EXIT
|
||||
|
||||
:NonCancelable
|
||||
TITLE enabling Technology Client System Bootstrapper
|
||||
SET Module=SystemBootstrapper
|
||||
SET logfile_setup=%HOMEDRIVE%\Temp\%Module%.txt
|
||||
|
||||
:: Show Splash Screen
|
||||
START /LOW /MAX "Installation is running, please wait" c:\tools\enaTec_Installer.exe >nul 2>&1
|
||||
|
||||
:: Ensure NTP is used and that the time is correct
|
||||
%SystemRoot%\System32\net.exe stop w32time >nul 2>&1
|
||||
%SystemRoot%\System32\w32tm.exe /config /syncfromflags:manual /manualpeerlist:"0.de.pool.ntp.org 1.de.pool.ntp.org 2.de.pool.ntp.org 3.de.pool.ntp.org" >nul 2>&1
|
||||
%SystemRoot%\System32\net.exe start w32time >nul 2>&1
|
||||
%SystemRoot%\System32\sc.exe config w32time start= auto >nul 2>&1
|
||||
%SystemRoot%\System32\w32tm.exe /resync /force >nul 2>&1
|
||||
|
||||
:: Wait for the Splash Screen to load
|
||||
:LOOP
|
||||
:: Check if the Splash Screen is running
|
||||
%SystemRoot%\system32\tasklist.exe | %SystemRoot%\system32\find.exe /i "enaTec_Installer" >nul 2>&1
|
||||
IF ERRORLEVEL 1 (
|
||||
:: Wait for 5 seconds
|
||||
%SystemRoot%\system32\timeout.exe /T 5 /Nobreak >nul 2>&1
|
||||
:: Check again
|
||||
GOTO LOOP
|
||||
) ELSE (
|
||||
:: Splash Screen is running
|
||||
GOTO SetLogHeader
|
||||
)
|
||||
|
||||
:SetLogHeader
|
||||
ECHO ******************************************************************************** >%logfile_setup%
|
||||
ECHO Started %Module% on %DATE:~0% - %TIME:~0,8%
|
||||
ECHO For %COMPUTERNAME% by %USERDOMAIN%\%USERNAME% >>%logfile_setup%
|
||||
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:SetPowerPlanToHighPerformance
|
||||
ECHO Set Power Plan to High Performance
|
||||
ECHO %TIME:~0,8% Set Power Plan to High Performance >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "c:\scripts\PowerShell\Set-PowerPlanToHighPerformance.ps1" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
|
||||
:DisableCortanaSearchbar
|
||||
ECHO Disable Cortana Searchbar
|
||||
ECHO %TIME:~0,8% Disable Cortana Searchbar >>%logfile_setup%
|
||||
"%SystemRoot%\System32\reg.exe" ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:CreatePowerShellProfiles
|
||||
ECHO Create plain PowerShell Profiles
|
||||
ECHO %TIME:~0,8% Create plain PowerShell Profiles >>%logfile_setup%
|
||||
start /MIN /WAIT "CleanupStockApps" %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "C:\scripts\PowerShell\New-PowerShellProfiles.ps1" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:ConfigureStorageSense
|
||||
ECHO Configure Storage Sense
|
||||
ECHO %TIME:~0,8% Configure Storage Sense >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Set-StorageSense.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:BootstrapTheUser
|
||||
ECHO Bootstrap the User
|
||||
ECHO %TIME:~0,8% Bootstrap the User >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Invoke-BootstrapUser.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:ApplyTweaksLocal
|
||||
ECHO Apply tweaks local
|
||||
ECHO %TIME:~0,8% Apply tweaks local >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\reg.exe" ADD HKU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v BootstrapUser /t REG_SZ /d "powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command '$null = (C:\scripts\PowerShell\Invoke-BootstrapUser.ps1)'" /f >>%logfile_setup% 2>&1
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:UpdateAllMicrosoftStoreApps
|
||||
ECHO Update all Microsoft Store Apps
|
||||
ECHO %TIME:~0,8% Update all Microsoft Store Apps >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Update-AllMicrosoftStoreApps.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:SetOneDriveToGetInsiderBuilds
|
||||
ECHO Set OneDrive to get Insider builds
|
||||
ECHO %TIME:~0,8% Set OneDrive to get Insider builds >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\reg.exe" add HKCU\Software\Microsoft\OneDrive /v EnableTeamTier_Internal /t REG_DWORD /d 1 /f >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:ForceOneDriveToUpdateAndRestart
|
||||
ECHO Force OneDrive to update and restart
|
||||
ECHO %TIME:~0,8% Force OneDrive to update and restart >>%logfile_setup% 2>&1
|
||||
C:\Windows\SysWOW64/OneDriveSetup.exe /update /restart /force >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:DownloadAndInstallLatestVersionOfMicrosoftTeams
|
||||
ECHO Download and install latest version of Microsoft Teams
|
||||
ECHO %TIME:~0,8% Download and install latest version of Microsoft Teams >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Install-LatestTeamsClient.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:EnableQoSForMicrosoftTeams
|
||||
ECHO Enable QoS for Microsoft Teams
|
||||
ECHO %TIME:~0,8% Enable QoS for Microsoft Teams >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Set-QoSForMicrosoftTeams.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:TweakTheFirewallForMicrosoftTeams
|
||||
ECHO Tweak the Firewall for Microsoft Teams
|
||||
ECHO %TIME:~0,8% Tweak the Firewall for Microsoft Teams >>%logfile_setup% 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Invoke-TweakTeamsClientFirewall.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:ConfigureMicrosoftDefender
|
||||
ECHO Configure Microsoft Defender
|
||||
ECHO %TIME:~0,8% Configure Microsoft Defender >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Optimize-MicrosoftDefenderExclusions.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:InstallSomePowerShellModules
|
||||
ECHO Install some PowerShell Modules
|
||||
ECHO %TIME:~0,8% Install some PowerShell Modules >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Install-PowerShellModules_required.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:InstallChocoWorkstationPackages
|
||||
ECHO Install Choco Workstation packages
|
||||
ECHO %TIME:~0,8% Install Choco Workstation packages >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(c:\scripts\PowerShell\Install-ChocoPackages_Workstation.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:InstallWinGetFromTheGitHubRepository
|
||||
ECHO Install WinGet from the GitHub Repository
|
||||
ECHO %TIME:~0,8% Install WinGet from the GitHub Repository >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Install-WingetFromRepositoryRelease.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:AutomateTheDriverUpdateProcess
|
||||
ECHO Automate the driver update process
|
||||
ECHO %TIME:~0,8% Automate the driver update process >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -Command "(c:\scripts\PowerShell\Invoke-MSIntuneDriverUpdate.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:DesktopCleanup
|
||||
ECHO Desktop Cleanup
|
||||
ECHO %TIME:~0,8% Desktop Cleanup >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Remove-AllPublicDesktopLinks.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
ECHO Set the default Start menu
|
||||
ECHO %TIME:~0,8% Set the default Start menu >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Set-DefaultStartMenu.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:DisableWindowsScriptHost
|
||||
:: Turn off Windows Script Host (current user only)
|
||||
ECHO Turn off Windows Script Host
|
||||
ECHO %TIME:~0,8% Turn on Windows Script Host >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (New-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows Script Host\Settings' -Name Enabled -PropertyType DWord -Value 0 -Force -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:EncryptTheBootDriveWithBitLocker
|
||||
ECHO Encrypt the Boot drive with BitLocker
|
||||
ECHO %TIME:~0,8% Encrypt the Boot drive with BitLocker >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Enable-BitLockerEncryption.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:SaveBitLockerKeyToAzureAD
|
||||
ECHO Save BitLocker Key to AzureAD
|
||||
ECHO %TIME:~0,8% Save BitLocker Key to AzureAD >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Invoke-BackupBitLockerKeyToAAD.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:ApplyAllPendingMicrosoftUpdates
|
||||
ECHO Apply all pending Microsoft updates
|
||||
ECHO %TIME:~0,8% Apply all pending Microsoft updates >>%logfile_setup% 2>&1
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "(C:\scripts\PowerShell\Install-AllMissingMicrosoftUpdates.ps1 -ErrorAction Continue)" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: DEFAULT
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "$null = (Set-MpPreference -EnableControlledFolderAccess Enabled -Force -ErrorAction SilentlyContinue)" >nul 2>&1
|
||||
SC stop wsearch >nul 2>&1
|
||||
:: DEFAULT
|
||||
|
||||
:SetPowerPlanToAuto
|
||||
ECHO Set Power Plan to Auto
|
||||
ECHO %TIME:~0,8% Set Power Plan to Auto >>%logfile_setup%
|
||||
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "c:\scripts\PowerShell\Set-PowerPlanToAuto.ps1" >>%logfile_setup% 2>&1
|
||||
ECHO Errorlevel=%Errorlevel% >>%logfile_setup% 2>nul
|
||||
|
||||
:: Go away
|
||||
POPD >nul 2>&1
|
||||
CD / >nul 2>&1
|
||||
|
||||
ECHO %TIME:~0,8% Bootstrap and JumpStart finished >>%logfile_setup%
|
||||
ECHO ******************************************************************************** >>%logfile_setup%
|
||||
ECHO.>>%logfile_setup% 2>nul
|
||||
|
||||
:: Initiate a restart
|
||||
SHUTDOWN -r -t 5 >nul 2>&1
|
||||
|
||||
:: Final cleanup
|
||||
IF EXIST c:\install\ rd /s /q c:\install\ >nul 2>&1
|
||||
|
||||
:: ********************************************************************************************************************
|
||||
::
|
||||
:: Changelog:
|
||||
::
|
||||
:: 0.9.0: Internal Test
|
||||
:: 1.0.0: Initial Release
|
||||
::
|
||||
:: ********************************************************************************************************************
|
||||
::
|
||||
:: License: BSD 3-Clause License
|
||||
::
|
||||
:: Copyright 2020, enabling Technology
|
||||
:: All rights reserved.
|
||||
::
|
||||
:: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
||||
:: following conditions are met:
|
||||
:: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
:: disclaimer.
|
||||
:: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
|
||||
:: following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
:: 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
|
||||
:: products derived from this software without specific prior written permission.
|
||||
::
|
||||
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
:: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
:: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
:: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
:: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
:: WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
:: USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
::
|
||||
:: ********************************************************************************************************************
|
||||
::
|
||||
:: Disclaimer:
|
||||
:: - Use at your own risk, etc.
|
||||
:: - This is open-source software, if you find an issue try to fix it yourself. There is no support and/or warranty
|
||||
:: in any kind
|
||||
:: - This is a third-party Software
|
||||
:: - The developer of this Software is NOT sponsored by or affiliated with Microsoft Corp (MSFT) or any of its
|
||||
:: subsidiaries in any way
|
||||
:: - The Software is not supported by Microsoft Corp (MSFT)
|
||||
:: - By using the Software, you agree to the License, Terms, and any Conditions declared and described above
|
||||
:: - If you disagree with any of the Terms, and any Conditions declared: Just delete it and build your own solution
|
||||
::
|
||||
:: ********************************************************************************************************************
|
||||
Reference in New Issue
Block a user