Link to home
Start Free TrialLog in
Avatar of maliks121
maliks121Flag for United States of America

asked on

Create a folder on first login with Ownership rights (Not Home Directory)

Hi,
I need to create folders for almost 2000 users where they can archive their emails. Other users should not be able to see each other's folders(Just like user drive) Need to assign full rights on that folder. Task is to also map it on users' first login.

net use t: /delete
net use t: \\servername\sharedfolder\%Username%(With Full rights on the folder)

Note: I cannot use Home Directory/User drive. We are using Windows 2012 R2, client machines are all Windows 7.

Any suggestions or script will help....
Avatar of Davis McCarn
Davis McCarn
Flag of United States of America image

MD T:\Mail-Archive after your net use and as part of a login script.
this won't map a drive
net use t: \\servername\sharedfolder\%Username%
so I assume you mean
net use t: \\servername\%Username%
As such I also assume you want user, let's say Bob, to have a folder created on the server when the user Bob first signs on? If so then user cannot create a folder on a server, share it, and assign permissions to it--this user could do this to their local drive but not on the server itself. You could however use GPO to run a script "when user first logs on" to create a scheduled task on the server and then have that do the required work or we could create a small batch file that you can run each time you create a new user that would run this task for you automatically.
Avatar of maliks121

ASKER

So you are suggesting to map the drive with "net use", then create a GPO for "When User First Logs On"  and use script to assign permissions on the folder.
Sounds good to me!
Do you have any KB i can follow or script that I can use for scripting
Create an MS-DOS bat file with the net use and MD (MakeDirectory) commands and the push it using GPO.  The creator will be the default owner.
ASKER CERTIFIED SOLUTION
Avatar of Lionel MM
Lionel MM
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
NVIT -- I agree with you -- I TOTALLY FORGOT that he needed this for 2000 users -- I was going on the premise of needing to do this for NEW users. However if they want to do this for all users, existing users then you approach for getting that list of users is much better --thanks for catching that.
have you tried, tested the suggested solution yet?
This is what was asked for and this was an added help so both should get awarded points; so I suggest 300 and 200