Jump to content

Recommended Posts

Posted

Hello, is it possible to automatically create some folders for some group of users in Active Directory?

 

My idea:

1. user USERNAME will login on some client PC (PC is joined to domain which has two domain controllers: AD1, AD2)

2. specified directories will be automatically created on both domain controllers and connected as a network drives (e.g. \\AD1\private\USERNAME, \\AD2\public\USERNAME)

 

I know how to automatically map network drives but I don't know how to automatically create these directories (and set them some permissions).

Is it possible to do this automatically or I must to do it in manual way?

Posted

Yes you can:

 

write a batch file:

 

mkdir \\AD1\private\%username%
mkdir \\AD2\public\%username%

cacls /p %username%:RWCF

REM where R=read, W=write, C=change, F=Full control
REM for more info, type cacls /?

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

Tu peux aussi crire en franais.

Du kannst auch auf Deutsch schreiben.

Puoi scrivere anche in italiano.

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

Posted

Yes, this is dangerous.

 

You can write this batch file by passing it a username, you can run-it as administrator, not as the user.

 

Instead of using %username%, use %1.

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

Tu peux aussi crire en franais.

Du kannst auch auf Deutsch schreiben.

Puoi scrivere anche in italiano.

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

Posted
It is also dangerous, not so much but it is. And I don't think this will work. As I remember SMB protocol for network sharing works with username authenticated to share - not with username authenticated to local computer. It means when I authenticate to \\AD1\private as USERNAME, I will work with share as USERNAME all the time. Is there any server side solution like action "on user add"?
Posted

I don't think so, I used a VB script time ago which read a excel worksheet to retrieve usernames, and it worked fine.

 

There's not any event "On user add" but you can program a service which runs on your server and with a client you can add a user. Everytime you create a user, your program create the user and folders. But you need a program...

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

Tu peux aussi crire en franais.

Du kannst auch auf Deutsch schreiben.

Puoi scrivere anche in italiano.

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...