• Unable to Load User Profile 登入時無法被正常載入

    有時候使用者登入computer後無法載入profile,登入時僅能以臨時profile登入,或是登入後無法顯示桌面

    並非每次皆會發生,重新開機幾次可以暫時解決

    EventLog

    事件類型: 警告
    事件來源: Userenv
    事件類別目錄: 無
    事件識別碼: 1517
    日期:  97/6/12
    時間:  下午 02:27:05
    使用者:  NT AUTHORITY\SYSTEM
    電腦: S105
    描述:
    在登出過程中,當應用程式或服務仍在使用登錄時,Windows 已儲存使用者 VGHOPD\opdclient 的登錄。使用者登錄所使用的記憶體尚未被釋出。當登錄不再處於使用中狀態時,將會被解除載入。

    這通常是因為服務以使用者帳戶執行而造成,請嘗試將服務設定成以 LocalService 或 NetworkService 帳戶執行。

    請在 http://go.microsoft.com/fwlink/events.asp 查看說明及支援中心,以取得其他資訊。

    事件類型: 警告
    事件來源: Userenv
    事件類別目錄: 無
    事件識別碼: 1524
    日期:  97/6/12
    時間:  下午 02:27:04
    使用者:  S-1-5-21-1240135555-3271779952-1062365482-1143
    電腦: S105
    描述:
    Windows 無法將您的類別登錄檔解除載入 - 有其他應用程式或服務還在使用它。當檔案不在使用中時將會被解除載入。

    UserEnv.log


    USERENV(2a8.2ac) 17:33:38:921 ExtractProfileFromBackup:  Failed to open key Software\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1240135555-3271779952-1062365482-1143 with error 2
    USERENV(2a8.2ac) 17:33:38:937 ExtractProfileFromBackup:  Profile created from Backup
    USERENV(2a8.2ac) 17:33:38:937 PatchNewProfileIfRequred: A profile already exists with the current sid, exitting
    USERENV(2a8.2ac) 17:33:38:937 CreateLocalProfileKey:  Not setting additional Security
    USERENV(2a8.2ac) 17:33:38:937 GetExistingLocalProfileImage:  Found entry in profile list for existing local profile
    USERENV(2a8.2ac) 17:33:38:937 GetExistingLocalProfileImage:  Local profile image filename = <%SystemDrive%\Documents and Settings\UserName>
    USERENV(2a8.2ac) 17:33:38:937 GetExistingLocalProfileImage:  Expanded local profile image filename = <C:\Documents and Settings\ UserName >
    USERENV(2a8.2ac) 17:33:38:937 GetExistingLocalProfileImage:  No local mandatory profile.  Error = 2
    USERENV(2a8.2ac) 17:33:38:937 GetExistingLocalProfileImage:  Found local profile image file ok <C:\Documents and Settings\ UserName \ntuser.dat>
    USERENV(2a8.2ac) 17:33:38:937 GetExistingLocalProfileImage:  Failed to query low profile unload time with error 2
    USERENV(2a8.2ac) 17:33:38:937 Local Existing Profile Image is reachable

    這個問題發生的原因有以下可能:

    This problem occurs because, when you log on to the computer, the WebDav client service caches a handle to the HKEY_CURRENT_USER\Software\Classes registry subkey during per-user initialization.
    The HKEY_CURRENT_USER\Software\Classes registry subkey is the Usrclass.dat file in your user profile. The HKEY_CURRENT_USER\Software\Classes registry subkey is used for per-user COM registrations. Therefore, the HKEY_CURRENT_USER\Software\Classes registry subkey cannot be unloaded when you log off from the computer because of the cached handle.

    解決方法

    更新XP SP3或是安裝kb842827

    並安裝User Profile Hive Cleanup Service

    User Profile Hive Cleanup Service

    http://www.microsoft.com/downloads/details.aspx?FamilyId=1B286E6D-8912-4E18-B570-42470E2F3582&displaylang=en

    參考資料

    842827 The system may not unload your user profile correctly when you log off from a Windows XP-based computer

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;842827

    944984 The user profile may not be correctly unloaded when you log off from a Windows Server 2003-based computer, and event 1517 is logged

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;944984

  • GPO Troubleshooting: 使用Userenv log來偵錯GPO套用問題

    在您的企業環境中,難免會遇到GPO套用的問題,通常來說,這種問題的分析方式是固定的,這篇文章主要透過一些相關的症狀和案例來討論一般GPO套用不到的時候,我們該怎麼辦?

    A.啟動UserENV的方式:

    Use Registry Editor to add or to modify the following registry entry:

    Subkey: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
    Entry: UserEnvDebugLevel
    Type: REG_DWORD
    Value data: 10002 (Hexadecimal)

    修改後重現問題,這個Log檔案的產生路徑如下:

    %ystemroot%\Debug\UserMode\Userenv.log

    221833 How to enable user environment debug logging in retail builds of Windows
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;221833

    B.問題分析流程:

    針對GPO套用問題

    1. 先判斷是套用使用者或是電腦

    2. 執行gpresult.exe /V確認上次套用時間和結果

    3. 搜尋UserENV.log 中的關鍵字"Starting User" 或 "Starting Computer" 確認使用者或是電腦原則開始套用的時間點。

    5. 確認無法套用GPO名稱或是GUID

    6. 標記process id 僅針對特定的process id來追蹤,例如:

    USERENV(23c.a58) 15:43:27:626 ApplyGroupPolicy: Entering. Flags = e

    USERENV(23c.a58) 15:43:27:626 ProcessGPOs:

    USERENV(23c.a58) 15:43:27:676 ProcessGPOs:

    USERENV(23c.a58) 15:43:27:676 ProcessGPOs: Starting user Group Policy (Async forground) processing...

    USERENV(23c.a58) 15:43:27:676 ProcessGPOs:

    USERENV(23c.a58) 15:43:27:676 ProcessGPOs:

    USERENV(23c.a58) 15:43:27:686 EnterCriticalPolicySectionEx: Entering with timeout 600000 and flags 0x0

    USERENV(23c.a58) 15:43:27:686 EnterCriticalPolicySectionEx: User critical section has been claimed. Handle = 0x808

    USERENV(23c.a58) 15:43:27:686 EnterCriticalPolicySectionEx: Leaving successfully.

    USERENV(23c.a58) 15:43:27:686 ProcessGPOs: Machine role is 2.

    USERENV(23c.a58) 15:43:28:106 PingComputer: Adapter speed 100000000 bps

    USERENV(23c.a58) 15:43:28:106 PingComputer: First time: 0

    其中標記紅色的部分,就是指套用GPO唯一的Process(這個數字每次開機都會不太一樣,但是同一次的套用過程是一樣的)。

    以下,我們針對案例來分析:

    案例一 Secedit.sdb 有問題,無法套用GPO

    Winlogon.log

    -------------------------------------------
    2008年4月24日 上午 10:15:39
    錯誤 1208: 發生延伸錯誤。
    建立 database 時發生錯誤。
    ----設定引擎初始化發生錯誤。----

    USERENV(424.1ec) 10:15:39:656 MachinePolicyCallback: Setting status UI to 正在套用電腦設定值...
    USERENV(424.1ec) 10:15:39:656 MachinePolicyCallback: Extension requested status UI when status UI is not available.
    USERENV(424.1ec) 10:15:39:666 ProcessGPOList: Extension Security returned 0x4b8.
    USERENV(424.1ec) 10:15:39:686 ProcessGPOList: Extension Security was able to log data. RsopStatus = 0x0, dwRet = 1208, Clearing the dirty bit
    USERENV(424.1ec) 10:15:39:696 ProcessGPOs: Extension Security ProcessGroupPolicy failed, status 0x4b8.
    USERENV(424.1ec) 10:15:39:706 ProcessGPOs: -----------------------

    Event log

    事件類型: 警告
    事件來源: SceCli
    事件類別目錄: 無
    事件識別碼: 1202
    日期:  97/4/24
    時間:  上午 10:15:39
    使用者:  N/A
    電腦: ATWA0760
    描述:
    安全性原則傳播中含有警告。 0x4b8 : 發生延伸錯誤。

    若要得到解決這個事件的最佳結果,請以非系統管理員帳戶登入,然後在 http://support.microsoft.com 搜尋 "Troubleshooting Event 1202's"。

    請在 http://go.microsoft.com/fwlink/events.asp 查看說明及支援中心,以取得其他資訊。

    上述的徵狀,表示Secedit.sdb 有問題,請重新根據下列方式重建secedit.sdb:

    1.請按一下 [ 開始 ] , 按一下 執行 , 型別 explorer然後按一下 [ 確定 ]

    2.找出並開啟 C:\windows 資料夾

    3.在 磁碟機 建立一個新資料夾 C:\windows\OldSecurity. 如果要執行這項操作,請依照下列步驟執行。:

    a.Double-click the Windows folder.

    b.On the File menu, point to New, and then click Folder.

    c.Type OldSecurity, and then press ENTER.

    4.將所有檔案, 具有 . log 副檔名從 C:\Windows\Security 資料夾 移動到 C:\Windows\OldSecurity 資料夾 如果要執行這項操作,請依照下列步驟執行。:

    a. 連按兩下資料夾,Security 並針對此��料夾下的資料夾及檔案進行檢視。

    b. 點選這些您找到的 .log 檔案.請在[ 編輯器 ] 功能表, 按一下 [ 剪下] 。

    c. 找出並按一下 [OldSecurity] 資料夾。

    d. 在 [ 編輯 ] 功能表, 按一下 [ 貼上 ] 。

    5.在 磁碟機C:\Security\Database 中找到 Secedit.sdb 檔案,然後重新命名 Secedit.sdb 為 Secedit.old  檔案 如果要執行這項操作,請依照下列步驟執行。:

    a.以滑鼠右鍵按一下 Secedit.sdb , 並按一下 [ 重新命名] 。

    b.型別 Secedit.old然後按 ENTER 鍵

    6.請按一下 [ 開始 ] , 按一下 執行 , 型別 mmc然後按一下 [ 確定 ]

    7.新增安全性設定及分析 ] 嵌入式管理單元。 如果要執行這項操作,請依照下列步驟執行。.

    a.按一下 [ 檔案 ] 再、 按一下 [ 新增 / 移除嵌入式管理單元] \ [ 安全性設定及分析 ] 按一下 可用的獨立嵌入式管理單元 清單, 中的及 新增 。

    b. 在 [ 新增獨立嵌入式管理單元 ] 對話方塊, 按一下 [ 關閉 ] 。

    c. 在 [ 新增 / 移除嵌入式管理單元 ] 對話方塊, 按一下 [ 確定 ] 。

    8.在 設定及分析安全性和 , 按一下滑鼠右鍵, 然後按一下 [ 開啟資料庫 。

    9.尋找 C\:Windows\Security\Database 資料夾 在[ 檔案名稱] 方塊, 輸入 Secedit.sdb然後按一下 [ 開啟 ]
    注意 如果您收到一則訊息, 說明該存取被拒, 您可以忽略這個訊息。

    10.以滑鼠右鍵按一下 安全性和設定及分析 , 按一下 [ 匯入範本] , 型別 C:\WINDOWS\security\templates\setup security.inf 然後按一下 [ 開啟 ]

    11.如果出現提示要重新啟動您的電腦, 重新啟動您的電腦。

    案例二 開機時無法套用軟體限制原則,但是開機後卻可以透過Gpupdate /force 正常套用

    UserEnv.log

    USERENV(518.6b0) 16:55:04:276 ProcessGPOs: Starting computer Group Policy (Background) processing...

    USERENV(518.6b0) 16:55:09:369 ProcessGPOs: network name is msft.com

    USERENV(518.6b0) 16:55:09:369 ProcessGPOs: User name is: CN=ATWA0880,OU=Disable-Skype,OU=Computer,OU=Corp,DC=msft,DC=com, Domain name is: MSFT

    ..

    USERENV(518.6b0) 16:55:09:432 ProcessGPOs: Domain controller is: \\DCS003. msft.com Domain DN is msft.com

    USERENV(518.6b0) 16:55:12:244 ProcessGPO: Searching <CN={0CA6A7D6-D0A9-4C36-905C-17474C7636F8},CN=Policies,CN=System,DC=msft,DC=com>

    USERENV(518.6b0) 16:55:12:244 ProcessGPO: Machine has access to this GPO.

    USERENV(518.6b0) 16:55:12:244 ProcessGPO: GPO passes the filter check.

    USERENV(518.6b0) 16:55:12:244 ProcessGPO: Found functionality version of: 2

    USERENV(518.6b0) 16:55:12:244 ProcessGPO: Found file system path of: <\\msft.com\SysVol\msft.com\Policies\{0CA6A7D6-D0A9-4C36-905C-17474C7636F8}>

    USERENV(518.6b0) 16:55:12:259 ProcessGPO: Found common name of: <{0CA6A7D6-D0A9-4C36-905C-17474C7636F8}>

    USERENV(518.6b0) 16:55:12:259 ProcessGPO: Found display name of: <Disable Skype>

    USERENV(518.6b0) 16:55:12:259 ProcessGPO: Found machine version of: GPC is 155, GPT is 155

    USERENV(518.6b0) 16:55:13:821 CheckGPOs: No GPO changes but called in force refresh flag or extension Registry needs to run force refresh in foreground processing

    ….

    USERENV(51c.7b0) 17:25:00:491 ProcessGPOs: Processing extension IP 安全性

    USERENV(51c.7b0) 17:25:00:491 ReadStatus: Read Extension's Previous status successfully.

    USERENV(51c.7b0) 17:25:00:491 CompareGPOLists: The lists are the same.

    USERENV(51c.7b0) 17:25:00:491 CheckGPOs: No GPO changes and no security group membership change and extension IP 安全性 has NoGPOChanges set.

    由以上這個Log,我們可以看到GPO有正常套用,只是某些GPO原則曾經套用過之後就不會再重複套用(例如軟體派送以及IE 原則的處理), gpupdate /force 主要的目的是全部強迫重新套用一次。我們可以透過修改GPO來強制每次登入的時候都要重新套用一次。

    設定"在電腦啟動即登入時要等待網路啟動"->為了讓Windows XP Client不會使用Cached Logon

    clip_image001

    由於此問題與登錄相關所以啟動"登錄原則處理" 既使沒變動也要更新

    clip_image002

    可以確認該GPO與哪些相關聯啟動既使沒變更也要進行套用

    clip_image004

    案例三 用戶端等待套用時間太短,導致群組原則不處理

    UserEnv.log

    USERENV(23c.440) 15:27:53:138 ProcessGPOs: The DC for domain MSFT is not available at startup. retrying
    USERENV(23c.440) 15:27:53:138 RetryDCContactAtMachineStartup: Failed to query GpNetworkStartTimeoutPolicyValue with 2, exit.
    USERENV(23c.440) 15:27:53:138 ProcessGPOs: The DC for domain MSFT is not available after retries.
    USERENV(23c.440) 15:27:53:138 ProcessGPOs: The DC for domain MSFT is not available. aborting
    USERENV(23c.890) 15:29:20:894 GetGPOInfo:  Local GPO's gpt.ini is not accessible, assuming default state.
    USERENV(23c.48c) 15:29:22:687 PolicyChangedThread: UpdateUser failed with 6.

    Event Log

    事件類型: 錯誤
    事件來源: Userenv
    事件類別目錄: 無
    事件識別碼: 1054
    日期:  97/4/28
    時間:  上午 11:51:47
    使用者:  NT AUTHORITY\SYSTEM
    電腦: ATWA0219
    描述:
    Windows 無法取得電腦所屬網域的網域控制站名稱。(指定的網域可能不存在或無法連線。 )。群組原則處理已中止。

    請在 http://go.microsoft.com/fwlink/events.asp 查看說明及支援中心,以取得其他資訊。

    事件類型: 錯誤
    事件來源: Userenv
    事件類別目錄: 無
    事件識別碼: 1054
    日期:  97/4/28
    時間:  下午 01:44:43
    使用者:  NT AUTHORITY\SYSTEM
    電腦: ATWA0219
    描述:
    Windows 無法取得電腦所屬網域的網域控制站名稱。(指定的網域可能不存在或無法連線。 )。群組原則處理已中止。

    請在 http://go.microsoft.com/fwlink/events.asp 查看說明及支援中心,以取得其他資訊。

    RESOLUTION

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

    322756How to back up and restore the registry in Windows

    To resolve this problem, add the GpNetworkStartTimeoutPolicyValue registry entry on the Windows XP SP2-based computer. This entry specifies the number of seconds that the system waits before it tries to run the Group Policy startup script again. To find the value that will work for your configuration, define a decimal value of 60, and then incrementally increase this value until the problem is resolved.
    To add the GpNetworkStartTimeoutPolicyValue registry entry and to define the value, follow these steps:

    1.Click Start, click Run, type regedit, and then click OK.

    2.Expand the following registry subkey:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

    3.Right-click Winlogon, point to New, and then click DWORD Value.

    4.To name the new entry, type GpNetworkStartTimeoutPolicyValue, and then press ENTER.

    5.Right-click GpNetworkStartTimeoutPolicyValue, and then click Modify.

    6.Under Base, click Decimal.

    7.In the Value data box, type 60, and then click OK.

    8.Close Registry Editor, and then restart the computer.

    9.If the Group Policy startup script does not run, incrementally increase the value of the GpNetworkStartTimeoutPolicyValue registry entry until the problem is resolved.

    參考資料

    Group Policy may not install the PolicyMaker Software Update client on a Windows XP Service Pack 2-based computer, and event ID 5719 and event ID 1054 are logged"

    http://support.microsoft.com/kb/933458

    案例四 外點XP cannot apply Group Policy

    總公司 ServerFrame

         |   雙向 4M

       ISP

         |     2M/512k

    分公司 ClientFrame
    根據封包及Userenv 及GPresult 確認.此Client Frame 主要為 Slowlink 連線. 故會有很多GPO 套用不會生效.

    Gpresult:

    下面的RSOP是收集於分公司的client電腦。

    RSOP data for msft\00193 on SA100193-XPPC : Logging Mode
    ------------------------------------------------------------

    OS Type:                     Microsoft Windows XP Professional
    OS Configuration:            Member Workstation
    OS Version:                  5.1.2600
    Terminal Server Mode:        Remote Administration
    Site Name:                   Default-First-Site-Name
    Roaming Profile:            
    Local Profile:               C:\Documents and Settings\00193
    Connected over a slow link?: Yes

    下面的RSOP是收集於總公司的client電腦。

    RSOP data for msft\00840 on MIS00840-XPNB : Logging Mode
    ------------------------------------------------------------

    OS Type:                     Microsoft Windows XP Professional
    OS Configuration:            Member Workstation
    OS Version:                  5.1.2600
    Terminal Server Mode:        Remote Administration
    Site Name:                   Default-First-Site-Name
    Roaming Profile:            
    Local Profile:               C:\Documents and Settings\00840
    Connected over a slow link?: No

    經過判斷,電腦認為這個網路連線是屬於低速連線,我們可以嘗試關閉 Client PC SlowLink 偵測:

    To disable slow link detection on the Windows XP client computer, set the following registry values:

    Registry subkey: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System
    Value name: GroupPolicyMinTransferRate
    Value type: DWORD
    Value Data: 0

    Registry subkey: HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System
    Value name: GroupPolicyMinTransferRate
    Value type: DWORD
    Value Data: 0

    These registry settings must be configured manually because Group Policy is not applied in this scenario.

    These registry settings are otherwise set by the following Group Policy settings:

    Policy location: Computer Configuration\Administrative Templates\System\Group Policy
    Policy name: Group Policy slow link detection
    Policy setting: Enabled with a value of 0

    Policy location: User Configuration\Administrative Templates\System\Group Policy
    Policy name: Group Policy slow link detection
    Policy setting: Enabled with a value of 0

    額外的建議:

    1.網路專線(wan)加大

    2.外點當地擺放DC

    3.Disable slow link detection(預設都有開啟)

    Reference:

    Default Behavior for Group Policy Extensions with Slow Link 227369
    How a slow link is detected for processing user profiles and Group Policy 227260

  • 六月份快問快答(五)

    Windows VISTA SP1之後群組原則管理程式不見了?

    問題癥狀:當安裝完Windows VISTA Service Pack 1之後,GPMC.MSC不見了,在MMC中也找不到相關的嵌入式元件?

    解決方法:在Windows VISTA Service Pack 1之後,許多的工具都被併入Remote Server Administration Tools(RSAT)中,請到微軟網站下載RSAT安裝之後到Feature中啟用即可。

    參考網頁:

    941314    Description of Windows Server 2008 Remote Server Administration Tools for Windows Vista Service Pack 1

    下載網頁:

    Microsft遠端伺服器管理工具(32位元)

  • 六月份快問快答(四)

    為什麼Windows VISTA 無法向 Windows Server 2003的Certsrv網站取得憑證?

    問題癥狀:使用Windows VISTA時,當您透過網路瀏覽器到Windows Server 2003 的CA Server上嚐試做 Web Enroll的時候,發現最後下載安裝的網頁一片空白,或是發生錯誤。

    解決方法:由於Windows VISTA之後,憑證的運作方式已經改變,若要讓舊有的Windows Server 2003的CA Web site可以讓VISTA進行Web Enroll,必須要安裝更新程式,詳情的部分請參考以下KB:

    922706 How to use Certificate Services Web enrollment pages together with Windows Vista or Windows Server 2008

  • 六月份快問快答(三)

    為何設定Users Group 可以使用工作排程後,指派的工作如果為 Batch 都無法正確執行?

    問題癥狀:當設定工作排程給Users 這個Group使用時,所有的Batch檔案的工作都無法正確執行。

    解決方法:

    1. 請檢查GPO 是否允許 User Group or 此Account "以批次工作登入"

    開啟GPO 編輯器.檢視 [電腦設定] \[Windows 設定安全性設定]\ [本機原則]\ [使用者權利指派]  "以批次工作登入"

    06202008-01

    2.預設執行 Batch 會需要執行 cmd.exe .其此執行檔案安全性並不允許 User Gorup 可以背景執行 CMD.exe 所有會有此問題發生

    故可以採用以下指令,給予執行此程式的權限

    cacls  %windir%\system32\cmd.exe /E /G BUILTIN\Users:F

    06202008-02