On this weblog submit, I’ll present you the right way to deploy and configure the most recent model of BgInfo on a server operating Home windows Server 2025 utilizing a PowerShell script.
💡 This script additionally works on servers operating Home windows Server 2016, 2019, and 2022.
Most IT professionals and Home windows server directors are seemingly aware of the Home windows Sysinternals software BgInfo (at the moment model 4.33). For many who aren’t, it’s a free Microsoft software that captures system data from a workstation or server (particularly helpful on servers) and shows related information instantly on the desktop. It reveals particulars like DNS settings, IP addresses, laptop title, area title, OS model, reminiscence, service pack model, and extra.
Every time I create a brand new Home windows Server 2025 Digital Machine (VM) template for purchasers, deploy a bodily server, or arrange a check server in my dwelling setting or lab, I often add BgInfo to the bottom (or golden) picture, or after deployment, and configure it to begin mechanically when a consumer logs in.
To make this course of simpler, I wrote a PowerShell script that automates your complete BgInfo set up and configuration. On this weblog submit, I’ll stroll you thru the steps to set it up.
Desk of Contents
Stipulations
- A server (bodily or digital) operating Home windows Server 2025 with web entry to obtain the most recent model of BgInfo and the logon.bgi file.

💡 You’ll be able to all the time modify the script to retrieve the information from a central file server or firm share if direct Web entry is unavailable or restricted resulting from safety insurance policies.
PowerShell script
To start, let me clarify what this PowerShell script does:
- Verify if PowerShell is operating as Administrator, in any other case exit the script.
- Create a BgInfo folder on the C: drive if it doesn’t exist already; in any other case, delete its contents.
- Obtain, save and extract newest BGInfo software program to C:BgInfo.
- Obtain, save and extract logon.bgi file to C:BgInfo.
- Create BgInfo registry key for AutoStart.
- Run BgInfo.
To make use of the script, begin by saving a replica as “Deploy-BgInfo-WS2016-WS2019-WS2022-WS2025.ps1” or obtain it instantly from GitHub. Modify the variables to fit your particular wants, after which run the script utilizing Home windows PowerShell (as Administrator) on the server or template VM.
💡 I usually put it aside regionally within the C:Temp folder on the server and run it from there.


## ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Variables
$bgInfoFolder = "C:BgInfo"
$bgInfoFolderContent = "$bgInfoFolder*"
#$itemType = "Listing"
$bgInfoUrl = "https://obtain.sysinternals.com/information/BGInfo.zip"
$bgInfoZip = "C:BgInfoBGInfo.zip"
$bgInfoEula = "C:BgInfoEula.txt"
$logonBgiUrl = "https://tinyurl.com/yxlxbgun"
$logonBgiZip = "$bgInfoFolderLogonBgi.zip"
$bgInfoRegPath = "HKLM:SOFTWAREMicrosoftWindowsCurrentVersionRun"
$bgInfoRegKey = "BgInfo"
#$bgInfoRegType = "String"
$bgInfoRegKeyValue = "C:BgInfoBginfo64.exe C:BgInfologon.bgi /timer:0 /nolicprompt"
#$regKeyExists = (Get-Merchandise $bgInfoRegPath -EA Ignore).Property -contains $bgInfoRegkey
$world:currenttime= Set-PSBreakpoint -Variable currenttime -Mode Learn -Motion {$world:currenttime= Get-Date -UFormat "%A %m/%d/%Y %R"}
$foregroundColor1 = "Inexperienced"
$foregroundColor2 = "Yellow"
$foregroundColor3 = "Pink"
$writeEmptyLine = "`n"
$writeSeperatorSpaces = " - "
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Verify if PowerShell is operating as Administrator, in any other case exit the script
$currentPrincipal = New-Object Safety.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host ($writeEmptyLine + "# Please run PowerShell as Administrator" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor3 $writeEmptyLine
exit
}
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Write script began
Write-Host ($writeEmptyLine + "# Script began. With out errors, it will probably take as much as 2 minutes to finish" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor1 $writeEmptyLine
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Create a BgInfo folder on the C: drive if it does not exist already; in any other case, delete its contents
attempt {
if (!(Take a look at-Path -Path $bgInfoFolder)) Out-Null
Write-Host ($writeEmptyLine + "# BgInfo folder created at $bgInfoFolder" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor2 $writeEmptyLine
else {
Take away-Merchandise -Path $bgInfoFolderContent -Pressure -Recurse -ErrorAction SilentlyContinue
Write-Host ($writeEmptyLine + "# Present BgInfo folder content material deleted" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor2 $writeEmptyLine
}
} catch {
Write-Host ($writeEmptyLine + "# Didn't create or clear BgInfo folder: $_" + "ERROR" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor3 $writeEmptyLine
exit
}
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Obtain, save and extract newest BGInfo software program to C:BgInfo
attempt {
# Import the BitsTransfer module to allow file switch utilizing Background Clever Switch Service (BITS)
Import-Module BitsTransfer -ErrorAction Cease
# Obtain the BgInfo ZIP file from the desired URL and put it aside to the desired vacation spot
Begin-BitsTransfer -Supply $bgInfoUrl -Vacation spot $bgInfoZip
# Extract the contents of the downloaded ZIP file to the BgInfo folder
Increase-Archive -LiteralPath $bgInfoZip -DestinationPath $bgInfoFolder -Pressure
# Take away the ZIP file and the EULA file after extraction to scrub up
Take away-Merchandise $bgInfoZip, $bgInfoEula -Pressure
Write-Host ($writeEmptyLine + "# BgInfo downloaded and extracted efficiently" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor2 $writeEmptyLine
} catch {
Write-Host ($writeEmptyLine + "# Didn't obtain or extract BgInfo: $_" + "ERROR" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor3 $writeEmptyLine
exit
}
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Obtain, save and extract logon.bgi file to C:BgInfo
attempt {
# Guarantee TLS 1.2 is used for compatibility with fashionable HTTPS endpoints (required for Home windows Server 2016)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Obtain the logon.bgi file
Invoke-WebRequest -Uri $logonBgiUrl -OutFile $logonBgiZip -ErrorAction Cease
# Extract the ZIP file
Increase-Archive -LiteralPath $logonBgiZip -DestinationPath $bgInfoFolder -Pressure
# Clear up the ZIP file
Take away-Merchandise $logonBgiZip -Pressure
Write-Host ($writeEmptyLine + "# logon.bgi accessible" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor2 $writeEmptyLine
} catch {
Write-Host ($writeEmptyLine + "# Didn't obtain or extract logon.bgi: $_" + "ERROR" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor3 $writeEmptyLine
exit
}
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Create BgInfo registry key for AutoStart
attempt {
if (Get-ItemProperty -Path $bgInfoRegPath -Title $bgInfoRegKey -ErrorAction SilentlyContinue) {
Write-Host ($writeEmptyLine + "# BgInfo registry key already exists" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor2 $writeEmptyLine
} else Out-Null
Write-Host ($writeEmptyLine + "# BgInfo registry key created" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor2 $writeEmptyLine
} catch {
Write-Host ($writeEmptyLine + "# Didn't create BgInfo registry key: $_" + "ERROR" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor3 $writeEmptyLine
exit
}
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Run BgInfo
attempt {
Begin-Course of -FilePath "C:BgInfoBginfo64.exe" -ArgumentList "C:BgInfologon.bgi /timer:0 /nolicprompt" -NoNewWindow -Wait
Write-Host ($writeEmptyLine + "# BgInfo executed efficiently" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor2 $writeEmptyLine
} catch {
Write-Host ($writeEmptyLine + "# Didn't execute BgInfo: $_" + "ERROR" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor3 $writeEmptyLine
exit
}
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Write script accomplished
Write-Host ($writeEmptyLine + "# Script accomplished" + $writeSeperatorSpaces + $currentTime)`
-foregroundcolor $foregroundColor1 $writeEmptyLine
## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------





Utilizing the script on different supported Home windows Server OSes
💡 You’ll be able to simply test the Home windows OS model on a server by opening Home windows PowerShell and operating the next command: systeminfo | findstr /B /C:”OS Title” /C:”OS Model”
Home windows Server 2022


Home windows Server 2019


Home windows Server 2016


Conclusion
On this weblog submit, I launched a PowerShell script that helps automate the deployment and configuration of BgInfo, a free Microsoft software that shows system particulars like IP addresses, laptop title, OS model, and extra, proper on the desktop.
I hope the script proves helpful when organising servers or creating VM templates. When you have any questions or ideas, be happy to succeed in out on X (@wmatthyssen) or depart a remark beneath.