+ Post New Thread
Page 4 of 5 FirstFirst 12345 LastLast
Results 46 to 60 of 75
Windows Thread, Script to delete profile at log off? in Technical; Hi I know this will sound silly but will you not have to put it in a start up script. ...
  1. #46
    ricki's Avatar
    Join Date
    Jul 2005
    Location
    uk
    Posts
    1,477
    Thank Post
    20
    Thanked 164 Times in 157 Posts
    Rep Power
    53
    Hi

    I know this will sound silly but will you not have to put it in a start up script. As far as i know some parts of profiles and locked until the computer reboots, so if you put it in a log off or shutdown script would some bits not be left.

    Richard

  2. #47
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75
    I'm running it as a startup script so it should run as system. I have another script that just deletes every profile other than admin etc and that works i'm assigning them the same way so i'm sure i've got that set right.

  3. #48
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75
    @ pwds & ricki, are you both using this script?


    Ok i'm going to keep an eye on it, it seems to be not deleting what it terms 'orphaned directories'. I'm not sure if these are ones where it can't find a corresponding SID or not, i've set it to delete profiles that are more than one day old so we'll see tomorrow.


    Update: Ok I checked the log again this morning and it is deleting profiles older than the date I set but for some reason it skips what it considers to be an ‘Orphaned Profile Directory’. I’m not sure why that is perhaps the first time it ran it didn’t find a reghive entry for it. The log lists these profiles as being deleted but they never go, I’m not that bothered if from now on it keeps deleting profiles that are older than 2 days.
    Last edited by cookie_monster; 4th March 2010 at 10:27 AM.

  4. #49
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75
    Quote Originally Posted by Gibbo View Post
    Can I just ask why nobody seems to be using the method described by rvdmast that I quoted in my earlier post?

    It works for me and doesn't need any batch files or scripts.


    The script I’m using doesn't delete a profile until it's a certain age, I set staff PC's to 21 days so they always have a local profile allowing fast logon but if they move rooms or leave their profile is eventually cleaned up. I set class PC's to 1 day so if a client crashes sometimes we can recover temp files or we can look for cookies etc if we're trying to track problems down, if we immediately delete the profile this is all lost.

  5. #50
    pwds's Avatar
    Join Date
    Dec 2008
    Location
    Derby
    Posts
    279
    Thank Post
    73
    Thanked 48 Times in 38 Posts
    Rep Power
    21
    With scripts we can set the staff machines to delete profiles older than 30-90 days and student machines after seven. We actually do it on the machine basis and not the user.

    That way we're not constantly recreating and deleting profiles (adding to login time etc.) but also don't have a year's worth of profiles on each HDD.

    Combine this with a scheduled defrag and it helps keep the machines more sprightly.

  6. #51
    ricki's Avatar
    Join Date
    Jul 2005
    Location
    uk
    Posts
    1,477
    Thank Post
    20
    Thanked 164 Times in 157 Posts
    Rep Power
    53
    Hi

    I dont run the delprof as a gpo script I run a set of bat files that does one room each when the network is quiet.

    Its not fancy but I get the benefit that it cuases less inpact on the network and users get a faster log on.

    Richard

  7. #52
    Modey's Avatar
    Join Date
    Oct 2007
    Location
    Northants
    Posts
    140
    Thank Post
    16
    Thanked 31 Times in 26 Posts
    Rep Power
    20
    Quote Originally Posted by Gibbo View Post
    Can I just ask why nobody seems to be using the method described by rvdmast that I quoted in my earlier post?

    It works for me and doesn't need any batch files or scripts.
    I'm going to try it for all pupils at my place now that I have seen this thread.

  8. #53
    Griff's Avatar
    Join Date
    Feb 2009
    Location
    Bedfordshire
    Posts
    548
    Thank Post
    212
    Thanked 103 Times in 84 Posts
    Rep Power
    39
    Quote Originally Posted by Gibbo View Post
    Can I just ask why nobody seems to be using the method described by rvdmast that I quoted in my earlier post?

    It works for me and doesn't need any batch files or scripts.
    We started using that method and for some unknown reason (at the moment) it just stopped working!! still trying to work out why =(

  9. #54
    themightymrp's Avatar
    Join Date
    Dec 2009
    Location
    Leeds, West Yorkshire
    Posts
    1,290
    Thank Post
    219
    Thanked 237 Times in 205 Posts
    Rep Power
    76

    This works for me with XP

    I use this script as a startup script which I just added into a blank GPO. It deletes all cached profiles on machines leaving out the ones that I need to keep. It ignores any hidden profiles such as 'Default User' by default anyway :)

    @echo off
    c:
    cd\
    cd "c:\Documents and Settings\"
    dir *.* /b /o:d > \dirs.txt
    for /f "tokens=*" %%a in (\dirs.txt) do call :DelFiles "%%a"
    del \dirs.txt
    exit /b

    :DelFiles %1
    set Flag=0
    if %1=="All Users" set Flag=1
    if %1=="Administrator" set Flag=1
    if "%Flag%"=="0" (
    cd %1
    attrib *.* -r /s
    cd..
    rem change rd %1 /s /q
    rem for no confirmation
    rd %1 /s /q
    )


    If there are a lot of cached profiles then the first run of this may take 5 - 6 minutes. second runs though are almost instant.

  10. #55
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75
    I'll just add for the benefit of others that the shonk script is now working very well, the ability to exlude profiles untill a certain age is very usefull.

    The Shonk Project - Delete Profiles Script v1.9

  11. #56
    Chad's Avatar
    Join Date
    May 2007
    Location
    Elgin
    Posts
    74
    Thank Post
    5
    Thanked 20 Times in 19 Posts
    Rep Power
    19
    Quote Originally Posted by mrbios View Post
    I've only come across one issue during testing so far, when a user logs out it removes the profile, then 10seconds later it reappears but the only thing that is in there is "local settings > application data" and it's empty, the next time that same user logs in it creates a folder "user.DOMAIN" (where the username is user and your domain is domain etc) and when the user then logs out that folder is removed completely but still leaving the original empty user folder

    Anyone come across this yet? not much of a problem as it's only 0 bytes but would be nice to have it gone
    I found the reason why this was happening to PCs here: the ATI Hotkey Poller service (of all things!) was maintaining a lock on the profile folder and wouldn't let go, even after the user logged off. I tried to stop the service manually but the option was greyed out, so I switched it to manual to prevent it running in future (and have now got the startup script to do so).

    We've some non-ATI machines showing the same behaviour so I'll investigate those at some point.

    I used process explorer to find the offending file - after logging off, I immediately logged back on again and used process explorer to find anything with a lock to the previous profile folder (which was now empty) and ati2evxx.exe showed up.

    HTH someone,

    Chad

  12. Thanks to Chad from:

    cookie_monster (15th March 2010)

  13. #57
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,217
    Thank Post
    394
    Thanked 278 Times in 239 Posts
    Rep Power
    75
    Quote Originally Posted by Chad View Post
    I found the reason why this was happening to PCs here: the ATI Hotkey Poller service (of all things!) was maintaining a lock on the profile folder and wouldn't let go, even after the user logged off. I tried to stop the service manually but the option was greyed out, so I switched it to manual to prevent it running in future (and have now got the startup script to do so).

    We've some non-ATI machines showing the same behaviour so I'll investigate those at some point.

    I used process explorer to find the offending file - after logging off, I immediately logged back on again and used process explorer to find anything with a lock to the previous profile folder (which was now empty) and ati2evxx.exe showed up.

    HTH someone,

    Chad


    Good work chad, that very reason is why I tend do to the delete at boot time.

  14. #58
    Chad's Avatar
    Join Date
    May 2007
    Location
    Elgin
    Posts
    74
    Thank Post
    5
    Thanked 20 Times in 19 Posts
    Rep Power
    19
    Quote Originally Posted by cookie_monster View Post
    Good work chad, that very reason is why I tend do to the delete at boot time.
    Yep, I'm using a combo of "all the above" options (delprof, UPHC service, and cleanup scripts for when delprof fails), with the scripts and delprof running during startup. It still bugs me as to why it was happening though so I was glad to get to the bottom of it!

    I'd do the "guest user" thing, only I don't want profiles removed from laptops.

    Cheers,

    Chad
    Last edited by Chad; 15th March 2010 at 03:37 PM. Reason: typo

  15. #59

    Join Date
    Jul 2010
    Location
    Ava
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Two Groups. Teachers and students.

    Quote Originally Posted by ajbritton View Post
    I do the lot. GPO setting + UPHCLEAN + DELPROF /Q /I /R.
    Would this setup work for this scenario?
    I have teachers on roaming profiles I do want them to be able to keep their profile but I want to delete profiles older than 6 months (to start).
    I have Students who only use lab computers and have roaming profiles, I do not want their profiles to be saved on the local pc.
    We have a AD Domain and I would like to use GPO's as much as possible. Can the UPHCLEAN.msi and the delprof be pushed out and work as I have previously stated I needed? I have not used delprof or upclean before so I am a little leary about using them

  16. #60

    Join Date
    Sep 2009
    Location
    Elkton, Maryland
    Posts
    13
    Thank Post
    0
    Thanked 6 Times in 1 Post
    Rep Power
    12
    Quote Originally Posted by rvdmast View Post
    One really doesn't need to use batch files, delprof, GPO's or commercial utility's,
    the answer is really simple:
    make the users member of the group "Domain Guests" or the local Guests group, and their profiles will be deleted immediatly after logoff automatically.
    This functionality is built-in by design.

    They can still remain in the domain users group too, so it won't affect their rights.
    I am ETERNALLY indebted to you!!!



SHARE:
+ Post New Thread
Page 4 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Script to Delete Profiles - PLEASE HELP
    By Mr_M_Cox in forum Scripts
    Replies: 13
    Last Post: 22nd February 2013, 04:53 PM
  2. Replies: 8
    Last Post: 17th November 2007, 10:04 PM
  3. need a script to delete shortcuts
    By philtomo-25 in forum Scripts
    Replies: 2
    Last Post: 1st November 2007, 04:50 PM
  4. Delete Profile on LogOff
    By roland in forum How do you do....it?
    Replies: 11
    Last Post: 20th September 2007, 10:43 PM
  5. Script to delete printer
    By tosca925 in forum Scripts
    Replies: 2
    Last Post: 31st August 2005, 08:45 PM

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •