4

I am querying ADSI using the WINNT provider with code similar to this :

var
  User : IADSUser;
begin
  User := GetObject('WinNT://'+domainname+'/'+username + ', user') as IADSUser;
  ...
  ...

where GetObject is defined as :

function GetObject (const Name : string): IDispatch;
var
  Moniker : IMoniker;
  Eaten : integer;
  BindContext : IBindCtx;
  Dispatch : IDispatch;
begin
  OleCheck( CreateBindCtx( 0, BindContext ) );
  OleCheck( MkParseDisplayName( BindContext, PWideChar(  WideString( Name ) ), Eaten, Moniker ) );
  OleCheck( Moniker.BindToObject( BindContext, NIL, IDispatch,  Dispatch ) );
  Result := Dispatch;
end;

This has been working for a few years now without problem I have one installation though where on a particular domain, I get a Network Path Not Found error when querying from a different domain. This setup has 4 different domains. There is full trust between the domains, and the query works fine on the offending domain when queried from within the domain. It's just when this is tried from one of the other domains. It is possible to query the domain using a number of other tools, so everything seems ok. Any ideas why this particular domain might be giving this problem?

Steve
  • 6,382
  • 3
  • 41
  • 66
  • 1
    I think you are experiencing a name resolution issue here. It looks like NetBIOS resolution is not working, that you aren't specifying the full DNS name (I still think the WinNT provider supports fqdn) or that you haven't specified DNS Suffixes to be queried. – CosmosKey Aug 16 '11 at 12:27
  • 1
    Same issue here. Try modifying the WinNT path to be just the domain and iterate through the objects returned. If you found a solution would love to hear it! – Sam Makin Nov 28 '14 at 17:51

0 Answers0