We've partnered with TechNet to bring you answers to technical questions from deep within Microsoft--direct from "Mole."

Answers from Deep Inside

We've partnered with TechNet to bring you answers to technical questions from deep within Microsoft--direct from "Mole."

The Mole

Did Mole just hear you mutter, “Who is this Mole, anyway?” In case you haven’t heard, Mole is the Phantom of the Burrow, the furry friend of network administrators everywhere, the creature who lives in subterranean Redmond beneath the Microsoft campus, and lives to dig up ingenious answers to questions about the intricacies of Microsoft products, particularly as they behave in conjunction with other Microsoft products. Mole is, in short, the IT Pro’s IT Pro. Note that he doesn’t claim near-omniscience because of his own high intelligence, so much as because he’s a kind of genius at knowing whom to ask. Mole is fond of Mountain Dew (free to Microsoft employees), Raisinettes (from the vending machine on the second floor), and Mother Mole’s worm and onion pie. Go ahead, ask him anything.

Mole’s Logon Scripts, Version 14.5

Mole,
Where can I find complete information on Windows NT Logon script commands? What I see in all the manuals and books I can find is very limited. I need a method to map drives based on group membership or to be able to test for other conditions. This was very easy to do in Novell login scripts. Thanks for your help.
—Michael D. Herman
Corporate Support Specialist

Michael,
Mole is an interop mammal all the way. And for the benefit of you IT guys and gals who learned your chops in a Novell world, there’s an article on TechNet that should make you feel right at home in Windows NT. It’s called “Logon Scripting—A Powerful, Underutilized Tool,” and it gives you a list of variables to use in your Logon scripts, plus directions on where to put the scripts, how to set up User Environment Profiles, and how to use Logon scripts to troubleshoot problems with Windows drive mapping. [See Additional Information for complete addresses of resources mentioned.—Ed.]

Of course, Mole feels compelled to point out that in Windows NT, a Logon script isn’t really a script at all. It’s a hook in the User Environment Profile and wears the nametag .bat or .exe. The User Environment Variables you specify (you can view and modify these via the Control Panel) take precedence over the system environment variables. Read about this feature in the Knowledge Base article, “NT Environment Variables.” And rejoice. Here’s something that has the same name and happens in the same place in both NT 4.0 and Windows 2000.

And, Michael, Logon scripts are just one approach to mapping drives based on group membership.

The IFMember utility supplied in the Windows NT 4.0 Workstation Resource Kit, used in logon scripts and other batch files, IFMember accepts a list of groups as parameters on the command line, checks to see to how many of these groups the current user belongs to, then exits with the number of matches as its exit value. This can be used by the IF ERRORLEVEL command in the logon script.

Keep in mind that IFMember uses its own process token to discover group membership, rather than querying the relevant Domain Controller each time it runs, a definite thumbs-up performance-wise. The downside is that it will only be aware of groups on the local computer, the computer’s domain, and trusted domains.

Finally, here’s a syntax statement:

ifmember [groupname1] [groupname2] ... [groupnameN]

You can learn more about the Windows NT 4.0 Workstation Resource Kit on TechNet. Once you have that CD in your paws and installed on your machine, you can download a new version of the IFMember utility that addresses users belonging to more than 15 groups from the Microsoft FTP Server.

KiXtart is another solution. (Mole would like to take a moment to assure you that while he frequently recommends the KiXtart utility to IT pros, he has never accepted so much as a single can of Mountain Dew from its manufacturer. No IT payola here.) There’s a KiXtart command called INGROUP that should make you very, very happy. (You can plug whatever command you want into the IF statement—for example, “net use m: \\myserver\sharename”.)

Here’s the skinny on the INGROUP:

ACTION: Checks whether the current user is a member of a group.

SYNTAX: INGROUP (“group name”)

PARAMETER: Group name
Identifies the group in which to check the user’s membership.

REMARKS: INGROUP can be used to check for group membership of groups that exist on the domain or server where the user is logged on, or to check for group membership of groups on a specific domain or server.

When checking for a local group, INGROUP identifies that the user is indirectly a member of the group by virtue of being a member of a global group that, in turn, is a member of the local group.

If you want to check for membership in a group on a specific domain or server, use the following format:

"OtherDomain\group"

or: 

"\\SomeServer\group"

For example:

IF INGROUP("Domain Users")
          DISPLAY "z:\users.txt"
ENDIF
IF INGROUP("Developers") = 2
          ? "Member of local group Developers"
ENDIF
IF INGROUP("\\" + @WKSTA + "\Developers") = 2
          ? "Member of local group Developers 
             on local system"
ENDIF

comments powered by Disqus

Reader Comments:

Wed, Dec 24, 2003 Caesar Seattle

I have my MCP in 2k pro and Server and they dont seam to get noticed on job interviews. Its nice to have, but not pivotal. Having real world experience and solid job references seams to be key. Get your foot in, even if its lower pay and use that as a stepping stone to move up. Contract work is a good start. Be descriptive in your resume. Gear your resume towards the job your applying for. After 3 years in seattle my salary is now 60k+100%med/dent/opt+stock options.

Tue, Jul 22, 2003 Okoli. F Swizterland

Hi guys, I got 2 from 4 already to b/come MCSA Certisfied, but still not working in the field! What do I do? Do I continue towards getting my MCSA?

Thu, Jul 17, 2003 Abdulkerim Eritrea

MCSA is a very good certification indeed. There is one friend of mine who works in a university as a system administrator and gets paid around 60$ per hour. Think about it in a long term. Dont just get humiliated if you cant find a job on the first try.

Sun, Jun 8, 2003 khari ms

I want to know if completing your mcsa track does that help you in obtaining a security clearance through the govt

Thu, Jun 5, 2003 sunil india

i want to know how much exams are conduct in mcsa and which ones give me the details about these

Wed, May 28, 2003 talat eng

I have a passion for what ever I do, but I was curious on if you have a bachlors in any computer science related field, how much would a MCP make? Or a CCNA?

Tue, May 27, 2003 Aspen Wyoming

Can someone please explain what TCP/IP settings are????
I must know or I'm getting fired from my tech support job!!!

Tue, May 27, 2003 Jeff core of the earth

Is a 386 a fast computer??

Tue, May 27, 2003 Becky Hampton, Va

Hi to all you single guys out there that are computer geeks!! I love the IT field. By the way, Wiggles, How old are you and are you single? -- Call me 218-763-44*6!!!!!!!!

Tue, May 27, 2003 Wiggles Wash. D.C.

Can you belive it, all these people on here whining that they aren't getting paid the slaries they feel they deserve --- boo-hoo! I just got my MCSE 3 MONTHS ago I was offered $40,000 to start. Put that in your pipe and smoke it!!

Tue, May 20, 2003 Anonymous Italy

qui contano solo gli anni di esperienza ... le certificazioni contano ma non tantissimo quanto in altri paesi ... purtroppo.

Thu, May 1, 2003 Ed Malaysia

Till now... no one have conducted a salary survery for Microsoft Professionals (MCP,MCSA,MCSE or MCDBA) in Asia. Do anyone have any idea what's the prospect in Asia. I work in Malaysia.. and I need to know what's the average salary we should get so that we r not exploited. Can anyone help?

Wed, Apr 30, 2003 Chris Miami

I am going to start classes for MCSA in May and I would like to hear from someone who is already into it. How is the job market if you have this cert.? Also if I do have the MCSA cert., what do I have to do to get MDSE and Cisco cert after?

Wed, Apr 2, 2003 Help Anonymous

What should a MCSA make that lives in NJ or NY?

Fri, Mar 21, 2003 chuck Houston

I have a passion for what ever I do, but I was curious on if you have a bachlors in any computer science related field, how much would a MCP make? Or a CCNA?

Thu, Feb 13, 2003 Mark Home China

wow,my god ,i am a MCSA also,i'm working in China,my salary is ¥1700.
I am sure I'm worth more than that.
But i can not find a chance.

Mon, Feb 3, 2003 Richard UK

Wow, has anyone got any data on average wages for MCSA's from the UK. I just got my MCSA a few days ago, and my salary is only £10,209, which probably works out around $17,000. I am sure I'm worth more than that.

Wed, Jan 29, 2003 chris us

I'd like to know if the MCSA is the right certification for me? I'm new to the IT industry. I had a computer operation job in Tampa Fl., but nothing to do with networking. It will be completly new to me, where is the best place to start, and is it possible to pass the MCSA with intense study, without experience?

Sun, Dec 8, 2002 Anonymous Anonymous

pls, i wil like to know if taking A+, N+ with other microsoft exams is a good idea towards the MCSA cert. or which one should come first 3 other MCSA exams or A+ and N+. thanks

Mon, Nov 25, 2002 Anonymous Anonymous

Just a note for Rahad from New York:MCP is the level for anyone who has not complete the requirement for a track, whether you pass one test or pass 9 as far as who have not complete the whole requirement for a certification track ....you are MCP. I have pass over 11microsoft exam but no certification. I only study and take test that i need to boost myself for any job am doing.

Sun, Nov 24, 2002 shaimaa egypt

i want to know if mcsa today has great career as mcse.Also, i want to know if mcsa job responsability is lowerans easier than an mcse for a systeem/network.

Mon, Nov 4, 2002 Rahad NYC

I'm CONFUSED. I was just comparing the salary for MCP and MCSA. How come MCP people make more than MCSA people. Where MCP only one exam and to get MCSA you take 4 exams. I doubt that a person with MCP knows any better than MCSA, then why the salary distribution is this way. Please correct me if I'm wrong on anything.
Hope to hear from someo ne on this matter.

Mon, Oct 14, 2002 Anonymous Anonymous

how much does an mcsa make

Wed, Aug 7, 2002 hoss new york

This is a pretty impressive survey. I've managed to stay on the high end of the survey, but what are the options for managers? Should a CTO be certified? Is there a certification track that an officer should take?

Add Your Comment Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above

Redmond Tech Watch

Sign up for our newsletter.

I agree to this site's Privacy Policy.