Saturday, March 24, 2012
The dread COMException (0x80004005): Unspecified error...
Therefore, I believe it has something to do with security settings. Here's
the code:
---
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim child As System.DirectoryServices.DirectoryEntry
' dirEntry is a DirectoryEntry component that points to
' WinNT://someserver
' I tried to retrieve the current user Active Directory information by
' using the Find function and specifying the logon userId and which
' schema the user belongs to. In this case, "User"...
child = dirEntry.Children.Find(getCurrentUserId, "User")
' lb is a ListBox
lb.DataSource = child.Properties()
End Sub
Public Function getCurrentUserId() As String
' I attempt to retrieve the current user windows logon id with the
' domain name removed using a Spilt("/") but it returns an empty
' string instead
Return
System.Security.Principal.WindowsIdentity.GetCurrent.Name.Spilt("/")(1)
End Function
---
After launching the site, the following error occurs:
---
[COMException (0x80004005): Unspecified error
]
System.DirectoryServices.Interop.IAdsContainer.GetObject(String
className, String relativeName) +0
System.DirectoryServices.DirectoryEntries.Find(String name, String
schemaClassName)
ADSearch.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\
wwwroot\ADSearch\WebForm1.aspx.vb:36
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
---
I've tried using only the windows logon userId(dirEntry.Children.Find
(getCurrentUserId)) to retrieve the Active Directory entry for the current
user but the error still comes back.
I'am at my wits end...
solutions anyone?
Message posted via http://www.webservertalk.comThe user under which your application is running (most likely
IUSR_SERVERNAME) might not have permissions to access AD.
You should configure the virtual directory's security to run under a user
that has permissions to do so. Simply create a separate account for it in AD
and use it as the anonymous user (in IIS properties).
Alternatively, you can use ASP.NET impersonation configurable in web.config
(search MSDN for it).
Try doing the same AD stuff from a winforms application, and see if it's
indeed the problem with permissions.
-Oleg.
"Shihao Png via webservertalk.com" <forum@.webservertalk.com> wrote in
message news:2aeb59d02bc64258b8b6e15300e5aaa4@.Do
webservertalk.com...
> Well, the problem I'am having now applies to web applications only.
> Therefore, I believe it has something to do with security settings. Here's
> the code:
> ---
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim child As System.DirectoryServices.DirectoryEntry
> ' dirEntry is a DirectoryEntry component that points to
> ' WinNT://someserver
> ' I tried to retrieve the current user Active Directory information by
> ' using the Find function and specifying the logon userId and which
> ' schema the user belongs to. In this case, "User"...
> child = dirEntry.Children.Find(getCurrentUserId, "User")
> ' lb is a ListBox
> lb.DataSource = child.Properties()
> End Sub
> Public Function getCurrentUserId() As String
> ' I attempt to retrieve the current user windows logon id with the
> ' domain name removed using a Spilt("/") but it returns an empty
> ' string instead
> Return
> System.Security.Principal.WindowsIdentity.GetCurrent.Name.Spilt("/")(1)
> End Function
> ---
> After launching the site, the following error occurs:
> ---
> [COMException (0x80004005): Unspecified error
> ]
> System.DirectoryServices.Interop.IAdsContainer.GetObject(String
> className, String relativeName) +0
> System.DirectoryServices.DirectoryEntries.Find(String name, String
> schemaClassName)
> ADSearch.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\
> wwwroot\ADSearch\WebForm1.aspx.vb:36
> System.Web.UI.Control.OnLoad(EventArgs e)
> System.Web.UI.Control.LoadRecursive()
> System.Web.UI.Page.ProcessRequestMain()
> ---
> I've tried using only the windows logon userId(dirEntry.Children.Find
> (getCurrentUserId)) to retrieve the Active Directory entry for the current
> user but the error still comes back.
> I'am at my wits end...
> solutions anyone?
> --
> Message posted via http://www.webservertalk.com
Sorry but I don't really get what you mean...do you mean that the user
account that I run on when I attempt to search AD do not have the
permission to do so by the AD server? So that means I should configure AD
so that it allows searching by my user account? Is that what you mean?
Message posted via http://www.webservertalk.com
The dread COMException (0x80004005): Unspecified error...
Therefore, I believe it has something to do with security settings. Here's
the code:
--------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim child As System.DirectoryServices.DirectoryEntry
' dirEntry is a DirectoryEntry component that points to
' WinNT://someserver
' I tried to retrieve the current user Active Directory information by
' using the Find function and specifying the logon userId and which
' schema the user belongs to. In this case, "User"...
child = dirEntry.Children.Find(getCurrentUserId, "User")
' lb is a ListBox
lb.DataSource = child.Properties()
End Sub
Public Function getCurrentUserId() As String
' I attempt to retrieve the current user windows logon id with the
' domain name removed using a Spilt("/") but it returns an empty
' string instead
Return
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Spilt("/")(1)
End Function
--------------------
After launching the site, the following error occurs:
--------------------
[COMException (0x80004005): Unspecified error
]
System.DirectoryServices.Interop.IAdsContainer.Get Object(String
className, String relativeName) +0
System.DirectoryServices.DirectoryEntries.Find(Str ing name, String
schemaClassName)
ADSearch.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\
wwwroot\ADSearch\WebForm1.aspx.vb:36
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
--------------------
I've tried using only the windows logon userId(dirEntry.Children.Find
(getCurrentUserId)) to retrieve the Active Directory entry for the current
user but the error still comes back.
I'am at my wits end...
solutions anyone?
--
Message posted via http://www.dotnetmonster.comThe user under which your application is running (most likely
IUSR_SERVERNAME) might not have permissions to access AD.
You should configure the virtual directory's security to run under a user
that has permissions to do so. Simply create a separate account for it in AD
and use it as the anonymous user (in IIS properties).
Alternatively, you can use ASP.NET impersonation configurable in web.config
(search MSDN for it).
Try doing the same AD stuff from a winforms application, and see if it's
indeed the problem with permissions.
-Oleg.
"Shihao Png via DotNetMonster.com" <forum@.DotNetMonster.com> wrote in
message news:2aeb59d02bc64258b8b6e15300e5aaa4@.DotNetMonste r.com...
> Well, the problem I'am having now applies to web applications only.
> Therefore, I believe it has something to do with security settings. Here's
> the code:
> --------------------
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim child As System.DirectoryServices.DirectoryEntry
> ' dirEntry is a DirectoryEntry component that points to
> ' WinNT://someserver
> ' I tried to retrieve the current user Active Directory information by
> ' using the Find function and specifying the logon userId and which
> ' schema the user belongs to. In this case, "User"...
> child = dirEntry.Children.Find(getCurrentUserId, "User")
> ' lb is a ListBox
> lb.DataSource = child.Properties()
> End Sub
> Public Function getCurrentUserId() As String
> ' I attempt to retrieve the current user windows logon id with the
> ' domain name removed using a Spilt("/") but it returns an empty
> ' string instead
> Return
> System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Spilt("/")(1)
> End Function
> --------------------
> After launching the site, the following error occurs:
> --------------------
> [COMException (0x80004005): Unspecified error
> ]
> System.DirectoryServices.Interop.IAdsContainer.Get Object(String
> className, String relativeName) +0
> System.DirectoryServices.DirectoryEntries.Find(Str ing name, String
> schemaClassName)
> ADSearch.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\
> wwwroot\ADSearch\WebForm1.aspx.vb:36
> System.Web.UI.Control.OnLoad(EventArgs e)
> System.Web.UI.Control.LoadRecursive()
> System.Web.UI.Page.ProcessRequestMain()
> --------------------
> I've tried using only the windows logon userId(dirEntry.Children.Find
> (getCurrentUserId)) to retrieve the Active Directory entry for the current
> user but the error still comes back.
> I'am at my wits end...
> solutions anyone?
> --
> Message posted via http://www.dotnetmonster.com
Sorry but I don't really get what you mean...do you mean that the user
account that I run on when I attempt to search AD do not have the
permission to do so by the AD server? So that means I should configure AD
so that it allows searching by my user account? Is that what you mean?
--
Message posted via http://www.dotnetmonster.com
Tuesday, March 13, 2012
the membership of asp.net2.0 is useful in my case?
security ID, Country etc...
I must retrive these attributes after the user login.
How can I save do with the membership of asp.net2.0?Membership is purely for authentication. For extra user data you should look
into the Profile.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> the membership asp.net2.0I have many User attributes like telephone
> number,
> security ID, Country etc...
> I must retrive these attributes after the user login.
> How can I save do with the membership of asp.net2.0?
>
Adding that I have yet to come to understand the scope of the current
aspnetdb.mdb database schema and hope somebody who knows what the heck all
those columns actually mean and what they can be used for will document it
and doing it yesterday will not be soon enough for me.
<%= Clinton Gallagher
METROmilwaukee "Regional Information Services"
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
"Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
news:453106632490060869625168@.msnews.microsoft.com...
> Membership is purely for authentication. For extra user data you should
> look into the Profile.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
Well, I'd agree. It'd be nice to have these documented, but on the other
hand that's somewhat going against the idea of a provider (wether it be memb
ership
or profile). IOW, it's a black box of functionality. It's academically inter
esting
to understand them, but too much info is a bad thing as one tends to want
to modify things when you shouldn't. If you don't like their implementation,
you can create your own Membership or Profile provider that works with all
the UI controls just the same as the built in providers from Microsoft.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Adding that I have yet to come to understand the scope of the current
> aspnetdb.mdb database schema and hope somebody who knows what the heck
> all those columns actually mean and what they can be used for will
> document it and doing it yesterday will not be soon enough for me.
> "Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
> news:453106632490060869625168@.msnews.microsoft.com...
>
Its not a matter of like or dislike. I can't dislike something simply
because I do not understand it. Its after I come to understand something
that I can make a reasonable determination.
I'm confident the schema will be documented and many articles will appear --
eventually -- but again, yesterday would not have been too soon for me.
Where is Dino Esposito et. el. when you really need them? ;-)
<%= Clinton Gallagher
METROmilwaukee "Regional Information Services"
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
"Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
news:460338632490389934897792@.msnews.microsoft.com...
> Well, I'd agree. It'd be nice to have these documented, but on the other
> hand that's somewhat going against the idea of a provider (wether it be
> membership or profile). IOW, it's a black box of functionality. It's
> academically interesting to understand them, but too much info is a bad
> thing as one tends to want to modify things when you shouldn't. If you
> don't like their implementation, you can create your own Membership or
> Profile provider that works with all the UI controls just the same as the
> built in providers from Microsoft.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
Try creating a new project and use the SQLProvider instedd of the
AccessProvider. If you do so then all the tables would be created and you
could visibly see the schema in the Visual Studio IDE.
"clintonG" wrote:
> Its not a matter of like or dislike. I can't dislike something simply
> because I do not understand it. Its after I come to understand something
> that I can make a reasonable determination.
> I'm confident the schema will be documented and many articles will appear
--
> eventually -- but again, yesterday would not have been too soon for me.
> Where is Dino Esposito et. el. when you really need them? ;-)
> --
> <%= Clinton Gallagher
> METROmilwaukee "Regional Information Services"
> NET csgallagher AT metromilwaukee.com
> URL http://clintongallagher.metromilwaukee.com/
>
> "Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
> news:460338632490389934897792@.msnews.microsoft.com...
>
>