-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: jayaveer
Message 5 in Discussion


Hi,
        But i have found some queries on net for 
creating a linked server and retrieving the users from it here are the queries 

 
This 
sp is used for creating a linked server
sp_addlinkedserver 'TEST', 'Active Directory Service Interfaces', 
'SQLOLEDB', 'ServerName'
 
This 
query is used to list all the users from the linked server created 
above
SELECT * 
FROM OpenQuery(TEST, 'SELECT title, displayName, sAMAccountName, givenName, 
telephoneNumber, facsimileTelephoneNumber, sn FROM ''LDAP://DC=XXXX,DC=com'' 
where objectClass = ''User''')
 
but while running these queries i am got some 
errors
 
and here is the link form where i got the 
queries
http://dotnetjunkies.com/WebLog/bsblog/archive/2003/12/19/4746.aspx



From: Mrinal [mailto:[EMAIL PROTECTED] 

Sent: Monday, December 06, 2004 8:30 PM
To: 
BDOTNET
Subject: Re: How to list all users in ActiveDirectory using 
Sql Query




  
  
    
    New Message on BDOTNET
  
    

How to list 
  all users in ActiveDirectory using Sql Query


  
    
    
      Reply

      
        
          
          
             
            Reply to Sender   Recommend 
            Message 2 in Discussion 
            
    
      
        
          
          
            From: Mrinal 
          
            

              Hi ,
               
              Sql is not meant for querying Active Directory or any other 
              directory services , normal way to go about doing it for a 
              directory service is using LDAP query and set of .Net classes 
              like DirectoryEntry and DirectorySearcher ,
               
              Go to " Software Artifacts " section in BDotNet and There's a 
              small article by me regarding Accessing Active Directory in .Net 
, 
              it is with code snippets , it should help you , in case you any 
              doubt get back to me .
               
              regards ,
               
              Mrinal
View other groups in this 
  category. 







-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to