Thanks for the script James. We do reboot all 180 of our servers nightly. No
one has really had the time to dig in and investigate the root issue. Our
Citrix Admins just make it a point to scan and delete in left over
directories every couple of weeks. I'll pass along this script.

- Sean

On Tue, Mar 22, 2011 at 12:05 AM, James Rankin <[email protected]>wrote:

> On XenApp 5 and 6 we generally have a nightly or bi-nightly reboot, then at
> startup run this script to get rid of any "hung" profiles (this works on
> 2008 and 2008 R2, needs a slight mod for 2003)
>
> *@echo off
> setlocal
> setlocal enableextensions
>
> for /f "skip=1 tokens=4*" %%a in ('dir "%systemdrive%\Users"^|find
> "<DIR>"^|find /v ".."') do set profile=%%a %%b& call :REMOVE
>
> set profile=
> endlocal
> goto :eof
>
>
> :REMOVE
>
> :: Remove the profile directory completely
>
> rmdir /S /Q "%systemdrive%\Users\%profile%"
>
> goto :eof*
>
> However it is often best to try and identify the root cause of the profile
> lock. VMWare Tools, installed with the "Complete" option, can cause this.
> Process Explorer and Process Monitor may help identify this.
>
>
> On 22 March 2011 05:40, Sean Martin <[email protected]> wrote:
>
>> Thanks for the info. However, we experience the problem on our XenApp5
>> servers (Windows 2003). We've tried running delprof as a shutdown script,
>> startup script, and both. Ocassionally something just locks a file within
>> the user profile so it can't be deleted entirely, which leaves the root
>> folder behind. The next time that person logs into the server, a new profile
>> directory is created <username.domain>.
>>
>>
>> On Mon, Mar 21, 2011 at 3:16 PM, Crawford, Scott 
>> <[email protected]>wrote:
>>
>>>  Delprof fails on windows 7 with antivirus software.  AV updates the
>>> last accessed attribute on the files so delprof thinks they’ve been used
>>> recently.  There’s a hotfix available, but the fix is included in SP1.
>>>
>>>
>>>
>>> Not sure if that’s relevant to your situation, but it bit us.
>>>
>>>
>>>
>>> *From:* Sean Martin [mailto:[email protected]]
>>> *Sent:* Monday, March 21, 2011 6:12 PM
>>>
>>> *To:* NT System Admin Issues
>>> *Subject:* Re: Large user profiles on server
>>>
>>>
>>>
>>> We use a combination of delprof and uphclean in our Citrix environment.
>>> However, we still run into issues where profile directories haven't been
>>> fully purged.
>>>
>>>
>>>
>>> - Sean
>>>
>>> On Mon, Mar 21, 2011 at 11:46 AM, Rankin, James R <[email protected]>
>>> wrote:
>>>
>>> Uphclean is now the user profile service on 2008
>>>
>>> Typed frustratingly slowly on my BlackBerry® wireless device
>>>  ------------------------------
>>>
>>> *From: *Kim Longenbaugh <[email protected]>
>>>
>>> *Date: *Mon, 21 Mar 2011 18:29:05 +0000
>>>
>>> *To: *NT System Admin Issues<[email protected]>
>>>
>>> *ReplyTo: *"NT System Admin Issues" <
>>> [email protected]>
>>>
>>> *Subject: *RE: Large user profiles on server
>>>
>>>
>>>
>>> Will “uphclean” work for you?
>>> http://www.microsoft.com/downloads/en/details.aspx?FamilyID=1b286e6d-8912-4e18-b570-42470e2f3582&displaylang=en
>>>
>>>
>>>
>>>
>>>
>>> *From:* Tom Miller [mailto:[email protected]]
>>> *Sent:* Monday, March 21, 2011 10:43 AM
>>> *To:* NT System Admin Issues
>>> *Subject:* Large user profiles on server
>>>
>>>
>>>
>>> Folks,
>>>
>>>
>>>
>>> I use terminal server roaming profiles.  We find we need to periodically
>>> delete local profiles, since one of our applications leaves temporary files
>>> behind and they fill the profile limit after a while.
>>>
>>>
>>>
>>> What I am seeing is that either logged in as local administrator or
>>> domain admin, the delete option is greyed out on my Windows 2008 servers.
>>> This isn't an issue on the 2003 servers.  Users are not logged in, so the
>>> profiles should not be locked.
>>>
>>>
>>>
>>> Suggestions?
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Tom
>>>
>>>
>>>
>>> Confidentiality Notice: This e-mail message, including attachments, is
>>> for the sole use of the intended recipient(s) and may contain confidential
>>> and privileged information. Any unauthorized review, use, disclosure, or
>>> distribution is prohibited. If you are not the intended recipient, please
>>> contact the sender by reply e-mail and destroy all copies of the original
>>> message.
>>>
>>> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
>>> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>>>
>>> ---
>>> To manage subscriptions click here:
>>> http://lyris.sunbelt-software.com/read/my_forums/
>>> or send an email to [email protected]
>>> with the body: unsubscribe ntsysadmin
>>>
>>> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
>>> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>>>
>>> ---
>>> To manage subscriptions click here:
>>> http://lyris.sunbelt-software.com/read/my_forums/
>>> or send an email to [email protected]
>>> with the body: unsubscribe ntsysadmin
>>>
>>> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
>>> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>>>
>>> ---
>>> To manage subscriptions click here:
>>> http://lyris.sunbelt-software.com/read/my_forums/
>>> or send an email to [email protected]
>>> with the body: unsubscribe ntsysadmin
>>>
>>>
>>>
>>> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
>>> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>>>
>>> ---
>>> To manage subscriptions click here:
>>> http://lyris.sunbelt-software.com/read/my_forums/
>>> or send an email to [email protected]
>>> with the body: unsubscribe ntsysadmin
>>>
>>> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
>>> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>>>
>>> ---
>>> To manage subscriptions click here:
>>> http://lyris.sunbelt-software.com/read/my_forums/
>>> or send an email to [email protected]
>>> with the body: unsubscribe ntsysadmin
>>>
>>
>> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
>> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>>
>> ---
>> To manage subscriptions click here:
>> http://lyris.sunbelt-software.com/read/my_forums/
>> or send an email to [email protected]
>> with the body: unsubscribe ntsysadmin
>>
>
>
>
> --
> "On two occasions...I have been asked, 'Pray, Mr Babbage, if you put into
> the machine wrong figures, will the right answers come out?' I am not able
> rightly to apprehend the kind of confusion of ideas that could provoke such
> a question."
>
> *IMPORTANT: This email is intended for the use of the individual
> addressee(s) named above and may contain information that is confidential,
> privileged or unsuitable for overly sensitive persons with low self-esteem,
> no sense of humour or irrational religious beliefs. If you are not the
> intended recipient, any dissemination, distribution or copying of this email
> is not authorised (either explicitly or implicitly) and constitutes an
> irritating social faux pas.
>
> Unless the word absquatulation has been used in its correct context
> somewhere other than in this warning, it does not have any legal or no
> grammatical use and may be ignored. No animals were harmed in the
> transmission of this email, although the kelpie next door is living on
> borrowed time, let me tell you. Those of you with an overwhelming fear of
> the unknown will be gratified to learn that there is no hidden message
> revealed by reading this warning backwards, so just ignore that Alert Notice
> from Microsoft.
>
> However, by pouring a complete circle of salt around yourself and your
> computer you can ensure that no harm befalls you and your pets. If you have
> received this email in error, please add some nutmeg and egg whites, whisk
> and place in a warm oven for 40 minutes.*
>
>   ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>
> ---
> To manage subscriptions click here:
> http://lyris.sunbelt-software.com/read/my_forums/
> or send an email to [email protected]
> with the body: unsubscribe ntsysadmin
>

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to