Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / December 2004

Tip: Looking for answers? Try searching our database.

Exception getting the SID value from DirectoryServices

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Thielen - 13 Dec 2004 21:35 GMT
Hi;

The following code:
DirectoryEntry obDirEntry = new DirectoryEntry("WinNT://CORP/dthielen");
System.DirectoryServices.PropertyCollection coll = obDirEntry.Properties;
object obVal = coll["objectSid"].Value;

Generates the below exception - on just some machines. Any ideas?

Signature

thanks - dave

System.Runtime.InteropServices.COMException (0x80070035): The network path
was not found

  at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)

  at System.DirectoryServices.DirectoryEntry.Bind()

  at System.DirectoryServices.DirectoryEntry.get_AdsObject()

  at System.DirectoryServices.PropertyValueCollection.PopulateList()

  at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry
entry, String propertyName)

  at System.DirectoryServices.PropertyCollection.get_Item(String
propertyName)

  at
Newmerix.AC.Common.security.WindowsSecurityFacade.GetCurrentPrincipalSid()

"Peter Huang" [MSFT] - 14 Dec 2004 07:13 GMT
Hi

What is the difference between the malfunctional machine and the working
machine?
Did you tried using the same Domain Account?
Did the problem machine is in the same domain with the other machine?
Did the Domain Controller work when you logon to the domain?

To isolate the problem I think we would better try to make the problem
machine has the same environment.

Also you may try to restart the problem machine and logon to the same
domain with the fine machine to see if the problem persists.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

David Thielen - 14 Dec 2004 08:45 GMT
Hi;

As far as we can tell - no difference. And then this afternoon it started
working on the one problem machine so we cannot even recreate the error.

What COM service is System.DirectoryServices.DirectoryEntry.Bind(Boolean
throwIfFail) calling? That could help us figure this out.

thanks - dave

> Hi
>
[quoted text clipped - 17 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 15 Dec 2004 02:42 GMT
Hi

Thanks for your quickly reply!
The Bind method is not public method and we did not have official document
for the method.
The problem may be raised by many possibility.
e.g. The network issue, DNS issue, password issue(assume you have logon the
machine with domain account, while you change the domain account password
on another machine) and so on.

So it is hard to list all the possibility.
For now since the code works for other machine, so I think the code is just
OK. I think the problem may lie in the Active directory, System
configuration.
Also you may try to post the issue in the newsgroup below.
microsoft.public.platformsdk.active.directory
or
microsoft.public.win2000.active_directory

If you still have any concern, please feel free to post here.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.