derwowusste
Goto Top

GPOs zeitgesteuert aktivieren

Kurzer Tipp zur Lösung folgender Herausforderung:

Will man eine GPO zeitgesteuert an- und abschalten bzw. zeitgesteuert ändern (zum Beispiel unterschiedliche Energiesparpläne oder unterschiedliche Einstellungen für Morgen-/Abendschicht), dann gibt es mehrere Ansätze:

1 WMI-Filter nach Zeit (Win32_UTCTime) - nicht empfohlen, da die Auswertung von WMI-Filtern Zeit saugt, wenn man sich anmeldet/den Rechner startet
2 Item-level-targeting ("ILT") in group policy preference items ("GPP"), der Filter heißt hier "time range" - bedingt empfohlen, da auch hier Zeit draufgeht und natürlich nur einsetzbar für GPPs, nicht generell für alle GPOs. Siehe auch https://web.archive.org/web/20100611161858/http://blogs.technet.com/b/gr ...
3 automatisiertes Aktivieren/Deaktivieren bzw. genauer: verlinken und entlinken von GPOs

Auf Punkt 3 will ich schnell genauer eingehen. Beispiel:
Ich schreibe eine GPO, die soll von 8-18 Uhr gelten. Danach, zwischen 18 Uhr und 8 Uhr, sollen andere EInstellungen gelten, die ich in einer zweiten GPO festlege. Das weitere Vorgehen ist nun, die zweite GPO zunächst zu entlinken und per Powershell zur rechten Zeit die GPOs zu ver- und entlinken.
Das Powershell Kommando ist beispielsweise:
Set-GPLink -guid 814977B4-1CD8-4E0D-837C-B88E5416772A -target "ou=Clients, dc=contoso, dc=de" -linkenabled no  
Set-GPLink -guid 4BAA51F1-E869-424F-9B48-2BF832E92B70 -target "ou=Clients, dc=contoso, dc=de" -linkenabled yes  
Dieses führt man einfach per Taskplaner auf den DCs aus, möglichst mit dem Systemkonto. Dazu müssen diese Powershell 3.0 oder höher installiert haben. Haben sie das nicht, muss man das Kommando von remote absetzen von einem Rechner win7 oder höher, der RSAT installiert hat. Man beachte, dass das Konto, welches den Task ausführt, entsprechende Rechte auf die OU bekommen muss: "Write gPLink", und natürlich auch firewalltechnisch Zugang besteht.

Letzter Schritt: damit es sofort zieht, empfehle ich, einen Task "GPUpdate" an die Clients zu verteilen, der gpupdate /force ausführt zu den entsprechenden Zeiten - sei es mit dem Konto "System", oder, für die Userpolicy, mit dem Konto des angemeldeten Users.

Content-Key: 287606

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

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

Member: emeriks
emeriks Nov 07, 2015 at 19:00:42 (UTC)
Goto Top
Hallo DWW,
grundsätzlich erstmal: Super, guter Ansatz!
Ein paar Fragen dazu:
  1. Die Leerzeichen nach den Kommas im Distingusihed Name sind doch sicher falsch, oder?
  2. Wie groß genau ist die Verzögerung, wenn man die Zeit WMI-Filter oder ITL eingrenzt? Ist das echt so dramatisch?
  3. Man sollte erwähnen, dass die bloße Deaktivierung einer Verknüpfung u.U. nicht ausreicht, auch nicht wenn man GPupdate ausführt. U.U. muss man eine explizite Gegenrichtlinie aktivieren. Du machst das zwar so in Deinem Beispiel, dass andere Einstellungen gelten sollen, aber ein expliziter Hinweis wäre sicher für einige nicht ganz so versierte hilfreich.

E.
Member: DerWoWusste
DerWoWusste Nov 08, 2015, updated at Nov 09, 2015 at 11:56:30 (UTC)
Goto Top
Moin.

1 Nee, ist so korrekt [edit: es geht beides, mit und ohne Lücken]
2 Habe dazu folgenden Link für Dich http://evilgpo.blogspot.de/2014/11/showdown-wmi-filter-vs-item-level.ht ...
3 Nur dann, wenn es tattooing GPOs wären, was für die wenigsten zutrifft, siehe https://sdmsoftware.com/gpoguy/whitepapers/understanding-policy-tattooin ...
Member: DerWoWusste
DerWoWusste Nov 09, 2015, updated at Nov 12, 2015 at 16:11:37 (UTC)
Goto Top
Hi.

Nochmal wegen 3: habe mir gerade mal den Spaß gegeben, das rauszusuchen, was tattoed:
MACHINE\Software\Microsoft\Driver Signing\Policy
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole\SecurityLevel
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole\SetCommand
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AllocateCDRoms
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AllocateDASD
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\AllocateFloppies
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\CachedLogonsCount 
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ForceUnlockLogon
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\PasswordExpiryWarning
MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ScRemoveOption
MACHINE\System\CurrentControlSet\Control\Lsa\AuditBaseObjects
MACHINE\System\CurrentControlSet\Control\Lsa\CrashOnAuditFail
MACHINE\System\CurrentControlSet\Control\Lsa\DisableDomainCreds
MACHINE\System\CurrentControlSet\Control\Lsa\EveryoneIncludesAnonymous
MACHINE\System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy
MACHINE\System\CurrentControlSet\Control\Lsa\ForceGuest
MACHINE\System\CurrentControlSet\Control\Lsa\FullPrivilegeAuditing
MACHINE\System\CurrentControlSet\Control\Lsa\LimitBlankPasswordUse
MACHINE\System\CurrentControlSet\Control\Lsa\LmCompatibilityLevel
MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\allownullsessionfallback
MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\AuditReceivingNTLMTraffic
MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\ClientAllowedNTLMServers
MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\NTLMMinClientSec
MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\NTLMMinServerSec
MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\RestrictReceivingNTLMTraffic
MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0\RestrictSendingNTLMTraffic
MACHINE\System\CurrentControlSet\Control\Lsa\NoDefaultAdminOwner
MACHINE\System\CurrentControlSet\Control\Lsa\NoLMHash
MACHINE\System\CurrentControlSet\Control\Lsa\pku2u\AllowOnlineID
MACHINE\System\CurrentControlSet\Control\Lsa\RestrictAnonymous
MACHINE\System\CurrentControlSet\Control\Lsa\RestrictAnonymousSAM
MACHINE\System\CurrentControlSet\Control\Lsa\SCENoApplyLegacyAuditPolicy
MACHINE\System\CurrentControlSet\Control\Lsa\SubmitControl
MACHINE\System\CurrentControlSet\Control\Lsa\UseMachineId
MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers\AddPrinterDrivers
MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths\Machine
MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths\Machine
MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel\ObCaseInsensitive
MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management\ClearPageFileAtShutdown
MACHINE\System\CurrentControlSet\Control\Session Manager\ProtectionMode
MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems\optional
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\AutoDisconnect
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\EnableForcedLogOff
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\EnableSecuritySignature
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\NullSessionPipes
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\NullSessionShares
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\NullSessionShares 
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\RequireSecuritySignature
MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters\SmbServerNameHardeningLevel
MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters\EnablePlainTextPassword
MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters\EnableSecuritySignature
MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters\RequireSecuritySignature
MACHINE\System\CurrentControlSet\Services\LDAP\LDAPClientIntegrity
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\AuditNTLMInDomain
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\DCAllowedNTLMServers
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\DisablePasswordChange
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\MaximumPasswordAge
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\RefusePasswordChange
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\RequireSignOrSeal
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\RequireStrongKey
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\RestrictNTLMInDomain
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\SealSecureChannel
MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters\SignSecureChannel
MACHINE\System\CurrentControlSet\Services\NTDS\Parameters\LDAPServerIntegrity
HKCU\Software\Microsoft\Outlook Express!BlockExeAttachments
HKLM\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters!EnableMaxTokenSize
HKLM\System\CurrentControlSet\Services\Tcpip\Parameters!EnableWsd
HKLM\System\CurrentControlSet\Services\Tcpip\Parameters!EnableIPAutoConfigurationLimits
Das sind nun 68 Policies, von gut 3900, die unter Win10 derzeit Anwendung finden könnten.