diff --git a/GPO/NETworkManager.admx b/GPO/NETworkManager.admx new file mode 100644 index 0000000000..e8346821f0 --- /dev/null +++ b/GPO/NETworkManager.admx @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GPO/en-US/NETworkManager.adml b/GPO/en-US/NETworkManager.adml new file mode 100644 index 0000000000..2c6790195f --- /dev/null +++ b/GPO/en-US/NETworkManager.adml @@ -0,0 +1,16 @@ + + + NETworkManager Policy Settings + Policy settings for NETworkManager + + + At least NETworkManager 2025.11.11.0 + Disable Update Check + When enabled, this policy prevents NETworkManager from checking for updates on startup. When disabled or not configured, update checks are performed. + + + \ No newline at end of file diff --git a/Scripts/Update-LocalGroupPolicy.ps1 b/Scripts/Update-LocalGroupPolicy.ps1 new file mode 100644 index 0000000000..351ce82579 --- /dev/null +++ b/Scripts/Update-LocalGroupPolicy.ps1 @@ -0,0 +1,24 @@ +# Check for administrative privileges and rerun as administrator if needed +if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) +{ + Write-Host "Script is not running with administrative privileges. Restarting with elevated rights..." + Start-Process -FilePath "powershell.exe" -ArgumentList "-NoProfile -ExecutionPolicy Bypass -NoExit -File `"$PSCommandPath`"" -Verb RunAs + exit +} + +# Update local group policy files for NETworkManager +[string]$GpoFolderPath = Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath "GPO" +[string]$AdmxFilePath = Join-Path -Path $GpoFolderPath -ChildPath "NETworkManager.admx" +[string]$AdmlFolderPath = Join-Path -Path $GpoFolderPath -ChildPath "en-US" +[string]$AdmlFilePath = Join-Path -Path $AdmlFolderPath -ChildPath "NETworkManager.adml" + +# Copy ADMX file to local policy store +$LocalAdmxPath = Join-Path -Path "$env:SystemRoot\PolicyDefinitions" -ChildPath "NETworkManager.admx" +Copy-Item -Path $AdmxFilePath -Destination $LocalAdmxPath -Force + +# Copy ADML file to local policy store +$LocalAdmlPath = Join-Path -Path "$env:SystemRoot\PolicyDefinitions\en-US" -ChildPath "NETworkManager.adml" +Copy-Item -Path $AdmlFilePath -Destination $LocalAdmlPath -Force + +# End of script +Write-Host "Local Group Policy files for NETworkManager have been updated."