Koozali.org: home of the SME Server

problems with "if" command in Netlogon.bat

problems with "if" command in Netlogon.bat
« on: April 05, 2008, 04:57:59 AM »
I'm very new to Linux and networking in general. I have spent 5 hrs going through this forum trying to find a solution to my problem, with no success. I'm hoping someone out there will be able to point me in the right direction.

I have set up 3 I bays (Staff, Business, Trust) and linked these with groups (Instructors, Management, trustees. Various users have access to various files on various ibays

My problem is when the netlogon.bat is executed it halts on loading an ibay if the user doesn't have permission. It waits for a password and user ID if the user doesn't belong to all three groups.
I have tried using the "if" command but I can't get the syntax right. From reading posts I have tried

if group=instructors
net use G: \\sarinz-1\staff /persistent:no
end if

this didn't appare to work and have tried #ifg, ifg, if -g.

can someone give me an answere on how to test if a particular user belongs to a group and then load the relevant Ibay it would be much appreciated.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: problems with "if" command in Netlogon.bat
« Reply #1 on: April 05, 2008, 08:09:53 AM »
Allan Pritchard

You need to install the loginscript contrib to alter your netlogon.bat file the way you are proposing.

Are you workstations members of a domain ?
...

Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Re: problems with "if" command in Netlogon.bat
« Reply #2 on: April 05, 2008, 12:03:20 PM »
Ray
what does the login contrib do that you can't do just by editing by hand
I'm not asking you to do it but it would be nice it there was a wiki page explaining what it does

Re: problems with "if" command in Netlogon.bat
« Reply #3 on: April 05, 2008, 12:17:54 PM »
The workstations are all windows xp setup in domains but not roaming profiles.

I'll try installing the login scripts contribs, although I'm not sure exactly how to do that, but now I have a peice of the puzzel to start with

Cheers
Allan

Offline raem

  • *
  • 3,972
  • +4/-0
Re: problems with "if" command in Netlogon.bat
« Reply #4 on: April 05, 2008, 12:44:44 PM »
Allan Pritchard

download from here
http://ftp.nluug.nl/os/Linux/distr/smeserver/contribs/jbennett/sme7/loginscript/RPM/smeserver-loginscript-0.2-8.noarch.rpm

yum localinstall smeserver-loginscript*.rpm
 
It adds a panel to server manager which is fairly self explanatpory.

It sounds like you have read some threads that refer to
#ifg commands etc

You can specify different login scripts for groups or users etc etc.

See
http://forums.contribs.org/index.php?topic=39797.0

« Last Edit: April 05, 2008, 12:54:52 PM by RayMitchell »
...

Re: problems with "if" command in Netlogon.bat
« Reply #5 on: April 06, 2008, 12:44:39 AM »
Thanks Ray

Worked great.

Took me a while to work out the "wget" function to be able to download and install it. They say self discover is the best learning.  :D - I have so much to learn.

Another question which maybe just basic Lunix, of which I should go buy a book, is if I download a contrib using my browser and save it to an Ibay \\sarinz-1\sarinz\network_admin\contribs\[file] how do i specify a path when using yum localinstall [path]/[file].rpm

Even if you point me to a good Linux site to learn a bit more about the shell enviroment would be great
Cheers

Offline raem

  • *
  • 3,972
  • +4/-0
Re: problems with "if" command in Netlogon.bat
« Reply #6 on: April 06, 2008, 01:19:19 AM »
Allan Pritchard

You're doing great.

You'll learn that stuff, just keep reading & trying, practical learning is the best.

Ibays are located on the server in
/home/e-smith/files/ibays/ibayname

Depending where you put the file ie if downloaded to a web enabled ibay, then it will be in
/home/e-smith/files/ibays/ibayname/html

If it's a samba share in Windows (and not a web enabled ibay), then it will be in
/home/e-smith/files/ibays/ibayname/files
...

Re: problems with "if" command in Netlogon.bat
« Reply #7 on: April 06, 2008, 03:01:14 AM »
Ray

Thanks for all of that, I'm away laughing now.
Domains all going, backups all working, users all loging in.

Thanks
Allan Pritchard