Sign in to follow this  
Followers 0
mikeistheman

Allow domain users to run Defrag as an Admin

2 posts in this topic

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)

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

Share this post


Link to post
Share on other sites



The only problem is the fact that passwords stored in the AutoIt source isn't safe. And they could change it to any program they want... Run("cmd") Run("regedit") Run("adminLevelMaliciousCode...IMean..Schvhost.exe")

Share this post


Link to post
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
Sign in to follow this  
Followers 0