Re: Error setting DirecotrySearcher's new ExtendedDN



Thanks Joe, but now I'm worried and confused. At the link, the platforms
supports Win 2000 sp4, which is the lowest MS OS that I need to support. Did
I mis-understand what the platform on this web site stands for? (Oh, sorry,
I forgot to post the exception message)

http://msdn2.microsoft.com/en-us/library/system.directoryservices.directorysearcher.extendeddn.aspx
--------------------------------
Platforms

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server
2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition,
Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a
list of the supported versions, see System Requirements.


--
Thanks.


"Joe Kaplan (MVP - ADSI)" wrote:

ExtendedDN only works on Windows 2003 machines and higher. It doesn't work
on XP (if yo are using it via ADSI, which S.DS does). Is your machine XP or
lower?

BTW, you didn't show the exception...

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Pucca" <Pucca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:84B87E31-7443-41E2-862E-30D0757092AB@xxxxxxxxxxxxxxxx
Hi, I'm developeing with VS2005 and .Net 2.0 and C#. I'm trying to set
the
DirecotrySearcher's new ExtendedDN property but I keep getting the
following
error when my code reaches "using (SearchResultCollection results =
srch.FindAll())". I don't get any error at the code of setting the
prooperty
though, "srch.ExtendedDN = ExtendedDN.Standard;" Can anyone see what I
need
to correct here? Thanks.

public string GetWinName(DirectoryEntry de, DirectoryEntry
deParent)
{
string sidKey = null, childSidKey = null, sid = null;
int lastDash = 0;
childSidKey = de.Properties["cn"].Value.ToString();

de.AuthenticationType = AuthenticationTypes.FastBind |
AuthenticationTypes.Secure;

DirectorySearcher srch = new DirectorySearcher(deParent);

srch.SearchScope = SearchScope.OneLevel;
srch.Filter = ("(objectClass=meeting)");

srch.PropertiesToLoad.Add("distinguishedName");

/* Instruct the DirectorySearcher to use the
* new ExtendedDN enumeration to return either
* the standard format or hex format for the
* distinguishedName. In this case, dnFormat
* is a ExtendedDN type parameter passed into
* the function.
*/
srch.ExtendedDN = ExtendedDN.Standard;

using (SearchResultCollection results = srch.FindAll())
{
foreach (SearchResult res in results)
{
String extDn =
res.Properties["distinguishedName"][0].ToString();
String[] dnParts = extDn.Split(new char[] { ';' });

--
Thanks.



.



Relevant Pages

  • Re: Is LARGE_INTEGER always 64 bit long?
    ... LARGE_INTEGER is a struct which overlays a 64-bit integer with two 32-bit fields. ... in any implementation of Windows. ...
    (microsoft.public.vc.mfc)
  • Re: restricting access based on Org Unit (OU)
    ... If you want to use the role provider with Windows authentication, ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Domain registration requirement in federated web sso with fore
    ... Thanks a lot Joe for this useful information. ... We have some applications, written in non microsoft languages like Java, ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... internet, then the DNS entries for the resources will need to be ...
    (microsoft.public.windows.server.active_directory)
  • Re: ADAM Authentication
    ... Only using ADAM for testing a proof-of-concept; ... "Joe Kaplan" wrote: ... Note that using S.DS for authentication may cause you scalability problems ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ...
    (microsoft.public.windows.server.active_directory)
  • Re: Oh.... Im just wondering whos seen this stumper... RESOLVED !
    ... but I wonder if you saw any controls loaded in the modify ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... just has the granular attribute write permissions ...
    (microsoft.public.windows.server.active_directory)