Skip navigation

JSI Tip 7817. How do I cause the User Profile Hive Cleanup Service (UPHClean) to NOT force resources to close?


In tip 7815 - Some user profiles will not unload, I described the UPHClean Service.

I have scripted UPHClean_Report_Only.bat to cause the UPHClean Service, on every computer in your domain, to only log, and NOT free, locked resources.

NOTE: See How do I cause the User Profile Hive Cleanup Service (UPHClean) to log when it finds resources that won't otherwise close?

The syntax for using UPHClean_Report_Only.bat is:

UPHClean_Report_Only

NOTE: The output is displayed on the CMD console, but you can pipe it to a file using the following syntax:

UPHClean_Report_Only>FileName

NOTE: UPHClean_Report_Only.bat uses REG.EXE and NETDOM.EXE built into Windows XP and Windows Server 2003, or from the Windows 2000 Support Tools.

UPHClean_Report_Only.bat contains:

@echo off
setlocal
set netdm=netdom query /domain:%userdnsdomain%
for /f "Skip=1 Tokens=*" %%c in ('%netdm% dc^|find /v /i "The command completed successfully."') do (
 set cmp=%%c
 call :doit
)
for /f "Skip=1 Tokens=*" %%c in ('%netdm% server^|find /v /i "The command completed successfully."') do (
 set cmp=%%c
 call :doit
)
for /f "Skip=1 Tokens=*" %%c in ('%netdm% workstation^|find /v /i "The command completed successfully."') do (
 set cmp=%%c
 call :doit
)
endlocal
@echo **********************
exit /b 0
:doit
set work=%cmp:     ( Workstation or Server )=%
if "%work%" NEQ "%cmp%" set cmp=%work%#
set cmp=%cmp: #=%
set cmp=%cmp:#=%
@echo **********************
@echo.
@echo Process %cmp%
REG ADD \\%cmp%\HKLM\SYSTEM\CurrentControlSet\Services\UPHClean\Parameters /v CALLSTACK_LOG /t REG_DWORD /d 00000001 /f
REG ADD \\%cmp%\HKLM\SYSTEM\CurrentControlSet\Services\UPHClean\Parameters /v REPORT_ONLY /t REG_DWORD /d 00000001 /f
@echo.



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish