active-directory

C# Create OU in Active Directory

I'm struggling to create an OU for Active Directory using the code below. strPath = "OU=TestOU,DC=Internal,DC=Com" DirectoryEntry objOU; objOU = ADentry.Children.Add(strPath, "OrganizationalUnit"); objOU.CommitChanges(); The problem is strPath contains the full path 'OU=TestOU,DC=Internal,DC=net' so using .Children.Add is making the...

Active Directory - Check username / password

I'm using the following code on Windows Vista Ultimate SP1 to query our active directory server to check the user name and password of a user on a domain. public Object IsAuthenticated() { String domainAndUsername = strDomain + "\\" + strUser; DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, strPass); Sear...

C# Active Directory, Create an Organizational Unit for each OU in an LDAP path??

I'm trying to create an Organizational Unit for each OU in an LDAP path if the OU doesn't exist, the program doesn't know the OU names or how deep the OUs go, there could be 1 OU in the path or 10 deep. Example: strPath = "OU=Test1,OU=Test2,OU=Test3,DC=Internal,DC=net" The code below extracts the last OU 'OU=Test1' from the strPath and...

Policy to allow user to enumerate accounts only within his own OU in Active Directory.

Is it possible to define a policy which restricts a user to enumerate only accounts in his own OU? For example lets consider a domain Contosos and OUs Sales and HR.The Sales OU has two users A and B and the HR OU has users C and D. Is it possible to define a policy so that A can only enumerate accounts A and B and C can only enumerate ...

How do I get a real name stored in Active Directory from an username with C#?

I want to create a quick application for people to resolve the name of a user stored in Active Directory from a set of credentials. Some applications only provide the user id and it is too much to expect an end user to fire up the Active Directory Users and Groups MMC snap-in. Input would be something like "MYCORP\a_user" and output wou...

Query AD from sql server 2005

I am attempting to query AD via ldap from within SQL Server 2005 but get the following error: Msg 7321, Level 16, State 2, Line 1 An error occurred while preparing the query "SELECT NAME,MAIL FROM "LDAP:///CN=foo,CN=Users,DC=bar,DC=com"" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI". This is after execut...

Best FTP server for Windows with Active Directory integration

I'm looking for an FTP server product with Active Directory integration for installation on a Windows server. I have been looking at different products, but I have a hard time finding a product, which has a decent Active Directory integration. I need something that integrates properly with Active Directory groups and is able to "merge" ...

C# Looping through an array to create Active Directory OUs

I'm trying to create nested Organizational Units in Active Directory and I'm close to having this working. I have a problem line below that I need help with. I'm checking if an OU exists and if not I need to create it, strOUArray contains OU=Test OU=Test2 and OU=Test3. I need the code to create OU=Test first and then use this as the pare...

Using AD as authentication for Django

I'm working on a Django-based application in a corporate environment and would like to use the existing Active Directory system for authentication of users (so they don't get yet another login/password combo). I would also like to continue to use Django's user authorization / permission system to manage user capabilities. Does anyone h...

ldap vbscript : msExchOmaAdminWirelessEnable is randomly missing on different accounts

In my script: Function getDescript (strname, uname) Set MyUser = GetObject ("LDAP://cn=" & uname & ",ou=" & strname & ",DC=tms-1,DC=net") getDescript = myUser.Get("msExchOmaAdminWirelessEnable") End Function uname = "Bob Gardner" strname = "bgConsultants" WScript.Echo "wireless enable: " & getDescript(strname, uname) I have n...

How do I programatically modify information stored in Active Directory using .NET?

I'd like to write a .net program to update active directory data in an existing field, or extend the schema to add a new field. Does anyone know the best way to go about this? ...

Getting description field from Active Directory in MSSQL2005 (LDAP)

The only field i cannot grab is the 'description' field from our AD. The error is: Cannot get the data of the row from the OLE DB provider "ADsDSOObject" for linked server "ADSI". Could not convert the data value due to reasons other than sign mismatch or overflow. Is their some datatype i can use to handle the object it is trying to r...

LDAP won't update if cached data exists

We have an SELinux client that authenticates network users using LDAP connecting to an Active Directory server. Since our machines have to operate "untethered," we have to use nscd to cache group and passwd info. Here's the issue. If we change group information on the Active Directory server, then log in on the client, if a cache exists...

How can I recursively browse all content of IIS?

I have the following program to browse all virtual directories and their sub directories and files (recursively): static void Main(string[] args) { string serverName = Environment.MachineName; DirectoryEntry dir = new DirectoryEntry("IIS://" + serverName + "/W3SVC/1/ROOT", @"adminusername", @"password"); ...

How to configure Tomcat to use Windows NTLM authentication?

I would like to use NTLM authentication with Tomcat so that Iexplorer send automatically both the user id+pwd to webapp. Is this possible? With "BASIC" authentication IE pops up the usual pwd dialog but I want to skip this dialog. ( Note, I use JNDIReal/ldap) ...

Why am I getting 'System.__ComObject' from my LDAP property?

I'll be the first to admit that this is cut and past programming. I've never looked at AD before, and really don't understand it. I suppose that's my next study... Anyways, This is some test code, which should display the expiry date -- either as something readable, or in ticks -- it doesn't matter. (It's a web form, which is running ...

Apache/Tomcat - LDAP Authentication based on AD Group Membership

We currently have an Apache/Tomcat (5.5) application running and we're using the LDAP authentication feature (by configuring the realm) against a multi domain structure and it's working great. One thing we would like to do is limit access to users based on their membership on a specific group in AD. Basically, only users of GroupA will...

Why doesn't Crystal Server pick up a user's (new) active directory groups?

We are running Crystal Reports Server 11.5. We have set it up for AD authentication and I have mapped the correct groups under Authentication in the CMC. The issue we are having is that when a user is added to a group in AD, Crystal Server does not pick up this change. The really weird thing is that if you go to CMC and view the Group's...

Error HRESULT E_FAIL when creating Exchange mailbox (CDOEXM.IMailboxStore.CreateMailbox)

I am trying to automate the process of creating an Exchange Mailbox for AD users and am running into an issue. When calling the CreateMailbox method I am receiving the error "Error HRESULT E_FAIL has been returned from a call to a COM component". I have installed and referenced the Exchange Management Tools and am using impersonation f...

How can I find the IP of Active Directory Domain Controller(s) from Unix?

I can get the nameserver via NSLOOKUP on a Windows machine and get an AD DC via a WMI VBS script, but I can't use the VBS script from a Unix server ( which can ping the nameserver). I'd like to use Java to obtain all the Active Directory domain controllers from a Unix box. Is this possible? ...