Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationScheduled Job to import Active Directory usersScheduled Job to import Active Directory users
Previous
 
Next
New Post
2/5/2009 10:13 AM
 

Hi All

I'm trying to create a scheduled job to import users from Active directory that don't already exist in the DNN database.

The code that i'm using to access the Active Directory works fine in a module, but once it gets added into a class library and the dll gets called from the Scheduler I get the following message.

"The specified domain either does not exist or could not be contacted. at System.DirectoryServices.DirectoryEntry.Bind"

I don't get this error when I run the same code in a module contained on a page. The method that it is failing on is the actual creation of the DirectoryEntry object.

private DirectoryEntry GetDirectoryObject(string sDN)
        {
            string sSearchStr = sDN;
            System.DirectoryServices.DirectoryEntry entry =
                     new System.DirectoryServices.DirectoryEntry(sSearchStr, "{domain}\\{username}", "{password}", AuthenticationTypes.Secure);
            return entry;
        }

I thought this initially was down to the scheduler running under a different user account, which is why I've started to use the username and password properties of the DirectoryServices object, but this has not resolved the problem.

Does anyone have any suggestions? The Path that I used in the Module to access the AD should remain unchanged shouldn't it? I didn't think that I would have to change the path to the domain controller just because I was passing in the username and password now.

Any help is appreciated

Thanks

Martin.

 

 
New Post
2/5/2009 3:55 PM
 

I wouldn't think it would need to be changed but I haven't got any experienced in writing jobs for the DNN Scheduler.

 
New Post
5/22/2009 10:09 AM
 

Martin,

Did you get this figured out? I'd like to do the same. Can you share your solution?

 


pmgerholdt
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationScheduled Job to import Active Directory usersScheduled Job to import Active Directory users


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out