[Samba] netlogin scripts

Patrick DUBAU patrick.dubau at alsace.iufm.fr
Wed Dec 1 15:44:06 GMT 2004


Hamish a écrit :

>
>>
>> isn't that easier with the commands that are already with Windows?
>>
>> net use X: \\server\share /user:username\domainname password-in-plain
>>
>>
>> Tomek
>>
> A lot easier, but I could not find a way to check group membership, 
> get the current user name or modify registry settings with the 
> available windows tools, kixtart does it all. And its free.

hi,

here the script i use to test membership and user name :

ifmember.exe DOME\superviseur
IF errorlevel 1 (
   net use u: \\FS2\tout
)
ifmember.exe DOME\compta
if errorlevel 1 (
  net use u: \\FS2\compta
)
ifmember.exe DOME\prothee
if errorlevel 1 (
   net use q: \\FS2\prothee
)
ifmember.exe DOME\personnel
if errorlevel 1 (
   net use u: \\FS2\personnel
   if %username% == hd (
      net use k: \\FS2\netlogon
   )
ifmember.exe DOME\juridique
if errorlevel 1 (
   net use u: \\FS2\juridique
   )
)

- tested on win XP without any problem
- doesn't work on win 9x
- ifmember.exe can be donwloaed at 
http://www.microsoft.com/windows2000/techinfo/reskit/tools/new/ifmember-o.asp
- you must use exactly the syntax as above!




More information about the samba mailing list