List Info

Thread: Win32_GroupUser




Win32_GroupUser
user name
2006-11-13 19:32:31
Tim Roberts <timr <at> probo.com> writes:

> 
> Tim Golden wrote:
> > | Working off a large-ish domain, I can't seem to
find a form of:
> > | 
> > | import wmi
> > | conn = wmi.WMI ()
> > | stuff = conn.Win32_GroupUser ()
> > | 
> > | ... that doesn't enumerate the entire domain.
> >
> > I'm going to assume that you didn't intend the
> > double-negative in the above. 
> >   
> 
> Actually, I think he did.  Everything he tried
enumerated the entire
> domain, which is not what he wanted.  He wanted to
query a subset only.

Ah yes, my misunderstanding. Thanks for pointing out.

> What he posted was:
> 
> conn.Win32_GroupUser (GroupComponent =
"Win32_Group.SID=sid_number")
> 
> Suggesting, perhaps, that he wanted only the users
within 
> a group with a given SID.

I imagine you're right. Hopefully my example gave
a way of doing that, but I'll just repost slightly
here:

<code>
import wmi
c = wmi.WMI ()
sid_number = "whatever"
group = c.Win32_Group (SID=sid_number)
#
# and then as before, using group.associators (...)
#

</code>

TJG

_______________________________________________
Python-win32 mailing list
Python-win32python.org

http://mail.python.org/mailman/listinfo/python-win32
Win32_GroupUser
user name
2006-11-14 04:01:53

There should be a central site with all this information!
On 11/13/06, Tim Golden < mailtimgolden.me.uk">mailtimgolden.me.uk> wrote:
Tim Roberts <timr <at> probo.com> writes:

>
> Tim Golden wrote:
>; > | Working off a large-ish domain, I can't seem to find a form of:
> > |
> > | import wmi
> > | conn = wmi.WMI ()
> > | stuff = conn.Win32_GroupUser ()
> > |
> > | ... that doesn't enumerate the entire domain.
&gt; >
> > I'm going to assume that you didn't intend the
> > double-negative in the above.
>; >
>
> Actually, I think he did.  Everything he tried enumerated the entire
&gt; domain, which is not what he wanted.&nbsp; He wanted to query a subset only.

Ah yes, my misunderstanding. Thanks for pointing out.

> What he posted was:
>
> conn.Win32_GroupUser (GroupComponent = "Win32_Group.SID=sid_number")
&gt;
> Suggesting, perhaps, that he wanted only the users within
>; a group with a given SID.

I imagine you're right. Hopefully my example gave
a way of doing that, but I'll just repost slightly
here:

<code>
import wmi
c = wmi.WMI ()
sid_number = "whatever"
group = c.Win32_Group (SID=sid_number)
#
# and then as before, using group.associators (...)
#

&lt;/code>;

TJG

_______________________________________________
Python-win32 mailing list
Python-win32python.org">Python-win32python.org
http://mail.python.org/mailman/listinfo/python-win32



--
http://www.goldwatches.com
Win32_GroupUser
user name
2006-11-14 08:47:43
[James Matthews]

[... re WMI Win32_GroupUser etc. ]

> There should be a central site with all this
information!

Well, not that I disagree with you as such, but it depends
on what exactly your "all this" encompasses. ;)

Nearly all of the questions to the list about WMI are
really WMI questions, and not Python or Python/WMI
specific. This one was a bit different because the
answer relied somewhat on the workings of the wmi
module.

If you're after WMI info in general, msdn is the place
I start for simple "How do I use this class?" or
"What are the methods / parameters for this
class?" queries:

http://www.microsoft.com/whdc/system/pnppwr/wmi/defa
ult.mspx

Then it's down to the Google Group:

http://groups.google.com/group/microsoft
.public.win32.programmer.wmi?lnk
=lr

or any one of the myriad other resources and examples
around the internet:

http://www.google.com/search?q=wmi+enumerate+group+mem
bers

If it's specifics about the Python wmi module, then
obviously I *do* have to bow my head in shame somewhat
and admit that my fledgeling tutorial is taking a *very*
long time to come up with.

Meanwhile, though, there is the cookbook on my site,
which does at least give a certain range of examples:

http:
//timgolden.me.uk/python/wmi_cookbook.html

I generally try to use the questions to the list
as the starting point for cookbook "recipes". I'll
try to put this one in.

TJG

____________________________________________________________
____________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a
proactive
anti-virus service working around the clock, around the
globe, visit:
http://www.star.net.uk
____________________________________________________________
____________
_______________________________________________
Python-win32 mailing list
Python-win32python.org

http://mail.python.org/mailman/listinfo/python-win32
Win32_GroupUser
user name
2006-11-14 08:47:43
[James Matthews]

[... re WMI Win32_GroupUser etc. ]

> There should be a central site with all this
information!

Well, not that I disagree with you as such, but it depends
on what exactly your "all this" encompasses. ;)

Nearly all of the questions to the list about WMI are
really WMI questions, and not Python or Python/WMI
specific. This one was a bit different because the
answer relied somewhat on the workings of the wmi
module.

If you're after WMI info in general, msdn is the place
I start for simple "How do I use this class?" or
"What are the methods / parameters for this
class?" queries:

http://www.microsoft.com/whdc/system/pnppwr/wmi/defa
ult.mspx

Then it's down to the Google Group:

http://groups.google.com/group/microsoft
.public.win32.programmer.wmi?lnk
=lr

or any one of the myriad other resources and examples
around the internet:

http://www.google.com/search?q=wmi+enumerate+group+mem
bers

If it's specifics about the Python wmi module, then
obviously I *do* have to bow my head in shame somewhat
and admit that my fledgeling tutorial is taking a *very*
long time to come up with.

Meanwhile, though, there is the cookbook on my site,
which does at least give a certain range of examples:

http:
//timgolden.me.uk/python/wmi_cookbook.html

I generally try to use the questions to the list
as the starting point for cookbook "recipes". I'll
try to put this one in.

TJG

____________________________________________________________
____________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a
proactive
anti-virus service working around the clock, around the
globe, visit:
http://www.star.net.uk
____________________________________________________________
____________
_______________________________________________
Python-win32 mailing list
Python-win32python.org

http://mail.python.org/mailman/listinfo/python-win32
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )