Page 1 of 1 1
Topic Options
#59522 - 2001-10-02 10:07 PM If member of then
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
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
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
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 NAVUPD

GOTO 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
#59526 - 2001-10-12 09:06 PM Re: If member of then
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
To clarify, IFMEMBER if running a batch file, INGROUP if running KiX. For my NAV, I use reverse logic in KiX.

IF INGROUP("NO_NAV") goto finish ENDIF

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#59527 - 2001-10-13 08:45 AM Re: If member of then
Jeroen Offline
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 Offline
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 Offline
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 Offline
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
#59531 - 2001-10-14 06:16 PM Re: If member of then
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Jeroen,
You make some very valid points. When it comes to virus protection software however, I would prefer to rule by exception. Better to have an unintentional install than to miss one because someone overlooked adding the PC to the static list. I have techs shuffling computers around all the time. Mind you, my ghosted images are pre-loaded with NAV anyway, so the script is only a belt for the suspenders.

My office looks like 'mission control' with multiple computers and monitors, network sniffers, NMS, SMS, etc. No machine connects to my network without me knowing about it.

Didn't someone say that "paranoia is reality on a finer scale" (Movie - Strange Days)?

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#59532 - 2001-10-16 05:54 AM Re: If member of then
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Our advice (see our input on many virus discussions).

Our organization doesn't accept any PC without an actual virus scanner
on the network.
When we hired personal they had to confirm f.e. our virus and security
policies. Mostly such persons have an additional PC with network
connection. During their project they are a "member" of our company
and they also use our company-wide license of such software.
Another reason we give them another PC is: their organization can't
blame our organization for infecting their organization with a virus.
Greetings.


btw: another element you can use are the IP numbers. For roaming users
we have reserved a specific range of IP numbers and by a logging on
session those machine will be checked for the actual configuration
(f.e. is virus activated and has it an actual update).

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#59533 - 2001-10-17 12:01 AM Re: If member of then
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
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
#59535 - 2001-10-16 08:20 PM Re: If member of then
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
IfMember will work on Wintendo (9x/ME) provided you have KXRPC running on your DCs. If NetWare is involved, you also need to massage provider order.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.053 seconds in which 0.012 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org