Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: network share mapping login script  (Read 37954 times)

0 Members and 1 Guest are viewing this topic.

ldslourdes

  • Guest
network share mapping login script
« on: August 07, 2006, 09:50:49 AM »
[size=12]I need help with a script.

I have created three groups (accounting, finance, sales) and directories (accounting, finance, sales) in which i made the groups the group owner of the directory with the their same name.

I also have created several users and i have added the users to the groups,
but one of those users is a member in two groups(accounting, sales).

I have to have the user map their group folder upon login as well as their home folder, public folder and an mp3file folder using the drive letters "w:, x:, y:, z:", but I need need to modifiy the script for this case; the case of having this user in two or more groups.

I think the user won't be able to map both those directories with the same drive letter.

I need help making the script map the second, third, fourth..... groups with the next available drive letter.

How can i do this.

This is what I have so far:

echo Setting the Time on the PDC...

\\servername /set /yes

echo Mapping Network Drives on Samba Servername Server...

net use w: \\servername\home\%username%
net use x: \\servername\companyname\public
net use y: \\servername\companyname\%groupname%
net use z: \\servername\companyname\mp3files


in addition, can you tell me if "%groupname%" is the appropriate syntax to indicate the groupname.

A prompt answer is greatly appreciated.

Thanks. ;)[/size]
[/b]
« Last Edit: August 07, 2006, 12:34:36 PM by ldslourdes »

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re:  network share mapping login script
« Reply #1 on: August 07, 2006, 12:20:21 PM »
I strongly recommend you edit your email address out of that post.

How about an alternative approach?  Use this directory structure (e.g.):

/
--/home
  --/departments
    --/accounting
    --/finance
    --/sales
Map Y: to a Samba share pointing to /home/departments.  Users will then see accounting, finance and sales subfolders, but will only be able to access the folders to which they have group access.
« Last Edit: August 07, 2006, 12:20:42 PM by robpomeroy »
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

ldslourdes

  • Guest
Re:  network share mapping login script
« Reply #2 on: August 07, 2006, 12:35:23 PM »
thanks soooooo much!! ;D

The thing is that this is a class final exam and the instructor may not accept that structure.

in the final exam lab paper the professor wrote the following:

drive mappings must be performed by a login script for all users. their home directory, the public folder, and their department's folder must be mapped to the x, y and z respectively when they log to the xp computer

example: jdamien should see the following when he double click "My Computer"

his "home" directory mapped to the "w" drive.
the "Public" directory is mapped to the "x" drive.
the "finance" directory mapped to the "y" drive.
the mp3files directory mapped to the "z" drive.


the structure is as follows:
\\Servername  
       |---/acmewidgets
                  |---/accounting
                  |---/confidential
                  |---/finance
                  |---/publicfiles
                  |             |---/applications
                  |             |---/games
                  |             |---/sickdayforms
                  |             |---/vacationforms
                  |---/sales
                  |---/mp3files

I had your suggestion in mind but i can't ask him any questions regarding this exam and I would greatly appreciate it if i had the approach where the user's goup folders would be mapped instead of the department.

In addition. can you tell me if the "%groupname%" syntax is the appropriate syntax to indicate the groupname?

Thanks, ;)
« Last Edit: August 07, 2006, 02:09:39 PM by ldslourdes »

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re:  network share mapping login script
« Reply #3 on: August 07, 2006, 03:12:30 PM »
I'm sorry about this, but I have a pathological dislike of providing answers to homework/exam questions.  So the best I can do is provide pointers.  May I therefore make a strong recommendation?  Read the man page for smb.conf - in particular the bits about dynamic share mappings/net logon scripts.
 
Good luck.  ;)
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos