ich überarbeite momentan unsere Windows 7 (früher 32, jetzt für heute auf 64bit) Anpassungen. Früher sind diverse Registry Manipulationen, File Copyjobs, Dienste etc pp über eine Batch Datei beim ersten Anmelden nach der Windows Installation gemacht worden. Um das Ganze etwas übersichtlicher zu gestalten habe ich dafür ein eigenes OPSI-Produkt angelegt und versuche so viel wie möglich direkt über das WINST Script zu machen.
Klappt soweit auch hervorragend, nur an einer Stelle komme ich nicht weiter:
Um im Windows 7 die Favoriten & Bibliotheken aus zublenden und um den Namen vom Arbeitsplatz zu verändern muss erst die Berechtigung auf diese RegKeys gesetzt werden. In der Batch wurde problemlos per setacl.exe die Berechtigung auf die Gruppe der lokalen Administratoren gesetzt und dann im nächsten Schritt die entsprechenden Regkeys angepasst.
Im Winst Script habe ich erst versuchst über eine DosBatch Sektion per setacl.exe die Berechtigungen zu setzen (auf SYSTEM, Jeder, habe verschiedenstes probiert) und dann in der Registry Sektion die entsprechenden Keys anzupassen.
Setacl wird soweit erfolgreich ausgeführt (wobei er mit der Gruppe SYSTEM ein Problem hat, bei JEDER macht er es) aber bei den RegKeys dann trotzdem die Fehlermeldung "Zugriff verweigert" kommt.
Hat jemand damit Erfahrung oder weiß wie ich das Problem anderweitig lösen kann?
Natürlich kann ich es schlechtesten Falls weiterhin über die Batch lösen, ist mir aber unlieb weil ich sonst alles in das Winst Script übernehmen konnte.
Infos:
dpkg -l | grep opsi
opsi-atftpd 0.7.dfsg-2.1 advanced TFTP server - opsi version with pcre, fifo and max-blksize patches
opsi-configed 4.0.2.5.8-1 OPSI config editor
opsi-depotserver 4.0.2.3-1 opsi depotserver configuration package
opsi-linux-bootimage 20120728-1 opsi linux bootimage
opsi-utils 4.0.2.3-1 opsi utils
opsiconfd 4.0.2.4-1 opsi configuration service
opsipxeconfd 4.0.2.6-1 opsi pxe configuration daemon
python-opsi 4.0.2.4-1 opsi python library
Winst 4.11.3.3-1
Alte Lösung aus der Batchfile, ausgeführt beim ersten Logon (lokaler Admin)
Code: Alles auswählen
rem Favoriten im Windows Explorer ausblenden, Benutzername und Computername unter Computer anzeigen
echo Setze Registry Keys ...
echo.
setacl -on "HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" -ot reg -actn setowner -ownr "n:administratoren"
setacl -on "HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" -ot reg -actn ace -ace "n:administratoren;p:full"
reg add "HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" /v Attributes /t REG_DWORD /d 2839544064 /f
setacl -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn setowner -ownr "n:administratoren"
setacl -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn ace -ace "n:administratoren;p:full"
reg add "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /v LocalizedSTRING /t REG_EXPAND_SZ /d "%%USERNAME%% auf %%COMPUTERNAME%%" /f
echo.
Code: Alles auswählen
...
[DosBatch_general]
; Setze Rechte auf RegKeys für Favoriten & Arbeitsplatz Benennung
"%scriptpath%\windows7\system32\SetACL.exe" -on "HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" -ot reg -actn setowner -ownr "n:administratoren" >> c:\tmp\firstrun.log 2>&1
"%scriptpath%\windows7\system32\SetACL.exe" -on "HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" -ot reg -actn ace -ace "n:administratoren;p:full" >> c:\tmp\firstrun.log 2>&1
"%scriptpath%\windows7\system32\SetACL.exe" -on "HKEY_Local_Machine\Software\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" -ot reg -actn setowner -ownr "n:administratoren" >> c:\tmp\firstrun.log 2>&1
"%scriptpath%\windows7\system32\SetACL.exe" -on "HKEY_Local_Machine\Software\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" -ot reg -actn ace -ace "n:administratoren;p:full" >> c:\tmp\firstrun.log 2>&1
"%scriptpath%\windows7\system32\SetACL.exe" -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn setowner -ownr "n:administratoren" >> c:\tmp\firstrun.log 2>&1
"%scriptpath%\windows7\system32\SetACL.exe" -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn ace -ace "n:administratoren;p:full" >> c:\tmp\firstrun.log 2>&1
[Registry_Patch]
; "Favoriten & Bibliotheken im Explorer ausblenden"
openkey [HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]
set "Attributes" = "a9400100"
openkey [HKEY_Local_Machine\Software\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder]
set "Attributes" = "a9400100"
; "Computername am Arbeitsplatz anzeigen"
openkey [HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}]
set "LocalizedSTRING" = REG_EXPAND_SZ:"%%USERNAME%% auf %%COMPUTERNAME%%"
Code: Alles auswählen
INFO: Processing ACL of: <classes_root\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder>
SetACL finished successfully.
INFO: Processing ACL of: <classes_root\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder>
SetACL finished successfully.
INFO: Processing ACL of: <machine\Software\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder>
SetACL finished successfully.
INFO: Processing ACL of: <machine\Software\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder>
SetACL finished successfully.
INFO: Processing ACL of: <classes_root\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}>
SetACL finished successfully.
INFO: Processing ACL of: <classes_root\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}>
SetACL finished successfully.
Code: Alles auswählen
...
[5] [Apr 08 10:08:46:349] Execution of DosBatch_general
[6] [Apr 08 10:08:46:349] c:\opsi.org\tmp\_winstbat_1.bat saved back
[6] [Apr 08 10:08:46:363] Executing "C:\Windows\\cmd64.exe" /C "c:\opsi.org\tmp\_winstbat_1.bat"
[6] [Apr 08 10:08:53:196] ExitCode 0
[6] [Apr 08 10:08:53:208] Delete "c:\opsi.org\tmp\_winstbat_*"
[6] [Apr 08 10:08:53:211] Search "c:\opsi.org\tmp\"
[6] [Apr 08 10:08:53:211] File "c:\opsi.org\tmp\_winstbat_1.bat"
[6] [Apr 08 10:08:53:212] The file has been deleted
...
[3] [Apr 08 10:08:53:588] Error: Registry key [HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder] could not be opened by RegCreateKeyEx, Errorno: 5 "Zugriff verweigert<"
[3] [Apr 08 10:08:53:588] Error: Variable "Attributes" could not be set
[6] [Apr 08 10:08:53:588] Registry key [HKEY_Local_Machine\Software\Wow6432Node\Classes\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder] opened
[6] [Apr 08 10:08:53:588] Variable "Attributes" is keeping its value "a9400100"
[6] [Apr 08 10:08:53:588] Key closed
[3] [Apr 08 10:08:53:588] Error: Registry key [HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}] could not be opened by RegCreateKeyEx, Errorno: 5 "Zugriff verweigert<"
[3] [Apr 08 10:08:53:588] Error: Variable "LocalizedSTRING" could not be set



Danke & viele Grüße!