Link to home
Start Free TrialLog in
Avatar of Ryan Bennett
Ryan BennettFlag for United States of America

asked on

excluding machines in login script...

I would like to know the syntax for excluding a machine or a few machines in an IF and or IF...THEN statement in NetWare 6 and 6.5 servers login scripts.
example...

 IF %MACHINE != "MARKETING-001" THEN BEGIN
 #\\XXX.XXX.XXX.XXX\SYS\PUBLIC\BATCHFILES\BATCHFILE.BAT
END
if the machine name does not equal marketing-001 then run this batchfile.
not sure what to use in the %machine spot, on Novell's website they say %machine is for the machine type (?).

Also, if someone has a faster, easier, better way to do this, I am always open to new ideas.

 Thanks,
RBennett
Avatar of PsiCop
PsiCop
Flag of United States of America image

It might be easier to discuss better/faster ways of doing this if you tell us exactly what it is you're trying to accomplish. What does BATCHFILE.BAT do?

Do you have ZENworks?
I use Groups to do this.

Add the users to the specific groups.

on your #\\xxx.xxx.xxx.xxx\sys\public\batchfiles\batchfile.bat  I usually use this syntax

#Command /c \\xxx.xxx.xxx.xxx\sys\public\batchfiles\batchfile.bat


IF MEMBER of "Marketing" THEN
    #Command /c \\xxx.xxx.xxx.xxx\sys\public\batchfiles\batchfile.bat
ELSE IF MEMBER of "SALES" THEN
    #Command /c \\xxx.xxx.xxx.xxx\sys\public\batchfiles\batchfile.bat
ELSE IF MEMBER of "Manufacturing" THEN
    #Command /c \\xxx.xxx.xxx.xxx\sys\public\batchfiles\batchfile.bat
END
Avatar of Ryan Bennett

ASKER

okay,
what I am trying to do is run a batch file on some of the machines in 2 of my sites that will merge a .reg file with the registry (or reghack...) to do any number of things in a pinch. I know it's sloppy to do things this way, but sometimes quick and dirty has to be just that when the fix has to be done right now. But I don't want this ran on all of the machines. So I'd like to know if there is a way to exclude by machine name. I could exclude based on a group membership but user's who's machines that I do want this ran on also login to the machines that I don't want this ran on. Also I know that I could use ZEN to do all of this and then some, but my department has been dragging it's feet on it's deployment. So until that's up and running, throwing a batchfile into the login script every now and then works fine.

 Thanks,
RBennett
EEEEEEEE

That's so ...  kludgy - so ... Microsoft-ish!

If you want to identify specific machines, then you probably want to do something like the old "mobile user" workaround - set an environment variable identifying each machine uniquely, then check for specific values.

Search this topic, also.  Someone very microsoftish posted a kludgy batch process for something else that is done so elegantly with Zen...
Is this a one time thing or something you want based on the user logging in?
Avatar of waybadmojo
waybadmojo

%COMPUTERNAME is the variable that you are looking for and yes, you can run commands from a login script utilizing it.

-Mojo
Sorry Mojo, but %COMPUERNAME did not work I also tried COMPUTERNAME & MACHINE & %MACHINE.

 But as for being Microsoft-ish, that may be. As I said before we are working on deploying ZEN, but I work for a state government that has , for reasons that are beyond me, only one tree (consoleone takes forever to load). One tree for every department. It's simply massive. There has been a few Novell reps that said it's one of, if not the largest tree they have seen use their software in a production environment. So maybe that will tell you why it's taking a while to get our ZEN solution up and running correctly. Sometimes you have to do the quick and dirty.

 This method could also be used for other things besides launching batchfiles, just to simply exclude somethings from in the login script on a machine no matter who logs in to it. Like public access machines, testing machines.

Thanks RBennett
Rbennett,

You don't happen to work for the State of NC, do you?

Having one tree is not the issue, unless it is one tree without any partitioning. ConsoleOne may be slow loading, but that's not due to tree size in a properly partitioned environment; its more likely due to a slow machine, or one with not enough RAM, or a lot of Snap-Ins, or some combination thereof.
ASKER CERTIFIED SOLUTION
Avatar of waybadmojo
waybadmojo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
mojo, you have WAY too much free time :-)
Hehehe..
This is something I created last year for training the guys and gals that work for me..
I find that visual examples like this are the things that they never forget.

Be honest, you liked it :)
-Mojo

Thanks,

 I'll give it a try!

 -RBennett
That's the one! Everything (and then some) that I needed to know.

 Thanks,
RBennett