Schreibgeschützte Profile und andere Merkwürdigkeiten

Hi, hier schreibt Marius. Stellt Euch folgendes Szenario vor: Neue Benutzer erhalten ständig ein schreibgeschütztes Profil. Nach einiger Zeit, erhalten die Benutzer, die schon ein Roaming Profil hatten, nur noch Profile, die nicht mehr aktuell sind. Was ist hier eigentlich los?

Ein mögliches Szenario und eine mögliche Erklärung sind in diesem Blogeintrag beschrieben. Das Szenario setzt die Verwendung der folgenden zwei Gruppenrichtlinieneinstellungen voraus:

Computer Configuration (Enabled)\Administrative Templates\System/User Profiles\Policy Setting
--> Delete cached copies of roaming profiles [Enabled ]
--> Prevent Roaming Profile changes from propagating to the server [Enabled]

Wenn diese zwei Einstellungen konfiguriert sind, wird ein Benutzer, der ein neues Benutzerkonto im Active Directory hat und auch kein servergespeichertes Profil hat, die folgende Fehlermeldung bekommen, wenn er eine Anmeldung am Client Computer versucht:

Windows cannot locate your roaming profile (read only) and is attempting to log you on with your local profile. Possible causes of this error include network problems or insufficient security rights. If this problem persists, contact your network administrator.

DETAIL - The system cannot find the file specified.

Die Fehlermeldung weist auf ein schreibgeschütztes Profil, also ein sogenanntes Mandatory Profile, hin. Die erste Reaktion eines Administrators wird sicherlich sein, die Active Directory Users and Computers Konsole zu öffnen und zu überprüfen, ob die Einstellungen des Profils richtig sind und ob eine NTUser.man Datei im servergespeichertes Profil zu finden ist. Aber die Einstellungen sind richtig und es gibt keine NTUser.man Datei. Was sollte der Administrator als nächstes versuchen?

Wie immer bei der Recherche von Profilproblemen, für Systeme die auf Windows XP / Windows Server 2003 laufen, können wir die UserEnv Protokollierung aktivieren, wie im KB 221833 beschrieben:

How to enable user environment debug logging in retail builds of Windows https://support.microsoft.com/kb/221833

Nach der Aktivierung der Einstellung können wir in der UserEnv Datei die folgenden Einträge sehen, die sehr detailliert beschreiben, welche Aktionen im Hintergrund vom Betriebssystem durchgeführt werden:

USERENV(238.23c) 15:00:14:658 LoadUserProfile: lpProfileInfo->lpUserName = <user>

USERENV(238.23c) 15:00:14:668 LoadUserProfile: lpProfileInfo->lpProfilePath = \\server.domain.local\share\user
USERENV(238.23c) 15:00:14:668 LoadUserProfile: lpProfileInfo->lpDefaultPath = \\SERVER\netlogon\Default User USERENV(238.23c) 15:00:14:668 LoadUserProfile: NULL server name
[
…]

USERENV(238.23c) 15:00:14:698 LoadUserProfile: Expanded profile path is \\server.domain.local\share\user
USERENV(238.23c) 15:00:14:698 ParseProfilePath: Entering, lpProfilePath = \\server.domain.local\share\user […]
USERENV(238.23c) 15:00:14:748 AbleToBypassCSC: Share \\server.domain.local\share mapped to drive E. Returned Path E:\user
USERENV(238.23c) 15:00:14:748 ParseProfilePath: CSC bypassed. Profile path E:\user
USERENV(238.23c) 15:00:14:748 ParseProfilePath: GetFileAttributes failed with error 2
USERENV(238.23c) 15:00:14:758 ParseProfilePath: Couldn't access mandatory profile <E:\user> with error 2
USERENV(238.23c) 15:00:14:758 ReportError: Impersonating user.
USERENV(238.23c) 15:00:14:758 ReportError: Logging Error <Windows cannot locate your roaming profile (read only) and is attempting to log you on with your local profile. Possible causes of this error include network problems or insufficient security rights. If this problem persists, contact your network administrator.
DETAIL - The system cannot find the file specified.
>

[
…]
USERENV(238.23c) 15:00:22:098 ExtractProfileFromBackup: Failed to open key Software\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-734310928-2012815582-1864686629-1111 with error 2
USERENV(238.23c) 15:00:22:098 ExtractProfileFromBackup: Couldn't open backup profile key. Error = 2

Als nächstes können wir die folgenden Einträge sehen:

USERENV(238.23c) 20:28:27:247 CreateLocalProfileImage: One way or another we haven't got an existing local profile, try and create one
USERENV(238.23c) 20:28:27:247 GetUserDomainName: DomainName = <DOMAIN>
USERENV(238.23c) 20:28:27:247 CreateSecureDirectory: Entering with <C:\Documents and Settings\user.DOMAIN>
USERENV(238.23c) 20:28:27:277 CreateSecureDirectory: Created the directory <C:\Documents and Settings\user.DOMAIN>
USERENV(238.23c) 20:28:27:277 ComputeLocalProfileName: generated the profile directory <C:\Documents and Settings\user.DOMAIN>

USERENV(238.23c) 20:28:27:277 Creating Local Profile
USERENV(238.23c) 20:28:27:277 Local profile name is <C:\Documents and Settings\user.DOMAIN>
USERENV(238.23c) 20:28:27:277 RestoreUserProfile: Working with a new user. Go straight to issuing a default profile.
USERENV(238.23c) 20:28:27:277 RestoreUserProfile: Issuing default profile

USERENV(238.23c) 20:28:27:277 CheckNetDefaultProfile: Entering, lpNetPath = \\SERVER\netlogon\Default User […]
USERENV(238.23c) 20:28:27:297 CheckNetDefaultProfile: setting default profile to NULL
USERENV(238.23c) 20:28:27:297 CheckNetDefaultProfile: Removing local copy of network default user profile.

USERENV(238.23c) 20:28:27:297 Delnode_Recurse: Entering, lpDir = \\?\C:\Documents and Settings\Default User (Network) USERENV(238.23c) 20:28:27:297 CheckNetDefaultProfile: Leaving with a value of 0.
USERENV(238.23c) 20:28:27:297 IssueDefaultProfile: Entering. lpDefaultProfile = <C:\Documents and Settings\Default User> lpLocalProfile = <C:\Documents and Settings\user.DOMAIN>
USERENV(238.23c) 20:28:27:297 CopyProfileDirectoryEx: Entering, lpSourceDir = <C:\Documents and Settings\Default User>, lpDestinationDir = <C:\Documents and Settings\user.DOMAIN>, dwFlags = 0xc8103
[
...]
USERENV(238.23c) 20:28:30:714 Profile was successfully loaded.
USERENV(238.23c) 20:28:30:714 lpProfile->lpRoamingProfile = <>
USERENV(238.23c) 20:28:30:714 lpProfile->lpLocalProfile = <C:\Documents and Settings\user.DOMAIN>

Für neue Benutzer, die kein servergespeichertes Profil haben, führt die Aktivierung beider oben genannter GPO Einstellungen zu einer Schleife, wobei das Benutzerprofil bei der Anmeldung vom lokalen Standard-Profil erstellt wird. Bei der Abmeldung wird das Profil wegen der ersten Einstellung gelöscht, aber gleichzeitig kann das Profil wegen der zweiten Einstellung auf dem zentralen Server nicht gespeichert werden. Das ist die Ursache warum die Fehlermeldung und die UserEnv Datei das Profil als schreibgeschützt bezeichnen. Die Fehlermeldung kann aber sehr überraschend für den Administrator sein, weil er weiß, dass er kein schreibgeschütztes Profil definiert hat.

Die Lage wird verwirrender, wenn Benutzer, die schon ein servergespeichertes Profil haben: für diese Benutzer wird bei der Abmeldung das Profil nicht mehr aktualisiert. Wahrscheinlich bemerken die Benutzer diese Situation nicht sofort, sondern erst nach einiger Zeit, wenn Sie bestimmte Dateien auf einem anderen Rechner plötzlich nicht vorfinden.

Zusammengefasst:

Wenn die Verwendung der zwei Einstellungen nicht ausreichend geplant wurde, wird der Administrator gleichzeitig die folgenden zwei Situationen erleben:

  • Neue Benutzer, die ein Standard-Profil bekommen werdendie durchgeführten Änderungen bei der Abmeldung verloren gehen. Die Fehlermeldung (dass ein schreibgeschütztes Profil verwendet wurde) ist in dieser Situation nicht erwartet und irreführend. Dieses Szenario kann zum Datenverlust führen
  • Existierende Benutzer werden immer eine servergespeicherte Kopie des Profils bekommen – das Profil wird sich genau in der Version bleiben, wie es zum Zeitpunkt der Aktivierung der Einstellung war. Dieses Szenario kann auch zu Datenverlust führen

Die obenstehenden Informationen unterstreichen erneut die Bedeutung von Planung und Tests von Gruppenrichtlinienänderungen, bevor diese Änderungen in einer produktiven Umgebung implementiert werden.

Die folgende TechNet Adresse ist eine zentrale Informationsstelle für Administratoren, die ein Interesse an detaillierten Informationen über Gruppenrichtlinien haben:

Group Policy https://technet.microsoft.com/en-us/windowsserver/bb310732.aspx

Viele Grüße
Marius