#59522 - 2001-10-02 10:07 PM
If member of then
|
Anonymous
Anonymous
Unregistered
|
I read somewhere that this program will allow me to do the following:When a user logs onto the NT server (users are all Win98) the login script will check if member of group A then run This, else continue with rest of script. Is that possible? If so how would I do that?
|
|
Top
|
|
|
|
#59523 - 2001-10-02 11:18 PM
Re: If member of then
|
Anonymous
Anonymous
Unregistered
|
code:
IF INGROUP("Domain Users") DISPLAY "z:\users.txt" ENDIF
For more information, look at the INGROUP function in the manual. However, if this is all you need to accomplish, you may just want to use IFMEMBER.EXE from the NT Resource kit. code:
IFMEMBER /v "Domain\Domain Admins" IF errorlevel 1 GOTO ADMIN
|
|
Top
|
|
|
|
#59524 - 2001-10-11 06:16 PM
Re: If member of then
|
Anonymous
Anonymous
Unregistered
|
I'm trying to roll out NAV corporate, and you can do that by running a login script. Problem is that we already run a script, and I don't want everyone to have the NAV client installed. Only company owned machines. I have created a group and added the users that should run the NAV script so I need something that will check the group membership, and if the user is a member of NAV run the install and/or update routine. If they are not a member it should just map the drives as usual.I hate to sound stupid, but I'm not sure if i need your software to do this or if I can use IFMEMBER from the resource kit.
|
|
Top
|
|
|
|
#59525 - 2001-10-12 08:40 PM
Re: If member of then
|
Anonymous
Anonymous
Unregistered
|
Yes, IFMEMBER will accomplish what you need.code:
::If user is in NAV Group, install NAV IFMEMBER /v "YourDomain\NAV Group" IF errorlevel 1 GOTO NAVUPDGOTO MAPDRVS :NAVUPD ::Install NAV :MAPDRVS ::Map Drives for all users
That should get you started. I highly recommend you pick up a book or do some reading on creating batch files if you are still confused.
|
|
Top
|
|
|
|
#59527 - 2001-10-13 08:45 AM
Re: If member of then
|
Jeroen
Starting to like KiXtart
Registered: 2001-08-16
Posts: 180
Loc: Netherlands
|
And what about these users logging on to non-company PC's? Maybe better to use @WKSTA to check if the PC is owned by the company... Kinda like:code:
$Company_PC_List = "Server\Share\Folder\List.txt" $x=Open(1,$Company_PC_List,2) $Computer = ReadLine(1) While $Computer <> "" If $Computer = @WKSTA ; Computer is company owned, so install NAV $x=Close(1) Goto NAV_Install Else ReadLine(1) Endif Loop Exit:NAV_Install ; Code to install NAV Exit
_________________________
Regards, Jeroen.
There are two ways to write error-free programs. Only the third one works.
|
|
Top
|
|
|
|
#59528 - 2001-10-13 08:46 AM
Re: If member of then
|
Jeroen
Starting to like KiXtart
Registered: 2001-08-16
Posts: 180
Loc: Netherlands
|
Oh, between Loop and Exit, there should also be a $x=Close(1)...
_________________________
Regards, Jeroen.
There are two ways to write error-free programs. Only the third one works.
|
|
Top
|
|
|
|
#59529 - 2001-10-13 06:14 PM
Re: If member of then
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
All points well taken... It really depends on your network and your level of control and admin workload vs laziness (Cheap & Dirty). On my LAN, I control what account is used for non-owned PCs so easier to add to grp NO_NAV. That one line is not the end-all. There are other checks as well. But then, we are creeping off topic.If you have a standardized WKS naming convention, a spin on Jeroen's concept could work with less effort. Instead of managing a computer list manually, just search for a common substring within the WKS name. If you want to do an elegant quasi-SMS software deployment instead of C&D, you could setup an INI file to hold all WKS related config and manipulate that INI file. Sealeopard has an excellent example of that in his post: HOW-TO: Running scripts with ADMIN powers Amantica, I sense you're still at the baby-steps phase of deployment. It may be time well spent to study Sealeopard's implementation for consideration in your setting before building a legacy of haphazard scripts as I have.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.
|
|
Top
|
|
|
|
#59530 - 2001-10-14 10:05 AM
Re: If member of then
|
Jeroen
Starting to like KiXtart
Registered: 2001-08-16
Posts: 180
Loc: Netherlands
|
Hi Les,I've thought of the name check too, but I'd prefer my method because: Say your company's naming convention is to name all laptop computers MOB0000 through MOB9999 (MOB being Mobile). You could check if the computer logging on has MOB in it's computername or something, but chances are that people bringing in their own W9x laptop (e.g. Contractors etc) could also be using a computername with MOB in it. You would have to narrow down the check for the computername to f.e. a fixed length or something. And now straying off-topic: Say you did build a precise check if the computername is MOBxxxx: If you would also like to prevent privately owned or other outside laptops (with possible viruses, or who knows what on them) from logging on to the network, this check would prevent a lot, but the 'smart users' will be able to read the logon script, and change their computername to fit that of an 'allowed' PC. (people who would like to get a free copy of licensed software that you roll out using the logon script could use this method.) I know, it's a long shot, but eversince we had 1 user who figured out a password by reading the logon scripts, we always assume the worst. They say 'assumption is the mother of all f*ck-ups'. Using a static file prevents most. Users with a private laptop or contractors etc could still use a computername of a PC of a person who is currently on holiday or something, but it would be a lot harder for them to do so. Hold on: My paranoide self is taking control; I'll stop this reply before I say you should shut down all servers to prevent unauthorised use !!
_________________________
Regards, Jeroen.
There are two ways to write error-free programs. Only the third one works.
|
|
Top
|
|
|
|
#59533 - 2001-10-17 12:01 AM
Re: If member of then
|
Anonymous
Anonymous
Unregistered
|
And while were on the subject, for NAV, you dont need the .bat files it uses to install. This is what I do in the script to install NAV.
code:
USE X: "\\NAVSERVER\VPLOGON" ? "Mapping X: Status=" + @SERROR SHELL "X:\VP_LOG32 /p=X:" ? "Checking for new version. Result=" + @SERROR
|
|
Top
|
|
|
|
#59534 - 2001-10-16 04:44 PM
Re: If member of then
|
Anonymous
Anonymous
Unregistered
|
Thanks for all the great advice. I've got another stupid question...Most of the sites I've been to say that IFMEMBER only works with NT Workstations. Is that so? All of our workstations are Win98
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1058 anonymous users online.
|
|
|