Download the
Windows Server 2003 Resource Kit Tools and install it on any of your workstations.
If you use the default installation options, you will now have
c:\Program Files\Windows Resource Kits\Tools\ifmember.exe that (on a windows network, anyway!) will test for group membership and can be used in batch files like this:
Re: Login Script group membership - Richard Mueller [MVP]
28-Jun-07 01:27:48
This link explains how to use IfMember:
http://www.microsoft.com/technet/archive/winntas/tips/winntmag/grlogon.mspx?mfr=true
The utility returns errorlevel 1 if the user is a member of the group (or
groups, you can list several). You need to use GoTo statements. For example:
IfMember TestGroup1
if not errorlevel 1 goto step2
rem following 2 mappings done only if user member of TestGroup1.
net use K: "\\servername\groups"
net use P: "\\servername\Apps"
step2:
IfMember "domain admins"
if not errorlevel 1 goto step3
rem drive I: is mapped only if member of "Domain Admins".
net use I: "\\servername\it
step3:
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
You can find out if
ifmember will work for you on a SME domain by running
ifmember /l. If any of your SME groups are listed in the output, you're all set.
As for the "home" drive - you can easily map a drive to any location that includes the logon user name using:
net use \\oak\%username%
%username% will be expanded to the current user's name during (or after) login. However, to make this a user's "home" drive, you need to set this as the home drive in the account properties on the server (easy on Windows, I-dont-know-how on SME)
So, maybe something like this:[list=a]
- download and install rktools on one system
- copy ifmember.exe to \\smeserver\netlogon
- add these lines to your login script:
\\smeserver\netlogon\ifmember "SMEDomain\it"
if errorlevel 1 net use y: \\oak\it
\\smeserver\netlogon\ifmember "SMEDomain\accounting"
if errorlevel 1 net use y: \\oak\accounting
net use h: \\oak\%username%
[/list:o]
This, of course, will give you trouble if anyone is a member of two groups... I usually use a different drive letter for each group...
Permissions are not set in the login script -- what permissions do you need to set, and is your freebsd box a member of your samba domain?