Re: Find Users Group Membership

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks for the detailed response. Assuming you've installed the Support
Tools, run a command prompt and copy and paste the following
single-lined syntax into it (it's complex in order to simplify the
output) -

for /f "skip=2 delims=; " %a in ('repadmin /showattr odyssey
"cn=administrator,cn=users,dc=mset,dc=local" /bas
e /attrs:tokengroups /long') do @for /f "tokens=2 delims=:" %b in
('repadmin /showattr odyssey "<SID=%a>" /at
trs:samaccountname ^| findstr "sAMAccountName:"') do echo %b

.... or

for /f "skip=2 delims=; " %a in ('repadmin /showattr <DC FQDN> "<object
DN>" /base /attrs:tokengroups /long') do @for /f "tokens=2 delims=:" %b
in ('repadmin /showattr <DC FQDN> "<SID=%a>" /attrs:samaccountname ^|
findstr "sAMAccountName:"') do echo %b

If you wish (which I'd advise) to put this syntax in to a shell script
(batch file), simply paste it into a file named <something>.cmd
remembering to replace the "%a" and "%b" references with double percent
symbols ("%%a" and "%%b").

HTH

--
Dean Wells [MVP / Directory Services]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l

Terry Renolds wrote:
> Here goes:
>
> 1 forest and 1 domain, so domain wide will do
> Users are members of both security and distribution groups
> Yes, can submit query's to the GC
> Native mode Windows 2003 SP1
>
> All the questions you want, better accurate info then my screwing up
> ; )
> And thank you for your quick response
>
>
> "Dean Wells [MVP]" <dwells@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:%23lQR8DbgFHA.1444@xxxxxxxxxxxxxxxxxxxxxxx
>> It depends, amongst other contributors Active Directory maintains a
>> number of group types each exhibiting a slightly different set of
>> characteristics. The relevant factors include: do you want
>> forest-wide membership, how many domains exist in the forest, what
>> 'type' of groups is the user a member of, are you able to submit the
>> query to a GC, what's the domain mode, what OS are you running on
>> your DCs? My apologies for the barage of questions, they'll make the
>> answer
>> more accurate and much less lengthy ...
>>
>> --
>> Dean Wells [MVP / Directory Services]
>> MSEtechnology
>> [[ Please respond to the Newsgroup only regarding posts ]]
>> R e m o v e t h e m a s k t o s e n d e m a i l
>>
>> Terry Renolds wrote:
>>> Is there any fairly easy way to find what Distribution and Security
>>> group each user belongs to?


.