Initial
This commit is contained in:
80
01_Config/SRV-WSUS-01/BGInfo-SRV-WSUS-01.ps1
Normal file
80
01_Config/SRV-WSUS-01/BGInfo-SRV-WSUS-01.ps1
Normal file
@@ -0,0 +1,80 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
||||
A script used to download, install and configure the latest BgInfo version on a Windows Server 2016 or 2019.
|
||||
|
||||
.DESCRIPTION
|
||||
|
||||
A script used to download, install and configure the latest BgInfo version (v4.27) on a Windows Server 2016 or 2019. The BgInfo folder will be created on the C: drive if the folder does not already exist.
|
||||
Then the latest BgInfo.zip file will be downloaded and extracted in the BgInfo folder. The LogonBgi.zip file which holds the preferred settings will also be downloaded and extracted to the BgInfo folder.
|
||||
After extraction both .zip files will be deleted. A registry key (regkey) to AutoStart the BgInfo tool in combination with the logon.bgi config file will be created. At the end of the script BgInfo will
|
||||
be started for the first time and the PowerShell window will be closed.
|
||||
|
||||
.NOTES
|
||||
|
||||
File Name: BgInfo_Automated_Windows_Server_2016_2019.ps1
|
||||
Created: 08/09/2019
|
||||
Last modified: 13/09/2019
|
||||
Author: Wim Matthyssen
|
||||
PowerShell: 5.1 or above
|
||||
Requires: -RunAsAdministrator
|
||||
OS: Windows Server 2016 and Windows Server 2019
|
||||
Version: 2.2
|
||||
Action: Change variables were needed to fit your needs
|
||||
Disclaimer: This script is provided "As Is" with no warranties.
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
.\BgInfo_Automated_Windows_Server_2016_2019.ps1
|
||||
|
||||
.LINK
|
||||
|
||||
https://tinyurl.com/y3wmsh7o
|
||||
#>
|
||||
|
||||
## Variables
|
||||
|
||||
$bgInfoFolder = "C:\BgInfo"
|
||||
$bgInfoFolderContent = $bgInfoFolder + "\*"
|
||||
$itemType = "Directory"
|
||||
$bgInfoUrl = "https://download.sysinternals.com/files/BGInfo.zip"
|
||||
$bgInfoZip = "C:\BgInfo\BGInfo.zip"
|
||||
$bgInfoEula = "C:\BgInfo\Eula.txt"
|
||||
$logonBgiUrl = "https://tinyurl.com/yxlxbgun"
|
||||
$logonBgiZip = "C:\BgInfo\LogonBgi.zip"
|
||||
$bgInfoRegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
|
||||
$bgInfoRegKey = "BgInfo"
|
||||
$bgInfoRegType = "String"
|
||||
$bgInfoRegKeyValue = "C:\BgInfo\Bginfo64.exe C:\BgInfo\logon.bgi /timer:0 /nolicprompt"
|
||||
$regKeyExists = (Get-Item $bgInfoRegPath -EA Ignore).Property -contains $bgInfoRegkey
|
||||
$writeEmptyLine = "`n"
|
||||
$writeSeperator = " - "
|
||||
$time = Get-Date -UFormat "%A %m/%d/%Y %R"
|
||||
$foregroundColor1 = "Yellow"
|
||||
$foregroundColor2 = "Red"
|
||||
|
||||
##-------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Create BgInfo Registry Key to AutoStart
|
||||
|
||||
If ($regKeyExists -eq $True){Write-Host ($writeEmptyLine + "BgInfo regkey exists, script wil go on" + $writeSeperator + $time)`
|
||||
-foregroundcolor $foregroundColor2 $writeEmptyLine
|
||||
}Else{
|
||||
New-ItemProperty -Path $bgInfoRegPath -Name $bgInfoRegkey -PropertyType $bgInfoRegType -Value $bgInfoRegkeyValue
|
||||
Write-Host ($writeEmptyLine + "# BgInfo regkey added" + $writeSeperator + $time)`
|
||||
-foregroundcolor $foregroundColor1 $writeEmptyLine}
|
||||
|
||||
##-------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Run BgInfo
|
||||
|
||||
C:\BgInfo\Bginfo64.exe C:\BgInfo\logon.bgi /timer:0 /nolicprompt
|
||||
|
||||
##-------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Exit PowerShell window 2 seconds after completion
|
||||
|
||||
Start-Sleep 2
|
||||
stop-process -Id $PID
|
||||
|
||||
##-------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
10
01_Config/SRV-WSUS-01/Network-SRV-WSUS-01.ps1
Normal file
10
01_Config/SRV-WSUS-01/Network-SRV-WSUS-01.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
# Networkconfiguration
|
||||
|
||||
$ConfigAdapterName = Get-NetAdapter | where MacAddress -eq "00-15-5D-01-10-6D"
|
||||
|
||||
Rename-NetAdapter -Name $ConfigAdapterName.name -NewName "Primary Adapter"
|
||||
Set-NetIPInterface -InterfaceIndex $ConfigAdapterName.ifIndex -Dhcp Disabled
|
||||
|
||||
New-NetIPAddress -InterfaceIndex $ConfigAdapterName.ifIndex -IPAddress 192.168.10.15 -DefaultGateway 192.168.10.1 -PrefixLength 24
|
||||
Set-DNSClientServerAddress -InterfaceIndex $ConfigAdapterName.ifIndex -ServerAddresses ("192.168.10.11","192.168.10.10")
|
||||
Set-DnsClientGlobalSetting -SuffixSearchList @("schwab.local")
|
||||
122
01_Config/SRV-WSUS-01/Unattend-SRV-WSUS-01.xml
Normal file
122
01_Config/SRV-WSUS-01/Unattend-SRV-WSUS-01.xml
Normal file
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<servicing>
|
||||
<package action="configure">
|
||||
<assemblyIdentity name="Package_for_KB3192137" version="10.0.1.0" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />
|
||||
</package>
|
||||
<package action="configure">
|
||||
<assemblyIdentity name="Package_for_KB3211320" version="10.0.1.1" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />
|
||||
</package>
|
||||
</servicing>
|
||||
<settings pass="windowsPE">
|
||||
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<InputLocale>eu-US</InputLocale>
|
||||
<SystemLocale>eu-US</SystemLocale>
|
||||
<UILanguage>eu-US</UILanguage>
|
||||
<UILanguageFallback>eu-US</UILanguageFallback>
|
||||
<UserLocale>de-CH</UserLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UserData>
|
||||
<AcceptEula>true</AcceptEula>
|
||||
<FullName>Local-Admin</FullName>
|
||||
</UserData>
|
||||
<EnableFirewall>true</EnableFirewall>
|
||||
<EnableNetwork>true</EnableNetwork>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="generalize">
|
||||
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<SkipRearm>1</SkipRearm>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="specialize">
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UILanguageFallback>en-US</UILanguageFallback>
|
||||
<UserLocale>de-CH</UserLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<SkipAutoActivation>true</SkipAutoActivation>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<CEIPEnabled>0</CEIPEnabled>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<ComputerName>SRV-WSUS-01</ComputerName>
|
||||
<ProductKey>TMJ3Y-NTRTM-FJYXT-T22BY-CWG3J</ProductKey>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<fDenyTSConnections>false</fDenyTSConnections>
|
||||
</component>
|
||||
<component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<FirewallGroups>
|
||||
<FirewallGroup wcm:action="add" wcm:keyValue="1">
|
||||
<Active>true</Active>
|
||||
<Group>Remote Desktop</Group>
|
||||
<Profile>all</Profile>
|
||||
</FirewallGroup>
|
||||
</FirewallGroups>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<UserAuthentication>0</UserAuthentication>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<AutoLogon>
|
||||
<Password>
|
||||
<Value>MQBBAGQAbQBpAG4AUABhAHMAcwB3AG8AcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</Password>
|
||||
<Enabled>true</Enabled>
|
||||
<Username>Local-Admin</Username>
|
||||
</AutoLogon>
|
||||
<DesktopOptimization>
|
||||
<ShowWindowsStoreAppsOnTaskbar>false</ShowWindowsStoreAppsOnTaskbar>
|
||||
</DesktopOptimization>
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
|
||||
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
||||
<HideLocalAccountScreen>true</HideLocalAccountScreen>
|
||||
<ProtectYourPC>1</ProtectYourPC>
|
||||
<UnattendEnableRetailDemo>true</UnattendEnableRetailDemo>
|
||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||
</OOBE>
|
||||
<UserAccounts>
|
||||
<LocalAccounts>
|
||||
<LocalAccount wcm:action="add">
|
||||
<Password>
|
||||
<Value>MQBBAGQAbQBpAG4AUABhAHMAcwB3AG8AcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
|
||||
<PlainText>false</PlainText>
|
||||
</Password>
|
||||
<DisplayName>Administrator (Local)</DisplayName>
|
||||
<Group>Administrators</Group>
|
||||
<Name>Local-Admin</Name>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
</UserAccounts>
|
||||
<WindowsFeatures>
|
||||
<ShowInternetExplorer>false</ShowInternetExplorer>
|
||||
<ShowMediaCenter>false</ShowMediaCenter>
|
||||
<ShowWindowsMediaPlayer>false</ShowWindowsMediaPlayer>
|
||||
</WindowsFeatures>
|
||||
<BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>
|
||||
<ConvertibleSlateModePromptPreference>0</ConvertibleSlateModePromptPreference>
|
||||
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
|
||||
<SignInMode>1</SignInMode>
|
||||
<TimeZone>W. Europe Standard Time</TimeZone>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<InputLocale>de-CH</InputLocale>
|
||||
<SystemLocale>de-CH</SystemLocale>
|
||||
<UILanguage>de-CH</UILanguage>
|
||||
<UILanguageFallback>de-CH</UILanguageFallback>
|
||||
<UserLocale>de-CH</UserLocale>
|
||||
</component>
|
||||
</settings>
|
||||
<cpi:offlineImage cpi:source="wim:c:/winserver_image/02_sources/2016/wim/install.wim#Windows Server 2016 SERVERDATACENTER" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
|
||||
</unattend>
|
||||
Reference in New Issue
Block a user