Jump to content

inventory/startup script for use on a domain

Recommended Posts

Just took up a internship as an IT intern and they dont give me sh!t to do so I just screw around with autoIT all day. My friend gave me the idea and pointed me in the right direction for making a script that logs a certain set of data about a client computer and writes it to a network share. He used a combination of autoIT and kixtart. I merged the two into one and made the runasset command function without creating a second exe. I also spent some time enumerating certain specs for a computer.

I set it up to log a new logfile to the network share every week.

It works like this...

I use a batch file for the login script and this calls the start.exe program.

The start.exe program starts itself once then restarts itself with the runasset command, this time it has certain rights that allow it to write to the network drive and to create a folder on the local computer that cant be accessed by DomainUsers. This script runs a bunch of loops and such and logs a good deal of info about the computer locally. Then the file is copied to the network share where it can be either just archived or perhaps put into a database that can be queried at will.

I have weeded out most of the bugs with it... the hardest part of seetting it up is setting up the permissions on the share so that the one user group has full access and the DomainUsers only have read/execute access.

I also made it extremely easy for another person on a different network to use. Aside from permissions in active directory there are only 6 Gloabl Vars that need to be assigned; $logdir $logname $servpath $UserName $Password $FullDomainName

There is also traytips that appear that helped me greatly with the debugging process and I havent taken them out cause I think they are perty.

I attached both the .au3 and I attached a sample log file

Edit: version 1.1 attached



Edited by Wus
Link to post
Share on other sites

very nice. Thanks!



__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to post
Share on other sites

oops ... made a slight error when i made it...

in the part where i deleted the log if it wasnt on both the server and the pc I had it delete a nonexistand file...

should look like this:

FileDelete($servpath & @ComputerName & "\" & $logname)

not this:

FileDelete($servpath & $logname)

itll still work but itll work better this way

ill update the dload link with the updated script as well

ill call the first version 1.0 and this version 1.1 ... hope you can handle my originality :(

I also have a question closely related to this script so ill ask it here and hopefully wont get flamed for em...

If I use a run() or runwait() in a script that was run with runasset() will that run command be honored with the same priviliges as the exe file is?

i.e.: use script A to run B with privilages, then script B uses run() to run script C...

will C be run as the runasset user? or will the user reset...

Edited by Wus
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...