It throws a COMException which says "Access is denied" Exception is raised when we try to get the members collection. The code below: ************************************************** DirectoryEntry groupEntry = new DirectoryEntry("WinNT://nttest/Administrators,group",@"NTTestdomain\Administrator","intelligroup"); pcoll = groupEntry.Properties; MembersCollection = groupEntry.Invoke("Members") ****************************************************
I have copied the stacktrace and the error code below . ERROR CODE: -2147024891 STACKTRACE: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_NativeObject() at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args) at WebApplication3.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication3\webform1.aspx.cs:line 32 We couldn't find any relevant information for this error code in MSDN --- Willy Denoyette <[EMAIL PROTECTED]> wrote: > What does it do when using explicit credentials? Is > there an exception thrown? > Are you sure you you have the authority and > principal separated by a double back slash: > "NTTestDomain\\Administrator", > > or a verbatim string.... > @"NTTestDomain\Administrator", > > Willy. > > ----- Original Message ----- > From: "george antony" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, April 23, 2002 8:31 AM > Subject: Re: [DOTNET] Retrieving user properties > from a WinNT provider using .Net > > > > We are trying to authenticate the way u had said > but > > we are not successful. we are able to enumerate > groups > > using a vb 6.0 program but this code in .Net fails > .. > > I wonder why ? > > We are in a different domain and the domain > controller > > itself is managing a different domain . Is there > is > > any problem in this. > > thanks > > Georgr > > --- Willy Denoyette <[EMAIL PROTECTED]> > > wrote: > > > If "Administrator" is a local account on the > remote > > > machine NTTestDomain, you have to specify the > user > > > name as > > > authority\username like: > > > > > > DirectoryEntry("WinNT/NTTestDomain/Co5049/Users,group", > > > "NTTestDomain\Administrator", ".... > > > If the program runs in the "Administrator" logon > > > session, and both machines do have an > Administrator > > > account with the > > > same password, there is no need to specify the > > > credentials when binding. > > > > > > Willy. > > > > > > > > > > > > ----- Original Message ----- > > > From: "george antony" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Monday, April 22, 2002 1:15 PM > > > Subject: Re: [DOTNET] Retrieving user properties > > > from a WinNT provider using .Net > > > > > > > > > > Hi > > > > This is the code we wrote: > > > > > > > > Dim memberscollection As Object > > > > Dim group As New > > > > > > > > > > DirectoryEntry("WinNT/NTTestDomain/Co5049/Users,group", > > > > "Administrator", "intelligroup", > > > > > > > > System.DirectoryServices.AuthenticationTypes.Secure) > > > > memberscollection = > > > group.Invoke("Members") > > > > Dim filter As System.Object() = > {"user"} > > > > memberscollection.Filter = filter > > > > Dim user As Object > > > > For Each user In memberscollection > > > > MessageBox.Show("ADsPath " + > > > user.ADsPath > > > > + "Name: " + user.Name) > > > > Next > > > > > > > > > > > > Since we are working with a remote machine we > are > > > > giving username and password. still we have > the > > > same > > > > problem. pls help in this issue. > > > > > > > > thanks > > > > george > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- Willy Denoyette > <[EMAIL PROTECTED]> > > > > wrote: > > > > > If "serverName" denotes a local machine, > there > > > > > should be no problem binding with the > current > > > > > process identity, but > > > > > you'll have to specify valid credentials > when > > > > > binding against a remote machine (see > > > DirectoryEntry > > > > > - UserName and > > > > > Password properties). > > > > > > > > > > Willy. > > > > > > > > > > ----- Original Message ----- > > > > > From: "george antony" <[EMAIL PROTECTED]> > > > > > To: <[EMAIL PROTECTED]> > > > > > Sent: Monday, April 22, 2002 7:59 AM > > > > > Subject: Re: [DOTNET] Retrieving user > properties > > > > > from a WinNT provider using .Net > > > > > > > > > > > > > > > > There is a comexception thrown when the > > > > > Group.Invoke > > > > > > method is called .It says Access denied . > what > > > do > > > > > we > > > > > > do abt this ? Some more help pls .. > > > > > > thanks in advance > > > > > > George > > > > > > > > > > You can read messages from the DOTNET > archive, > > > > > unsubscribe from DOTNET, or > > > > > subscribe to other DevelopMentor lists at > > > > http://discuss.develop.com. > > > > > > > > > > > > > __________________________________________________ > > > > Do You Yahoo!? > > > > Yahoo! Games - play chess, backgammon, pool > and > > > more > > > > http://games.yahoo.com/ > > > > > > > > You can read messages from the DOTNET archive, > > > unsubscribe from DOTNET, or > > > > subscribe to other DevelopMentor lists at > > > http://discuss.develop.com. > > > > > > > > > > You can read messages from the DOTNET archive, > > > unsubscribe from DOTNET, or > > > subscribe to other DevelopMentor lists at > > http://discuss.develop.com. > > > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! Games - play chess, backgammon, pool and > more > > http://games.yahoo.com/ > > > > You can read messages from the DOTNET archive, > unsubscribe from DOTNET, or > > subscribe to other DevelopMentor lists at > http://discuss.develop.com. > > > > You can read messages from the DOTNET archive, > unsubscribe from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.