enjay Posted February 17, 2015 Posted February 17, 2015 I'm trying to create a Startup script to execute DelProf2, but not having much success. I have a working batch file, but it doesn't work when I add it via GPO. I know the GPO is deploying, because I also made another change in the same GPO and that has applied. When the batch file is fired manually, it needs to be done from an Administrator CMD, but I don't think that is my problem, as GPO scripts all run with elevated permissions (don't they?). I have tried calling the batch file from the GPO and also running the .exe itself with the various switches set as parameters. I have put the .exe and the .bat in the SysVol\scripts\%GUID%\machine\startup folder; I have also copied them onto the local disk in case there is a way I could execute them from there instead. I can't see anything in Event Viewer about the script to suggest why it isn't running, or even to confirm that it is being called, but I don't know I would expect to for this; DelProf2 doesn't have a logging option, so I can't enable that to check it is running. Any ideas?
DavetheITguy Posted February 18, 2015 Posted February 18, 2015 When I use DELPROF2, I don't use a startup script, I use a UNC path to the computer and then I simply run the CMD file from my computer. I find it works better this way. If you need any help on how to do this I can send you a snippet of mine that you can alter. David
enjay Posted February 18, 2015 Author Posted February 18, 2015 When I use DELPROF2, I don't use a startup script, I use a UNC path to the computer and then I simply run the CMD file from my computer. I find it works better this way. If you need any help on how to do this I can send you a snippet of mine that you can alter. David Yes please. I'd like to have it run automatically, but a manual process from a single computer is the next best thing.
Davit2005 Posted February 18, 2015 Posted February 18, 2015 (edited) This is my script, elected to do it this way for testing, it puts a report in the area of who's profile will be deleted. Profiles get deleted after 2 days. It is ran as a startup script. mkdir c:\apps copy \\domain.local\NETLOGON\DelProf2.exe c:\apps c:\apps\DelProf2.exe /l /d:2 > c:\apps\delprof.txt c:\apps\DelProf2.exe /q /d:2 Edited February 18, 2015 by Davit2005
DavetheITguy Posted February 18, 2015 Posted February 18, 2015 (edited) I have a task schedule on DC1 that runs it every month, I don't have to run it manually. \\vm-dc1\netlogon\Delprof2\delprof2.exe /u /c:\\its-rbt /ed:admin* /ed:public* all you have to do is add the each computer to the script, /u = unattended, /c = computer name, /ed = profiles to be excluded from the clean up. I have saved the cmd file with the delprof.exe in a folder on DC1 Thanks, David Edited February 18, 2015 by DavetheITguy
enjay Posted February 18, 2015 Author Posted February 18, 2015 I have a task schedule on DC1 that runs it every month, I don't have to run it manually. \\vm-dc1\netlogon\Delprof2\delprof2.exe /u /c:\\its-rbt /ed:admin* /ed:public* I've just tried that, and got told "Privilege 'backup files and directories' could not be enabled" and told to run DelProf with admin rights, which I already am. Also, that Remote Registry Service isn't started on the target computer.
enjay Posted February 18, 2015 Author Posted February 18, 2015 Just realised I did a Very Silly Thing . The script which I had added to the NetLogon folder wasn't the right one. I had an incorrect switch in it, which I had corrected in my test version but not copied back to the server. It now works as a startup script. I'm not sure if I'm more happy I've got it working or annoying I lost several hours to this error...
DavetheITguy Posted February 18, 2015 Posted February 18, 2015 Welcome to the world of IT !!! At least you were able to find the mistake and rectify it.
jamwatn Posted February 21, 2015 Posted February 21, 2015 If nobody has replied to this by the time I get back to school I'll be able to tell you how I got it working. Got it applied to a lot of machines because it seems the amount of profiles on a box affects log ons quite significantly! I've got a batch that delays ten mins then begins deleting leaving 3 days of profiles. The delay allows for slow log ins and/or settling down time!
DrCheese Posted February 23, 2015 Posted February 23, 2015 Are you sure you need to do this? In GPO you can set it to auto delete out of date profiles after X days, I think I have ours set to 14. This way you get the best of both worlds - A quick logon for a user that's already been on it recently, but without hogging too much disk space
enjay Posted February 23, 2015 Author Posted February 23, 2015 I'm there now, thanks everyone. I had done a silly thing, and had a syntax error in the script. I had corrected the script, but not copied the corrected batch file to Netlogon (although I'm now doing it by putting the full command line script in the GPO anyway). @DrCheese - yes, I'm sure. I tried using the GP which you suggest, but it didn't work for some reason. Possibly because that GPO deletes roaming profiles, and these would apparently be cached local profiles.
jamwatn Posted February 23, 2015 Posted February 23, 2015 Doesn't always seem to work and there is no control when it happens etc
LukeC Posted May 21, 2015 Posted May 21, 2015 @DavetheITguy Do you run the script in the day time when there are users on the machines or do you do it out of hours? If done while users are on the machines do they notice an impact in performance?
jamwatn Posted May 22, 2015 Posted May 22, 2015 @LukeC if Dave doesn't answer. We run on computer start up, with a ten minute delay. Doesn't affect performance. 1
enjay Posted May 26, 2015 Author Posted May 26, 2015 @LukeC if Dave doesn't answer. We run on computer start up, with a ten minute delay. Doesn't affect performance. Why (and how) do you have a delay on it?
jamwatn Posted May 26, 2015 Posted May 26, 2015 The delay is because the Wi-Fi in the school is so bad that if the user takes a long time to log on, delprof doesn't throttle it further. Was just as a performance precaution mainly from the time when there were lots of users to delete.
dubsdj Posted June 23, 2015 Posted June 23, 2015 I would stay away from that delprof it causes more trouble that its worth. change x days to auto delete profile so it is deleted properly / registry entries etc.
CHiLL Posted June 23, 2015 Posted June 23, 2015 I decided to run it as a Shutdown Script via Computer Policies in Group Policy, this way it doesn't affect boot/logon times (which is all people whine about) and it runs using the administrator credentials. Group Policy > Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shutdown) > Shutdown Once in here, I simply added DelProf2.exe into the scripts folder for that policy with the following switches in the parameters "-q -u -i" It appears to work without any issues thus far.
kennysarmy Posted June 23, 2015 Posted June 23, 2015 Just reading up about DelProf and it appears to need the "remote registry service" started - is this on by default on most of your PC's ? I'm sure ours are set to manual by default. Are you starting it and then stopping it after you run DelProf2?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now