Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i want to alter the logon.bat script for our AD users (windows xp/vista/7 machines and a few servers), so that it writes an environmental variable upon login based on some AD information, like "what group is the user in".

Basically: SET MyADGroup=

Some Google searches got me into dsget and so on, but that was only on servers and not built into any "normal client".

Not really my area this, but ended up on my table, any help appreciated!

share|improve this question
    
This seems silly for any number of reasons - including the fact that a user might be in more than one group. Can you tell us what problem you're actually trying to solve? –  mfinni May 12 '11 at 13:00

2 Answers 2

You can get a list of the groups a user belongs to using the "NET USER" command:

net user <username> /domain

The command provides lots of informations, including group membership; but storing that in a variable can get tricky, because you would need to parse the command's output.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.