[Last Call] Learn how to a build a cloud-first strategyRegister Now

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

Defrag via Group Policy in Server 2008

I'm learning Server 2008 as I go here and I've run into a bit of a bump with scheduling a Defrag. I've got scripts and things that would allow me to Defrag with alternate methods... but I'd like to understand why the following isn't working...

Start inside of a 2008 GPO: Computer or User Configuration > Preferences > Control Panel Settings > Scheduled Tasks

My thought is that this would be a really easy place to set up "%systemroot%\system32\defrag.exe c:" to run under a Domain Admin account who has also been given "run as a batch job" permissions.

After I "GPUpdate /force" a XP SP3 workstation, I see the task has been created (only when I log in as a local admin do I see the task... that normal?). At any rate, clicking Run doesn't work. After the scheduled task attempts to run at the desired time, I get a "Could Not Start" error 0x0.

If I go into %systemroot%\schedlgu.txt, I see the following error:

"Defrag C.job" () 4/15/2009 2:36:06 PM ** ERROR **
      Unable to start task.
      The specific error is:
      0x80070005: Access is denied.
      Try using the Task page Browse button to locate the application.

I decide to try out the task under the domain\administrator account without any change.

I figure that it's a permissions issue but attempt the following anyway:

I tried enclosing the text of the tasks command in quotes "%systemroot%\system32\defrag.exe c:"... nothing.

I try changing the text of the task from %systemroot% to C:\windows\... nothing.

The password is not blank for any of the accounts I was trying to run this under.

So... here I am... confused. Anyone dealt with this area in 2008 GPO's yet?
0
bkrontz
Asked:
bkrontz
  • 4
  • 3
1 Solution
 
bkrontzAuthor Commented:
Thank you for the reply. I appreciate the links to other solutions, but I'm really just trying to figure out why this specific instance isn't working as advertised. I have scripts that will defrag, but this seems like a way to get rid of scripts and control things via Group Policy... which should work, no?
0
 
Darius GhassemCommented:
No, you must run the scripts to run through GPO. I wish we could run a defrag without scripts but that still isn't available.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
bkrontzAuthor Commented:
While you might be right, I don't understand why this wouldn't work. It creates the task as advertised... it tries to run as advertised... but there's a permission issue somewhere that shouldn't be a show stopper, imho.
0
 
Darius GhassemCommented:
The defrag.exe doesn't have permission to run as a service without certain parameters that is why you need a script.
0
 
bkrontzAuthor Commented:
Thanks for helping out! What a bummer... had my hopes up.
0
 
bkrontzAuthor Commented:
Thanks again!
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now