Ryan Bennett
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\PUB LIC\BATCHF ILES\BATCH FILE.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
example...
IF %MACHINE != "MARKETING-001" THEN BEGIN
#\\XXX.XXX.XXX.XXX\SYS\PUB
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
I use Groups to do this.
Add the users to the specific groups.
on your #\\xxx.xxx.xxx.xxx\sys\pub lic\batchf iles\batch file.bat I usually use this syntax
#Command /c \\xxx.xxx.xxx.xxx\sys\publ ic\batchfi les\batchf ile.bat
IF MEMBER of "Marketing" THEN
#Command /c \\xxx.xxx.xxx.xxx\sys\publ ic\batchfi les\batchf ile.bat
ELSE IF MEMBER of "SALES" THEN
#Command /c \\xxx.xxx.xxx.xxx\sys\publ ic\batchfi les\batchf ile.bat
ELSE IF MEMBER of "Manufacturing" THEN
#Command /c \\xxx.xxx.xxx.xxx\sys\publ ic\batchfi les\batchf ile.bat
END
Add the users to the specific groups.
on your #\\xxx.xxx.xxx.xxx\sys\pub
#Command /c \\xxx.xxx.xxx.xxx\sys\publ
IF MEMBER of "Marketing" THEN
#Command /c \\xxx.xxx.xxx.xxx\sys\publ
ELSE IF MEMBER of "SALES" THEN
#Command /c \\xxx.xxx.xxx.xxx\sys\publ
ELSE IF MEMBER of "Manufacturing" THEN
#Command /c \\xxx.xxx.xxx.xxx\sys\publ
END
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
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...
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?
%COMPUTERNAME is the variable that you are looking for and yes, you can run commands from a login script utilizing it.
-Mojo
-Mojo
ASKER
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
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
Thanks,
I'll give it a try!
-RBennett
I'll give it a try!
-RBennett
ASKER
That's the one! Everything (and then some) that I needed to know.
Thanks,
RBennett
Thanks,
RBennett
Do you have ZENworks?