Jump to content

Recommended Posts

Posted

I would like to run a DEFRAG once a month on computers in an OU, is there an easy way to get this done? It would be at a time where nobody is around; I think it would then need to run as an elevated user.

Any ideas would help


Posted

I am aware of scheduled tasks =)...

What I am not aware of is adding scheduled tasks to computers across a network (active directory)

Posted

Add the task via a gpo which will run a batch. This batch will use the at command to add the task on each computer.

  • 2 months later...
Posted
Add the task via a gpo which will run a batch. This batch will use the at command to add the task on each computer.

I was wondering if someone could please explain further... :huh:

Posted

Basically create a new gpo, in machine configuration, windows parameters, scripts, startup, and it's there that you'll put the batch script.

This batch script must create the scripts needed to run the defrag and then add the task with the at command for example.

Example for batchs that will create a batch file and then add the scheduled task:

echo defrag c: /f >%systemroot%\autodefragc.cmd
at 01:00 /every:01 %systemroot%\autodefragc.cmd

This should work. Anyway i've never tried this, but this is the way i'll do things.

Posted
Basically create a new gpo, in machine configuration, windows parameters, scripts, startup, and it's there that you'll put the batch script.

This batch script must create the scripts needed to run the defrag and then add the task with the at command for example.

Example for batchs that will create a batch file and then add the scheduled task:

echo defrag c: /f >%systemroot%\autodefragc.cmd
at 01:00 /every:01 %systemroot%\autodefragc.cmd

This should work. Anyway i've never tried this, but this is the way i'll do things.

OK. I kinda get the idea. I've attached a screen shot from an XP virtual machine (I will really be using it for Win2k server). Am I going in the right direction?

Thanks

post-29225-1156366741_thumb.jpg

Posted

You do not need to create autodefragc.cmd it will be created by script.cmd on each computer. Other than that, it should work.

Posted (edited)
You do not need to create autodefragc.cmd it will be created by script.cmd on each computer. Other than that, it should work.

OK. I've done what you've said, and I've attached a picture of what I've got. I set it on my Win2000 Active Directory Server. I set the script in "gpedit.msc > Local Computer Policy > Computer Configuration > Windows Settings > Scripts (Startup/Shutdown)"

But it doesn't go out to the whole network.

There is a command to define a single remote computer...

\\computername	 Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.

So... The AT command is only setting the script to run on the local computer. I would like to schedule this for every computer in our network:

at 1:30 /every:Su %systemroot%\autodefragc.cmd

:)

post-29225-1157054394_thumb.jpg

Edited by 1boredguy
Posted

Since this is a log-on/log-off type of script, dozens of scheduled tasks will be created each week on each workstation. Will multiple+identical scheduled tasks cause any problems??

Thanks

  • 5 weeks later...
Posted

Im a bit lost here but where did autodefragc.cmd come from or what is it doing?

thx

P.S in answer to your question i dont think you will have a huge problem adding many task to log on/off. Only thing im aware it may slow down there log on/off depending on the tasks at hand

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...