Windows Server 2016+ - Start Menu does not open
Recently, an error occurs more frequently in Windows terminal servers
which leads to the start menu no longer being opened
can.
Below are a few points where you fail
could. In the end, I'm going to add a PS Script to the
Steps all go through. In tests, this has worked and
It may also help others.
Reason of the problem (a presumption)
When a user is logged in, the registry
different keys new properties created in the registry. These
will be regenerated at each login, but not by default
automatically deleted.
After each registration, new
generates properties for the firewall and when opening the start menu
/or Cortana, the whole list of rules is checked as soon as the
Server can no longer act, the start menu can no longer
to be opened.
To solve the problem I wrote a small script, which fixes the problem with some tests. This Deletes 2 Keys or the properties that have been created and then restarts the start menu.
Lastly, the function to delete the created entries is set, which should fix the problem permanently.
Script
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
#> Counter for tracking <#
$removedEntries = 0;
$ignoredEntries = 0;
$toalCheckedEntries = 0;
<# $path = 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sharedAccess\parameters\FirewallPolicy\RestrictedServices\AppIso\FirewallRules' #>
$prePath = 'Registry::';
$path = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules'
$strExportFileName = "RegSaveKey1.reg";
$strExportPath = "C:\temp\registryBackup";
mkdir $strExportPath;
Write-Output 'Script zum beheben von Startmenuproblemen auf WindowsServer2016'
Write-Output 'Loeschen von Firewall Rules'
$cont = Read-Host 'Soll das Script den FireWall Rules Ordner leeren [Y/n]?: '
if($cont -ne "Y" -and $cont -ne "J" -and $cont -ne "")
{
Write-Output "Der Registry Key 'Firewall Rules' wird nicht geleert! - Script beendet!";
}
else {
$cont = Read-Host 'Soll die Registry gesichert werden [Y/n] (empfohlen) ?: '
if($cont -eq "Y" -or $cont -eq "J" -or $cont -eq "")
{
Write-Output "Sicherung von $path"
Write-Output "Sicherung der Registry...";
Write-Output "reg export $path $strExportPath\$strExportFileName"
$res = reg export $path $strExportPath\$strExportFileName;
}
else
{
$res = 0;
}
if($res -eq 1)
{
Write-Output "Can't save Registry! - Abort cleaning Folder!";
Pause
exit
}
if($res -eq 0) {
Write-Output "Registry gesichert. Pfad: $strExportPath\$strExportFileName";
$allPropertyNames = @();
Write-Output "Loesche FireWall Rules unter $path";
$RegKey = (Get-ItemProperty $prePath$path | Select-Object * -exclude PS*)
$RegKey.PSObject.Properties | ForEach-Object {
$allPropertyNames += $_.Name;
}
$numberOfProperties = $allPropertyNames.Count;
Write-Output "Abrufen der Eintraege beendet!"
Write-Output "Anzahl der zu pruefenden Properties: $numberOfProperties"
ForEach($entry in $allPropertyNames)
{
if($entry.StartsWith("{") -and $entry.EndsWith("}"))
{
Remove-ItemProperty -Path $path -Name $entry;
$removedEntries++;
}
else {
$ignoredEntries++;
}
$toalCheckedEntries++;
if($removedEntries % 1000 -eq 0 -and $removedEntries -ge 1)
{
Write-Output "Es wurden $removedEntries properties geloescht"
}
}
Write-Output "Loeschen der Firewall Rules Step 1 beendet."
Write-Output "Insgesamt geprueft: $toalCheckedEntries, Geloeschte Eintraege: $removedEntries, Ignorierte Entraege: $ignoredEntries";
}
}
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
<# 2. Ordner wird geloescht#>
#> Counter for tracking <#
$removedEntries = 0;
$ignoredEntries = 0;
$toalCheckedEntries = 0;
<# $path = 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sharedAccess\parameters\FirewallPolicy\RestrictedServices\AppIso\FirewallRules' #>
$prePath = 'Registry::';
$path = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sharedAccess\parameters\FirewallPolicy\RestrictedServices\AppIso\FirewallRules'
$strExportFileName = "RegSave2.reg";
$strExportPath = "C:\temp\registryBackup";
mkdir $strExportPath;
Write-Output 'Loesche Pfad 2'
Write-Output 'Rufe Properties ab'
$cont = Read-Host 'Soll die Registry gesichert werden (nicht wichtig) [Y/n]?: '
if($cont -eq "Y" -or $cont -eq "J" -or $cont -eq "")
{
Write-Output "Sicherung von $path"
Write-Output "Sicherung der Registry...";
Write-Output "reg export $path $strExportPath\$strExportFileName"
$res = reg export $path $strExportPath\$strExportFileName;
}
else
{
$res = 0;
}
if($res -eq 1)
{
Write-Output "Can't save Registry! - Abort cleaning Folder!";
Pause
exit
}
if($res -eq 0) {
Write-Output "Registry gesichert. Pfad: $strExportPath\$strExportFileName";
$allPropertyNames = @();
Write-Output "Loesche FireWall Rules unter $path";
$RegKey = (Get-ItemProperty $prePath$path | Select-Object * -exclude PS*)
$RegKey.PSObject.Properties | ForEach-Object {
$allPropertyNames += $_.Name;
}
$numberOfProperties = $allPropertyNames.Count;
Write-Output "Abrufen der Eintraege beendet!"
Write-Output "Anzahl der zu pruefenden Properties: $numberOfProperties"
ForEach($entry in $allPropertyNames)
{
if($entry.StartsWith("{") -and $entry.EndsWith("}"))
{
Remove-ItemProperty -Path $path -Name $entry;
$removedEntries++;
}
else {
$ignoredEntries++;
}
$toalCheckedEntries++;
if($removedEntries % 1000 -eq 0 -and $removedEntries -ge 1)
{
Write-Output "Es wurden $removedEntries properties geloescht"
}
}
Write-Output "Loeschen der Firewall Rules beendet."
Write-Output "Insgesamt geprueft: $toalCheckedEntries, Geloeschte Eintraege: $removedEntries, Ignorierte Entraege: $ignoredEntries";
}
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
$cont = Read-Host 'Alle problematischen Eintraege geloescht...'
DWORD "DeleteUserAppContainersOnLogoff = 1 in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy"
Write-Output "Das Script wird beendet!"
Pause
Back…