Jump to content
Sign in to follow this  
ICANSEEYOU7687

Some noob questions!

Recommended Posts

ICANSEEYOU7687

Sorry if these seem really dumb, I havent used autoit in a while and my programming is a little rusty.

I have a script in mind that I want to try, and it is mainly going to require waters AD scripts. One of the first things that I need to do, is create a folder on a network drive as a different users. I am going to make a service account hard coded into the script that is used for some initial folder and file creation depending on the user that does this.

Is it possible to create a networked share as a different user? I feel like you might be able to do this with command prompt but I have no idea XD

Also on a similar note, can I add AD domain accounts as permissions on a network folder from another account? Once again I will use that service account I create in AD (which will have permissions on the root folder). Once the script creates the folder, it will then add the users account to the folder permissions list.

I hope this wasnt to confusing, but everyone here is always so helpful! Thanks for looking!

-Wesley

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, ICANSEEYOU7687. The answer to both of your questions is yes, you can create a network share and add permission as your service account, as long as said service account has permissions to do so.

As an example, I dug up an old script I use to give Helpdesk folks for granting permissions on network folders. You should be able to tweak this to work with your service account:

$UID = InputBox("Grant Access", "Enter the user ID")
$dir = InputBox("Directory", "UNC path to parent directory")
$perm = InputBox("Level of Access", "Enter the level of Access: C(hange), F(ull control), R(ead only), W(rite)")

While 1
  $dir2 = FileSelectFolder("Choose a folder.", $dir, 1)
        RunWait( 'CACLS "' & $dir2 & '" /E /G ' & $UID & ':' & $perm, "", @SW_HIDE )
        $ok = MsgBox(4, "Complete", "Would you like to specify another directory?")
            If $ok = 7 Then ExitLoop
 WEnd

MsgBox(0, "Access Granted", "Access has been granted to the specified directories.")

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

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  

×