Is there a way of performing operations depending on a users group membership?

A. On the resource kit for NT you'll find a program called IFMEMBER, this is what you'll have to base your login script upon. Important safety tip, IFMEMBER works by checking for membership in a group and returning an ERRORLEVEL hence you'll have a bunch of IF THENS..

Ifmember sets errorlevel to the number of groups in the list that the user is actually a member of, for example:

  groupa groupb groupc
savillj Y Y N

If you typed command

ifmember  group1 group2

an errorlevel of 2 would be returned.

ifmember groupa 
if %errorlevel%==1 <command>


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish