Jump to content

Allow domain users to run Defrag as an Admin


mikeistheman
 Share

Recommended Posts

Hello All,

Here is a simple (AutoIt version 3) script used to allow domain users to run Disk Defragmenter assuming all local administrator accounts have the same password on all computers.

You will then need to change the shortcut of the defrag program to point to the new .exe file you just created. The domain users will then have the ability of running defrag all by themselves.

Enjoy!

-----------------------------------------------------------------------------------------------------------------------------

; Declare all variables used

Dim $Username, $Password

; Initialization of the variables

$Username = "Administrator"

$Password = "yourlocaladministratorpassword"

; Set the RunAs parameters to use local adminstrator account

RunAsSet($Username, @Computername, $Password)

Run("mmc Dfrg.msc", @SystemDir)

-----------------------------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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