potshock
Goto Top

Powershell Script zur Konfiguration Ansichtsoptionen des Explorers

Hallo Admins,

ich hoffe Ihr könnt in klimatisierten Räumen arbeiten, mir läuft hier leider die Suppe runter face-sad!

Aber jetzt zu meinem Problem: Ich möchte alle Ansichtsoptionen des Explorers für Standalone Geräte per Powershell Script konfigurieren.

Meine Einträge sehen z.B. für "Immer Menues anzeigen wird aktiviert" folgendermassen aus:
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "AlwaysShowMenus" -value "1"  
Dies klappt auch grösstenteils, aber bei ein paar Einstellungen benötige ich Eure Hilfe.
Zum einen stellt sich die Frage habe ich hier die richtigen Registry Einträge recherchiert bzw. mit RegShot aufgezeichnet?
Problem 1. und 4. kann ich mir gar nicht erklären!


1. Problem: Erweiterungen bei bekannten Dateitypen ausblenden wird aktiviert:
Markiere ich die Zeile im WindowsPowershell ISE (als Administrator gestartet) und drücke F8 (Auswahl ausführen) ist der Haken gesetzt und die Erweiterungen werden mir im Explorer auch angezeigt!
Führe ich aber das gesammte Script aus, wird der Registry Eintrag nicht gesetzt (auch nach Neustart nicht!)
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -value "0"  

2. Problem: Kontrollkaestchen zur Auswahl von Elementen verwenden wird aktiviert:
Der Regístry Eintrag wird gesetzt, aber der Haken im Menü wird nicht gesetzt und funktioniert natürlich auch nicht.
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "AutoCheckSelect" -value "1"  

3. Problem: Ausgeblendete Dateien, Ordner oder Laufwerke anzeigen wird deaktiviert:
Der Regístry Eintrag wird gesetzt, aber der Haken im Menü wird nicht gesetzt und funktioniert natürlich auch nicht.
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -value "1"  

4. Problem: Naviagtionsbereich: Bibliotheken anzeigen wird deaktiviert:
Set-ItemProperty -Type DWord -Path "HKCR:\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}" -Name "System.IsPinnedToNameSpaceTree" -value "1"  
Hier bekomme ich folgende Fehlermeldung:
Set-ItemProperty : Es wurde kein Parameter gefunden, der dem Parameternamen "Type" entspricht.
Da er sonst aber an daran nichts auszusetzten hat gehe ich davon aus das das Problem die Klammern {} sind.
Muss ich diese maskieren ?

Frohes Schaffen und Schwitzen face-smile

Potshock

Content-Key: 466111

Url: https://administrator.de/contentid/466111

Printed on: April 18, 2024 at 14:04 o'clock

Member: emeriks
emeriks Jun 26, 2019 at 11:00:50 (UTC)
Goto Top
Hi,
Zitat von @potshock:
1. Problem: Erweiterungen bei bekannten Dateitypen ausblenden wird aktiviert:
Markiere ich die Zeile im WindowsPowershell ISE (als Administrator gestartet) und drücke F8 (Auswahl ausführen) ist der Haken gesetzt und die Erweiterungen werden mir im Explorer auch angezeigt!
Führe ich aber das gesammte Script aus, wird der Registry Eintrag nicht gesetzt (auch nach Neustart nicht!)
Wir kennen jetzt das ganze Script nicht, aber es könnte sein, dass die Script-Ausführung schon davor abbricht, z.B. wegen Fehler im Try-Catch-Block oder wegen einem "break".
Der Regístry Eintrag wird gesetzt, aber der Haken im Menü wird nicht gesetzt und funktioniert natürlich auch nicht.
Das liegt höchstwahrscheinlich daran, dass dafür der Prozess "explorer.exe" neu gestartet werden muss.

E.
Member: potshock
potshock Jun 26, 2019 updated at 12:11:35 (UTC)
Goto Top
Hi emeriks,


"Der Regístry Eintrag wird gesetzt, aber der Haken im Menü wird nicht gesetzt und funktioniert natürlich auch nicht.
Das liegt höchstwahrscheinlich daran, dass dafür der Prozess "explorer.exe" neu gestartet werden muss."

Das kann ich ausschließen, habe den Explorer erst über den Taskmanager neu gestartet, als das nicht half komplett gebootet.

OK, hier nun das gesamte Script:

Tante Edit ruft: 1. Problem: Erweiterungen bei bekannten Dateitypen ausblenden wird aktiviert hat sich erledigt face-smile!

Die Problemeinträge habe ich jeweils mit einer Leerzeile umrandet face-wink, da Fett innerhalb der Code Tags nicht funktioniert!
#######################################################################################
# 20190624
# Windows 10 Build 1903 Benutzer Einstellungen, u.a. Explorer Ansichts Optionen 
#######################################################################################
# ACHTUNG!
# Zuerst das Ausfuehren von unsignierten Powershell Scripts manuell erlauben: Set-ExecutionPolicy Unrestricted
#######################################################################################
# Fehler beim Ausfuehren werden unterdrueckt, in eine Logdatei geschrieben und das Script faehrt fort
#######################################################################################
$ErrorActionPreference = "SilentlyContinue"  
# Pfad zur Logdatei
$Log = "$env:SystemDrive:\Users\$env:USERNAME\Desktop\ErrorBenutzerEinstellungen.log"  
########################################################################################
# Systemsteuerung -> Internetoptionen -> Startseite: http://IrgendEineAdresse
########################################################################################
Write-Host -Foreground Yellow "Die Startseite des IE wird auf http://IrgendEineAdresse gesetzt."  
Set-ItemProperty -Type ExpandString -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Name "Start Page" -value "IrgendEineAdresse"  
########################################################################################
# Systemsteuerung -> Internetoptionen -> Verbindungen -> LAN-Einstellungen -> Automatische Konfiguration des Proxy
########################################################################################
Write-Host -Foreground Yellow "Fuer die Lan-Einstellungen wird die Automatische Konfiguration des Proxy durchgefuehrt."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name "AutoDetect" -value "0"  
Set-ItemProperty -Type ExpandString -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name "AutoConfigURL" -value "http://IrgendEineAdresse/proxy.pac"  
########################################################################################
# Systemsteuerung -> Internetoptionen -> Sicherheit -> Internet -> Stufe anpassen (Ein Klick = 77 Eintraege!)
########################################################################################
Write-Host -Foreground Yellow "Es wird unter Systemsteuerung -> Internetoptionen -> Sicherheit -> Internet die Stufe angepasst."  
if (Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3") {  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1001" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1004" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1200" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1201" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1206" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1207" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1208" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1209" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "120A" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "120B" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "120C" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1400" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1402" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1405" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1406" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1407" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1408" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1409" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "140A" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "140C" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1601" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1604" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1605" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1606" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1607" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1608" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1609" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "160A" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "160B" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1802" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1803" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1804" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1806" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1809" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1812" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1A00" -value "131072"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1A02" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1A03" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1A04" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1A05" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1A06" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1A10" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "1C00" -value "65536"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2000" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2001" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2004" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2005" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2007" -value "65536"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2100" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2101" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2102" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2103" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2104" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2105" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2106" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2107" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2200" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2201" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2300" -value "1"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2301" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2302" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2400" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2401" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2402" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2500" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2600" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2700" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2701" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2702" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2703" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2704" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2707" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2708" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "2709" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "270B" -value "3"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "270C" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" -Name "270D" -value "3"  
}
########################################################################################
# Systemsteuerung -> Internetoptionen -> Inhalte -> Autovervollstaendigen -> Einstellungen: "Benutzernamen und Kennwoerter für Formulare"  
# und "Vor dem Speichern von Kennwoertern nachfragen" deaktivieren 
########################################################################################
Write-Host -Foreground Yellow "Es wird unter Systemsteuerung -> Internetoptionen -> Inhalte -> Autovervollstaendigen konfiguriert."  
Set-ItemProperty -Type String -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Name "FormSuggest Passwords" -value "no"  
Set-ItemProperty -Type String -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Name "FormSuggest PW ask" -value "no"  
########################################################################################
# Senden von Informationen zum Schreibverhalten deaktivieren
########################################################################################
Write-Host -Foreground Yellow "Senden von Informationen zum Schreibverhalten wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\SOFTWARE\Microsoft\Input\TIPC" -Name "Enabled" -value "0"  
########################################################################################
# Feedbackhäufigkeit auf „Nie“ konfigurieren / Benachrichtigung nicht mehr anzeigen
########################################################################################
Write-Host -Foreground Yellow "Feedbackhäufigkeit wird auf Nie konfiguriert / Benachrichtigung werden nicht mehr anzeigt."  
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf"  
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules"  
Set-ItemProperty -Type DWord -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -value "0"  
Set-ItemProperty -Type DWord -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "PeriodInNanoSeconds" -value "0"  
########################################################################################
# Cortana Suchfeld ausblenden stattdessen Suchsymbol anzeigen
########################################################################################
Write-Host -Foreground Yellow "Cortana Suchfeld ausblenden stattdessen Suchsymbol anzeigen wird konfiguriert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -value "1"  
########################################################################################
# Explorer Ansichts Optionen werden nach FFM Standard gesetzt!
########################################################################################
# Explorer Ordner Optionen -> Allgemein
########################################################################################
Write-Host -Foreground Yellow "Explorer Ordner Optionen -> Allgemein werden gesetzt"  
# Dateiexplorer oeffnen fuer: Dieser PC
Write-Host -Foreground Yellow "Dateiexplorer oeffnen fuer: Dieser PC wird konfiguriert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -value "1"  
# Datenschutz: Zuletzt verwendete Dateien im Schnellzugriff anzeigen deaktivieren
Write-Host -Foreground Yellow "Zuletzt verwendete Dateien im Schnellzugriff anzeigen wird deaktiviert"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowFrequent" -value "0"  
# Datenschutz: Haeufig verwendete Ordner im Schnellzugriff anzeigen deaktivieren
Write-Host -Foreground Yellow "Haeufig verwendete Ordner im Schnellzugriff anzeigen wird deaktiviert"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowRecent" -value "0"  
########################################################################################
# Explorer Ordner Optionen -> Ansicht
########################################################################################
Write-Host -Foreground Yellow "Explorer Ordner Optionen -> Ansicht werden gesetzt"  
Write-Host -Foreground Yellow "Benachrichtigungen des Synchronisationsanbieters anzeigen wird deaktiviert"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowSyncProviderNotifications" -value "0"  
Write-Host -Foreground Yellow "Dateigroesseninformationen in Ordnertipps anzeigen wird deaktiviert"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "FolderContentsInfoTip" -value "0"  
Write-Host -Foreground Yellow "Dateisymbol auf Miniaturansichten wird aktiviert"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTypeOverlay" -value "1"  
Write-Host -Foreground Yellow "Erweiterungen bei bekannten Dateitypen ausblenden wird aktiviert"  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -value "1"  
Write-Host -Foreground Yellow "Freigabeassistent verwenden wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "SharingWizardOn" -value "0"  
Write-Host -Foreground Yellow "Geschuetzte Systemdateien ausblenden wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowSuperHidden" -value "0"  
Write-Host -Foreground Yellow "Immer Menues anzeigen wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "AlwaysShowMenus" -value "1"  
Write-Host -Foreground Yellow "Immer Symbole statt Miniaturansichten anzeigen wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "IconsOnly" -value "0"  
Write-Host -Foreground Yellow "Konflikte bei der Ordnerzusammenfuerung ausblenden wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideMergeConflicts" -value "1"  

Write-Host -Foreground Yellow "Kontrollkaestchen zur Auswahl von Elementen verwenden wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "useCheckBoxes" -value "1"  

Write-Host -Foreground Yellow "Laufwerksbuchstaben anzeigen wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "ShowDriveLettersFirst" -value "0"  
Write-Host -Foreground Yellow "Leere Laufwerke ausblenden wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideDrivesWithNoMedia" -value "1"  
Write-Host -Foreground Yellow "Ordnerfenster in einem eigenen Prozess starten wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "SeparateProcess" -value "0"  
Write-Host -Foreground Yellow "Popupinformationen fuer Elemente in Ordner und auf dem Desktop wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowInfoTip" -value "1"  
Write-Host -Foreground Yellow "Statusleiste anzeigen wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowStatusBar" -value "1"  
Write-Host -Foreground Yellow "Verschluesselte oder komprimierte NTFS-Dateien in anderer Farbe anzeigen wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowEncryptCompressedColor" -value "1"  

Write-Host -Foreground Yellow "Ausgeblendete Dateien, Ordner oder Laufwerke anzeigen wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -value "0"  

Write-Host -Foreground Yellow "Vollstaendiger Pfad in der Titelleiste anzeigen wird aktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" -Name "FullPath" -value "1"  
Write-Host -Foreground Yellow "Vorherige Ordnerfenster bei der Anmeldung wiederherstellen wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "PersistBrowsers" -value "0"  
Write-Host -Foreground Yellow "Vorschauhandler im Vorschaufenster anzeigen wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowPreviewHandlers" -value "1"  
Write-Host -Foreground Yellow "Naviagtionsbereich: Alle Ordner anzeigen wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "NavPaneShowAllFolders" -value "0"  

Write-Host -Foreground Yellow "Naviagtionsbereich: Bibliotheken anzeigen wird deaktiviert."  
Set-ItemProperty -Type ExpandString -Path "HKCR\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder" -Name "Attributes" -value "b090010d"  

Write-Host -Foreground Yellow "Naviagtionsbereich: Erweitern, um Ordner zu oeffnen wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "NavPaneExpandToCurrentFolder" -value "0"  
Write-Host -Foreground Yellow "Naviagtionsbereich: Verfuegbarkeitsstatus immer anzeigen wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "NavPaneShowAllCloudStates" -value "0"  
########################################################################################
# Alle Fehler in der Logdatei gelistet
########################################################################################
Write-Host -Foreground Yellow ""  
Write-Host -Foreground Red "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  
Write-Host -Foreground Red ""                                                                                    
Write-Host -Foreground Red ' Es sind '$error.Count' Fehler aufgetreten!'  
Write-Host -Foreground Red " Diese werden in die Logdatei $Log geschrieben!"  
Write-Host -Foreground Red ""                                                                                     
Write-Host -Foreground Red "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  
if ($error.Count -gt 0) { 
	$error | fl >> $Log
}
$error.Clear();
#######################################################################################
# Achtung:
#######################################################################################
Write-Host -Foreground Red "Die Benutzer Einstellungen u.a. die Exploerer Optionen sind nach FFM Vorgaben konfiguriert!"  
#######################################################################################
Write-Host -Foreground Red ""  
Write-Host -Foreground Yellow "ToDo:"  
Write-Host -Foreground Red "1. Fuehre für jeden weiteren Benutzer Win10BenutzerEinstellungen.ps1 aus!"  
#######################################################################################
# Zum Schluss wird das Ausfuehren von Powershell Scripts wieder auf ExecutionPolicy = Restricted gesetzt!
#######################################################################################
Write-Host -Foreground Red ""  
Write-Host -Foreground Yellow "Zum Schluss wird das Ausfuehren von Powershell Scripts wieder auf ExecutionPolicy Restricted gesetzt!"  
Set-ExecutionPolicy Restricted

Besten Dank fürs lesen

Potshock
Member: colinardo
Solution colinardo Jun 26, 2019 updated at 13:59:36 (UTC)
Goto Top
Servus,
da hat wohl wieder mal die Hitze zugeschlagen, alles offensichtlich Flüchtigkeitsfehler
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "useCheckBoxes" -value "1"
Falschen Namen verwendet muss heißen "AutoCheckSelect", im Skript steht es anders als in deinem ersten Post.
Set-ItemProperty -Type DWord -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -value "0"
Statt 1 wurde 0 im Skript gesetzt, im initialen Post ebenfalls anders als im Skript.
Set-ItemProperty : Es wurde kein Parameter gefunden, der dem Parameternamen "Type" entspricht.
HKCR ist per Default nicht als PSDrive gemappt deswegen kann das CMDLet nicht wissen das es den Type Parameter verwenden darf, weil es den Typ des Pfades (Registry/Dateisystem) nicht ermitteln kann. Einbinden als Laufwerk HKCR:\ lässt sich der Schlüssel so
New-PSDrive -PSProvider Registry -Name HKCR -Root HKEY_CLASSES_ROOT

Grüße Uwe
Member: potshock
potshock Jun 27, 2019 updated at 14:31:40 (UTC)
Goto Top
Hi Uwe,

erst einmal Danke und ja, Du hast Recht, diese Hitze face-wink!
Läuft soweit auch alles wie gewünscht, außer der Eintrag in HKCR.
Hier benötige ich noch einmal Deine/Eure Hilfe face-smile!

Dort fehlen mir die Berechtigungen. Auch manuell kann ich diesen Eintrag erst manipulieren, wenn ich den eingebauten Administratoren, die nötigen Berechtigungen zuteile.
Per Script kriege ich das nicht hin.

Mein Ansatz:
# HKCR ist per Default nicht als PSDrive gemappt, deshalb erst mappen
New-PSDrive -PSProvider Registry -Name HKCR -Root HKEY_CLASSES_ROOT
# Auf diesen Registry Pfad hat der Administrator keine Berechtigungen, deshalb lesen wir die Berechtigungen aus
$ACL_ORG=Get-Acl -path "Registry::\HKEY_CLASSES_ROOT\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder"  
# Wir lesen die ACL eines Registry Pfades mit den benötigten Rechten ein 
$ACL=Get-Acl -path "Registry::\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"  
# Wir setzen diese ACL temporaer auf den gewuenschten Pfad
Set-Acl -path "Registry::\HKEY_CLASSES_ROOT\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder" -AclObject $ACL  
# Registry Eintrag wird gesetzt
Write-Host -Foreground Yellow "Navigationsbereich: Bibliotheken anzeigen wird deaktiviert."  
Set-ItemProperty -Type DWord -Path "HKCR\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder" -Name "Attributes" -value "b090010d"  
# zum Schluss wird die Ursprungs ACL wieder zurückkopiert.
# Set-Acl nach Muster oben
# Gemapptes PS-Drive wieder unmounten
Remove-PSDrive -Name HKCR

danke für Deine Unterstützung

Potshock
Member: colinardo
Solution colinardo Jun 27, 2019 updated at 16:34:49 (UTC)
Goto Top
Nöp, ganz so einfach ist das dann doch nicht face-wink. Du musst das Privilege-Token anpassen, dann im Key erst die OwnerShip übernehmen, denn der TrusedInstaller ist der Besitzer des Keys, dann Vollzugriff für Administratoren setzen, dann Wert ändern und zwar als Integer und nicht als String, anschließend noch aufräumen und hinzugefügte Berechtigungen und Ownership des Keys wieder auf den Ursprungszustand zurücksetzen.
# mount HKCR
New-PSDrive -PSProvider Registry -Name HKCR -Root HKEY_CLASSES_ROOT -EA SilentlyContinue | out-null

# key to work on
$key = 'HKCR:\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder'  

# get only subkey value
$subkey = split-path $key -NoQualifier

# administrators sid
$sid = [System.Security.Principal.SecurityIdentifier]'S-1-5-32-544'  

# Adjust Privilege Token
$nttools = Add-Type -Member '[DllImport("ntdll.dll")] public static extern int RtlAdjustPrivilege(ulong a, bool b, bool c, ref bool d);' -Name nttools -PassThru  
9,17,18 | %{$nttools::RtlAdjustPrivilege($_, 1, 0, [ref]0) | out-null}

# set ownership
$regKey = [Microsoft.Win32.Registry]::ClassesRoot.OpenSubKey($subkey, 'ReadWriteSubTree', 'TakeOwnership')  
$acl = New-Object System.Security.AccessControl.RegistrySecurity
$acl.SetOwner($sid)
$regKey.SetAccessControl($acl)

### change permissions
$regKey = [Microsoft.Win32.Registry]::ClassesRoot.OpenSubKey($subkey, 'ReadWriteSubTree', 'ChangePermissions')  
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($sid, 'FullControl','Allow')  
$acl.SetAccessRule($rule)
$regKey.SetAccessControl($acl)
$regKey.Close()

# change registry value
Set-ItemProperty -Type DWord -Path $key -Name "Attributes" -value  0xb090010d  

# Remove permissions and reset ownership to TrustedInstaller
$acl = Get-ACL -Path $key
$acl.RemoveAccessRule(($acl.GetAccessRules($true,$false,[System.Security.Principal.SecurityIdentifier]) | ?{$_.IdentityReference -eq 'S-1-5-32-544'})) | out-null  
$acl.SetOwner([System.Security.Principal.SecurityIdentifier]'S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464')  
Set-ACL $key $acl

# unmount psdrive
Remove-PSDrive -Name HKCR -Force
Member: potshock
potshock Jun 28, 2019 at 07:36:17 (UTC)
Goto Top
Guten Morgen Uwe,

Besten Dank für deine Unterstützung!

Jetzt klappt Alles face-wink!
Das Bibliotheken Problem habe ich allerdings jetzt doch über den zuerst probierten Ansatz gelöst face-smile.

Set-ItemProperty -Type DWord -Path "HKCR:\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}" -Name "System.IsPinnedToNameSpaceTree" -value "1"  

Ich hatte den Ansatz zur Rechte Übernahme der Registry auch selbst ergoogelt, aber mehr oder weniger nur Bahnhof verstanden.

Besten Dank, daß Du für mich eine druckreife Lösung ausgearbeitet hast !
Funktioniert super und ist in meinem Script Archiv gespeichert face-smile.

Dir und allen Admins ein schönes und entspanntes Wochenende

Potshock