![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Microsoft windows 2003 error all error and bugs related to microsoft windows 2003 error |
![]() |
|
Need login script to map a share to the users login name
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Administrator
Posts: 18,720
Join Date: Jan 2006
Rep Power: 10
IM:
|
I want to write a single login script that will auto map U: to each users own folder. The shared folder matches each users AD name exactly. EG. john doe has \\servername\john doe, jow bloggs has \\servername\joe bloggs etc.. I've tried using a BAT file with: Net use U: \\servername\joe bloggs, but BAT files do not like spaces, so unless I go through and rename all shares, it won't work. I want to avoid seeting the home folder in AD!! |
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Administrator
Posts: 18,720
Join Date: Jan 2006
Rep Power: 10
IM:
|
-------------8<------------------- @echo off for /f "tokens=1" %%a in (users.txt) do ( md x:\users\%%a cacls %%a /t /c /g "domain admins":f cacls %%a /e /t /c /g system:f cacls %%a /e /t /c /g %%a:f net share %%a$=x:\users\%%a ) -------------8<-------------------- The above script (what is between the lines) is a batch file - save it as another text file ending in .cmd or .bat - then run it and it should create all the user folders using all the user names in users.txt - then modify the permissions on each one to allow domain admins, the system account, and the user account full access. Finally, it should share the folder. And just in case it wasn't clear, this script needs to be run on the server. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|