|
|
|
date: Tue, 26 Apr 2005 21:35:54 -0400,
group: microsoft.public.platformsdk.active.directory
back
Re: ADSI WinNT Provider and XP
Thanks for the reply - I am guessing that you are still using VB6 - pre
dotNet and did believe it should be that simple before. I assume you've
tried the code you've forwarded - and will look to get at it again tonight.
I am running from .Net and have found that I have been unable to get it to
acknowledge the '.Name' method for that object - no matter how I've tried to
get at it. One possible problem, might be that I am using the full path of
the top level group object to rebind to that group in an attempt to retrieve
the names of its members - and the resulting group path includes both the
domain and the computer - though it was read by binding to the WinNT
provider in just the manor you suggest. All additional comments welcome -
- J
"Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
message news:uBmnqnvSFHA.3176@TK2MSFTNGP09.phx.gbl...
> "Joe User" <JoeUser@somewhere> wrote in message
> news:eVVySmsSFHA.2520@TK2MSFTNGP09.phx.gbl...
> > New to ADSI, I've been working on users and groups on my home machines
and
> > have been having trouble enumerating users within a group - membership
> > that
> > is. These are all local accounts (of course - at home) and I have
> > therefor
> > focused on attempting this with the WinNT provider. It is relatively
> > trivial to enumerate users and groups for a given system, but I have
been
> > unsuccessful in the enumeration of group memberships. Does anyone know
if
> > this is inhibited in XP Home Edition ? For all the digging I have done,
I
>
>
> if you leave out DOMAIN then you should use your local XP computer name
>
> Sub main()
> Dim iadsO As iads
> Dim iadsG As IADsGroup
> Dim iadsC As IADsContainer
>
> Set iadsG = GetObject("WinNT://DOMAIN/Administrators")
> Dim c As Long
>
> For Each iadsO In iadsG.Members
> Debug.Print iadsO.Name
> Next
> End Sub
>
>
> > do not see this possibility discussed anywhere on the MS sites. If
anyone
> > has done this for this OS, please elaborate on how you get from an
> > existing
> > group directory entry object to the member user references.... in your
> > preferred language... C, Basic, Script, etc.. I have tried various
methods
> > of authentication in the bind to the group object and various methods of
> > trying to retrieve a collection of user references (be it object
> > references
> > or properties)... all in vein. So, tips would be great.
> >
> > -J
> >
> >
>
date: Wed, 27 Apr 2005 07:16:43 -0400
author: Joe User JoeUser@somewhere
Re: ADSI WinNT Provider and XP
"Joe User" <JoeUser@somewhere> wrote in message
news:OhD53qxSFHA.580@TK2MSFTNGP15.phx.gbl...
> Thanks for the reply - I am guessing that you are still using VB6 - pre
> dotNet and did believe it should be that simple before. I assume you've
> tried the code you've forwarded - and will look to get at it again
> tonight.
> I am running from .Net and have found that I have been unable to get it to
> acknowledge the '.Name' method for that object - no matter how I've tried
> to
Hi,
You did not say you wanted DotNet. Why not say it?
anyway, I found a sample in the MSDN which mentions how to do it...
[STAThread]
static void Main(string[] args)
{
DirectoryEntry ent = new
DirectoryEntry("WinNT://yourPCorDOMAIN/Administrators");
object members = ent.Invoke("Members",null);
foreach (object ent2 in (IEnumerable) members)
{
DirectoryEntry ent3 = new DirectoryEntry(ent2);
Console.WriteLine(ent3.Name);
}
}
--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm
> get at it. One possible problem, might be that I am using the full path
> of
> the top level group object to rebind to that group in an attempt to
> retrieve
> the names of its members - and the resulting group path includes both the
> domain and the computer - though it was read by binding to the WinNT
> provider in just the manor you suggest. All additional comments welcome -
>
> - J
>
> "Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
> message news:uBmnqnvSFHA.3176@TK2MSFTNGP09.phx.gbl...
>> "Joe User" <JoeUser@somewhere> wrote in message
>> news:eVVySmsSFHA.2520@TK2MSFTNGP09.phx.gbl...
>> > New to ADSI, I've been working on users and groups on my home machines
> and
>> > have been having trouble enumerating users within a group - membership
>> > that
>> > is. These are all local accounts (of course - at home) and I have
>> > therefor
>> > focused on attempting this with the WinNT provider. It is relatively
>> > trivial to enumerate users and groups for a given system, but I have
> been
>> > unsuccessful in the enumeration of group memberships. Does anyone know
> if
>> > this is inhibited in XP Home Edition ? For all the digging I have
>> > done,
> I
>>
>>
>> if you leave out DOMAIN then you should use your local XP computer name
>>
>> Sub main()
>> Dim iadsO As iads
>> Dim iadsG As IADsGroup
>> Dim iadsC As IADsContainer
>>
>> Set iadsG = GetObject("WinNT://DOMAIN/Administrators")
>> Dim c As Long
>>
>> For Each iadsO In iadsG.Members
>> Debug.Print iadsO.Name
>> Next
>> End Sub
>>
>>
>> > do not see this possibility discussed anywhere on the MS sites. If
> anyone
>> > has done this for this OS, please elaborate on how you get from an
>> > existing
>> > group directory entry object to the member user references.... in your
>> > preferred language... C, Basic, Script, etc.. I have tried various
> methods
>> > of authentication in the bind to the group object and various methods
>> > of
>> > trying to retrieve a collection of user references (be it object
>> > references
>> > or properties)... all in vein. So, tips would be great.
>> >
>> > -J
>> >
>> >
>>
>
>
date: Wed, 27 Apr 2005 14:35:17 +0200
author: Egbert Nierop \(MVP for IIS\) lid
Re: ADSI WinNT Provider and XP
well - I took your code snippet and tested it out - and the invoke just
throws an exception. I experimented with mods to it as well - all with an
equal lack of luck. Thanks anyways.
- J
"Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
message news:e6OxTWySFHA.3344@TK2MSFTNGP12.phx.gbl...
> "Joe User" <JoeUser@somewhere> wrote in message
> news:OhD53qxSFHA.580@TK2MSFTNGP15.phx.gbl...
> > Thanks for the reply - I am guessing that you are still using VB6 - pre
> > dotNet and did believe it should be that simple before. I assume you've
> > tried the code you've forwarded - and will look to get at it again
> > tonight.
> > I am running from .Net and have found that I have been unable to get it
to
> > acknowledge the '.Name' method for that object - no matter how I've
tried
> > to
>
>
> Hi,
>
> You did not say you wanted DotNet. Why not say it?
> anyway, I found a sample in the MSDN which mentions how to do it...
>
> [STAThread]
>
> static void Main(string[] args)
>
> {
>
>
> DirectoryEntry ent = new
> DirectoryEntry("WinNT://yourPCorDOMAIN/Administrators");
>
> object members = ent.Invoke("Members",null);
>
>
> foreach (object ent2 in (IEnumerable) members)
>
> {
>
> DirectoryEntry ent3 = new DirectoryEntry(ent2);
>
> Console.WriteLine(ent3.Name);
>
> }
>
>
>
>
>
> }
>
>
> --
> compatible web farm Session replacement for Asp and Asp.Net
> http://www.nieropwebconsult.nl/asp_session_manager.htm
>
>
>
> > get at it. One possible problem, might be that I am using the full path
> > of
> > the top level group object to rebind to that group in an attempt to
> > retrieve
> > the names of its members - and the resulting group path includes both
the
> > domain and the computer - though it was read by binding to the WinNT
> > provider in just the manor you suggest. All additional comments
welcome -
> >
> > - J
> >
> > "Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
> > message news:uBmnqnvSFHA.3176@TK2MSFTNGP09.phx.gbl...
> >> "Joe User" <JoeUser@somewhere> wrote in message
> >> news:eVVySmsSFHA.2520@TK2MSFTNGP09.phx.gbl...
> >> > New to ADSI, I've been working on users and groups on my home
machines
> > and
> >> > have been having trouble enumerating users within a group -
membership
> >> > that
> >> > is. These are all local accounts (of course - at home) and I have
> >> > therefor
> >> > focused on attempting this with the WinNT provider. It is relatively
> >> > trivial to enumerate users and groups for a given system, but I have
> > been
> >> > unsuccessful in the enumeration of group memberships. Does anyone
know
> > if
> >> > this is inhibited in XP Home Edition ? For all the digging I have
> >> > done,
> > I
> >>
> >>
> >> if you leave out DOMAIN then you should use your local XP computer name
> >>
> >> Sub main()
> >> Dim iadsO As iads
> >> Dim iadsG As IADsGroup
> >> Dim iadsC As IADsContainer
> >>
> >> Set iadsG = GetObject("WinNT://DOMAIN/Administrators")
> >> Dim c As Long
> >>
> >> For Each iadsO In iadsG.Members
> >> Debug.Print iadsO.Name
> >> Next
> >> End Sub
> >>
> >>
> >> > do not see this possibility discussed anywhere on the MS sites. If
> > anyone
> >> > has done this for this OS, please elaborate on how you get from an
> >> > existing
> >> > group directory entry object to the member user references.... in
your
> >> > preferred language... C, Basic, Script, etc.. I have tried various
> > methods
> >> > of authentication in the bind to the group object and various methods
> >> > of
> >> > trying to retrieve a collection of user references (be it object
> >> > references
> >> > or properties)... all in vein. So, tips would be great.
> >> >
> >> > -J
> >> >
> >> >
> >>
> >
> >
>
date: Wed, 27 Apr 2005 22:50:34 -0400
author: Joe User JoeUser@somewhere
|
|