Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 884
  • Last Modified:

Network Maintenance Plan that does not require user interaction

Hello,
I am an automation tech for a network of about 800 computers.  They are all Windows XP Pro machines on a domain powered by Windows Server 2003.  I need a Maintenance Plan to upkeep these machines that does NOT require ANY user interaction.  

I don't want the users having any responsibility anymore then I want to go to each machine and run the maintenance individually for each one.

Thanks for your ideas and feedback,

zbox
0
zbox
Asked:
zbox
  • 8
  • 7
  • 5
1 Solution
 
PakaCommented:
No need to visit each machine.  Setup a group policy to perform the maintenance.
0
 
sarangk_14Commented:
What do you mean by maintenance? If you are talking about running disk check and de-fragmenting drives, you can do that through scheduling. If you are talking about performing registry cleaning, cache cleaning and other such services, there are a number of freeware tools available on the Internet.

Hope this helps.
0
 
zboxAuthor Commented:
GPO is a great way to do it.  However, how would you avoid ANY user interaction?  

From what I understand, GPO or scheduling things like Disk Cleanup or Defrag, will prompt on the screen for the user to hit "next" or "analyze."  

Yes by maintenance I do mean Disk Cleanup and Defrag.  Thanks for your comments.

zbox
0
NEW Internet Security Report Now Available!

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out this quarters report on the threats that shook the industry in Q4 2017.

 
sarangk_14Commented:
Hi,

Please check out the following:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/2000/Q_21036205.html
http://support.microsoft.com/kb/179306

Both these documents tell you about automating the defrag and scandisk, without user intervention.

Hope this helps.
0
 
sarangk_14Commented:
Hi,

Please check out the following:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/2000/Q_21036205.html
http://support.microsoft.com/kb/179306

Both these documents tell you about automating the defrag and scandisk, without user intervention.

Hope this helps.
0
 
sarangk_14Commented:
Hi,

Please check out the following:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/2000/Q_21036205.html
http://support.microsoft.com/kb/179306

Both these documents tell you about automating the defrag and scandisk, without user intervention.

Hope this helps.
0
 
PakaCommented:
Are all of your client machines configured the same - specifically do they have the same type of disk configuration?  If you can identify how many volumes they have and the letters, I'll put a batch file that you can deploy using group policy.
0
 
zboxAuthor Commented:
this like exactly what im talking about!  can't wait to try it out.  I'll be in touch, thanks experts for your comments, thanks sarangk.  I'll be back to this question ASAP after I see the results.

zbox
0
 
PakaCommented:
Here are a couple more questions I need answered before I can put the script together.
Is it OK to reboot the machines at 0100?
Is it OK to run the scandisk at 0100 each sunday?
Is it OK to run the defag at 0200 each sunday?
0
 
zboxAuthor Commented:
yes to all of the above.

The computers have the same disk config and only the C: drive.

also 0100 hours is fine and sunday is fine too.  but if possible, make a note that i can edit the script if i need to change the time on my own if that changes.

woot!  keep in touch
0
 
sarangk_14Commented:
0
 
PakaCommented:
There's going to be a lot of "moving parts" on this one.  Give me about an hour to put the group policy steps and script together.
0
 
PakaCommented:
Here goes:
Save the code snippet below to a file named "chkNDefrag.bat"

Logon to a machine using an admin account.
Open a command prompt and type \\domainname\netlogon to open the netlogon directory for your domain.  Copy the chkNDefrag.bat file to the netlogon share.

Open Active Directory Users and Computers
Right click on your domain name and select properties
Click Group Policy tab
Click New
Name your new group policy "Chkdsk and Defrag"
Open Computer Configuration, Windows Settings, Scripts
Double-click Startup in right-hand pane
Click Add
Click Browse
Type \\domainname\netlogon in File name box
Click Open
Double-click chkNDefrag.bat
Click OK
Close Group Policy Editor
Click OK to close Group Policy

Restart a machine in your domain.
Open a command prompt
Type "tasks" and enter to view scheduled tasks
Verify three tasks named "Chkdsk Task", "Restart Task" and "Defrag Task" are scheduled for 12:45, 01:00 and 02:00

Since you have a good sized domain, you might want to test this change on a couple machines to ensure there are no issues.  To do so, create a test OU - let's call it testOU and create and assign the group policy against that OU instead of the domain.  You will also need move a couple test machines into that OU.

'Program: CheckAndDefrag.bat
'Author: Pat Lee
'Date: 6/12/2008
 
'Clear all scheduled tasks defined by this script
schtasks /delete /tn "DirtyBit Task" /f
schtasks /delete /tn "Restart Task" /f
schtasks /delete /tn "Defrag Task" /f
 
'Set scheduled tasks to set chkdsk, restart and defrag
schtasks /create /ru "SYSTEM" /sc WEEKLY /d SUN /TN "DirtyBit Task" /tr "c:\windows\system32\fsutil.exe dirty set c:" /st 00:45:00 /sd "01/01/2008"
schtasks /create /ru "SYSTEM" /sc WEEKLY /d SUN /TN "Restart Task" /tr "c:\windows\system32\shutdown.exe -r -t 60" /st 01:00:00 /sd "01/01/2008"
schtasks /create /ru "SYSTEM" /sc WEEKLY /d SUN /TN "Defrag Task" /tr "c:\windows\system32\defrag.exe c:" /st 02:00:00 /sd "01/01/2008"

Open in new window

0
 
zboxAuthor Commented:
Paka thanks a lot for your time and hard work.  I really appreciate what you guys do on this site, thats why im already telling people about it!

But I have to be honest.  My job just gave me until tomorrow morning to present this idea.  For reasons I don't want to go into, I don't have access to Win Server2003 right now.  As much as I would like to try your idea Paka, I thought I had more time.  

But if you can help me with this, I found this script that I've already familiarized myself with and actually got to work.  I just need one thing, I need this script to include running Disk Cleanup.  It does CHKDSK then it does DEFRAG, but if you can get it to run disk cleanup and I test it at home and make a powerpoint by tomorrow of something that works, I might have to buy you all dinner. lol

anyways, Paka, again I don't want to ignore your code I know you spent time to write, but I dont have time to test that anymore.  =/

Here is the code that I'm using, (found it through EE KB), and I just need it to include an Automated Disk Cleanup step, perferably before defrag.


*************************************************************************************
REM chkdsk and defrag automation
for /F "eol= tokens=1 delims=( " %%i in (DrvLtr.txt) do set DrvLtr=%%i& call :dsKchk
 
:dsKchk
If %DrvLtr% == end goto :eof
chkdsk %DrvLtr%
If not errorlevel 3 goto :defrag
If not exist %DrvLtr%\winnt If not exist %DrvLtr%\windows If not exist %DrvLtr%\pagefile.sys goto :dskchkon
 
:dskchkoff
cd\
%DrvLtr%
echo Y chkdsk /F /R
goto :defrag
 
:dskchkon
chkdsk %DrvLtr% /F /R
 
:defrag
cd\
%DrvLtr%
defrag %DrvLtr% -b
defrag %DrvLtr%
:EOF
********************************************************************************
0
 
PakaCommented:
What do you want Disk Cleanup to clean?  You have these options:

Temporary Internet Files
Temporary Setup Files
Downloaded Program Files
Old Chkdsk Files
Recycle Bin
Temporary Files
Temporary Offline Files
Offline Files
Compress Old Files
Catalog Files for the Content Indexer

Getting this one to run is a bit more complicated but do-able.  It might take a dinner and a beer from Bennigan's to coax this one out of me ;)
0
 
zboxAuthor Commented:
cleaning all of that is fine.

Is there one missing though?  "Outlook Setup Files"

I DO NOT want "Outlook Setup Files" to be deleted.  that can stay right where it is.  (you probally predicted that and left it out on purpose.)

So yes all of these are fine and im just repeating your list:

Temporary Internet Files
Temporary Setup Files
Downloaded Program Files
Old Chkdsk Files
Recycle Bin
Temporary Files
Temporary Offline Files
Offline Files
Compress Old Files
Catalog Files for the Content Indexer

Paka, Bennigan's it is!  lol

Thanks for fast responses.  I'll check back ASAP.

zbox
0
 
PakaCommented:
I'm going to have to call it a night.  The wife said enough Expert's Exchange.  Here's the link to get the last part to get your script going:
http://www.ss64.com/nt/cleanmgr.html

After you create the registry settings for what you want cleaned and exported them to a file named "cleanmgr.reg" use the attached script:
*************************************************************************************
REM chkdsk and defrag automation
for /F "eol= tokens=1 delims=( " %%i in (DrvLtr.txt) do set DrvLtr=%%i& call :dsKchk
 
:dsKchk
If %DrvLtr% == end goto :eof
chkdsk %DrvLtr%
If not errorlevel 3 goto :defrag
If not exist %DrvLtr%\winnt If not exist %DrvLtr%\windows If not exist %DrvLtr%\pagefile.sys goto :dskchkon
 
:dskchkoff
cd\
%DrvLtr%
echo Y chkdsk /F /R
goto :defrag
 
:dskchkon
chkdsk %DrvLtr% /F /R
 
:defrag
cd\
%DrvLtr%
defrag %DrvLtr% -b
defrag %DrvLtr%
 
:dskClean
REGEDIT /S cleanmgr.reg 
CLEANMGR /sagerun:64
 
:EOF
********************************************************************************

Open in new window

0
 
zboxAuthor Commented:
I think I'm confused and very tired at that.  I'll do my best to put the pieces together.
0
 
zboxAuthor Commented:
WOOOO!  Paka, you really stuck in there.  I don't know what they pay you guys but its not enough I'm sure.  Thanks again Paka and EE!

satisfied customer,

zbox
0
 
PakaCommented:
To get your cleanmgr to work without user input, you will have to create a registry import file (for instance cleanmgr.reg).  To setup the registry import file, open a command prompt and type:
cleanmgr /sageset:64 (64 could be any number 0-65000).  After you run it and select the items you want cleaned and exit.  (For our example we will clean Recycle Bin - so only check Recycle Bin.)   Now open regedit and open:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin

You should see a key named "StateFlags0064" with a value of 2.  This means you want that particular item cleaned; all of the other items should have a "StateFlag0064" set to 0.  You will need to export all of these items (or use the cleanmgr.reg file from the link above) and set each item you want cleaned to 2 and those items you don't want cleaned to 0.  Save this file as "cleanmgr.reg".  Next type "regedit /s cleanmgr.reg" from a command prompt to load this set of "StateFlags0064" into the local registry.

Last, run cleanmgr /sagerun:64 to run cleanmgr with the items you selected using the process above.

You should be able to figure out the batch file above after that...

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 8
  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now