active-directory

C# How do I disable interactive login for a local user account. Similar to Network Service account

I've created a special user account for my applications use, and I need to know how to disable the interactive login feature so that it's only available as a system account. Right now any machine I deploy this application on, the user shows up in the login menu. Any help is appreciated. Is it a setting on the account or a GPO? ...

Active Directory query for username, first name, last name and email

Pardon my ignorance, I do not know much about AD (let lone querying with AD or googling for that). I would like to get a list of all the users in a particular domain, their first name, last name and email ids. Would a network admin (or help desk in my case) be able to do that ? My other option: I have the usernames in an excel sheet, Ful...

Get Groups From OU using DirectoryServices.AccountManagement

Hello, I'd like to use AccountManagement to list all the groups in an Organizational Unit. The following snippet works with DirectoryServices but I would have to instanciate GroupPrincipal with the DirectoryEntry path in the result (which feels like a dirty fix). DirectoryEntry root = new DirectoryEntry("LDAP://OU=Marketing,OU=Operat...

Get address of group of users from Exchange 2010 via web services SDK

We would like to display a list of address. We are trying to design a system where the addresses are only stored in one place, that place being Exchange 2010. Is there a web service in the Exchange 2010 SDK, that allows us to get the names and address of all users in a group? Is there a better way to do this, for example getting the da...

Poor Performance with WindowsTokenRoleProvider

I'm using WindowsTokenRoleProvider to determine Active Directory group membership in an ASP.NET web application. My problem is that performance is not good, especially when a user is in many groups. As an example, I am in 253(!) groups, and WindowsTokenRoleProvider is taking around 150 seconds to determine what groups I am in. I know I...

Active Directory generates DNS record for internal replication interface

I have an active directory domain controller in the 10.1.x.x address space that hosts some files. These files are replicated using DFS-R to a second machine over a crossover cable on a dedicated interface in the 192.168.x.x address space. The replication setup works great, but the domain controller keeps creating a DNS A record that poi...

iPhone and Windows Active Directory

Is it posable to make an app that can connect to a Windows Active Directory Server and do something like create a new user account or disable an existing account or retrieve a status flag...? help me please...! What i actually want is that, my windows server has all the web services and database which is capable to run a web application...

Find servers using Active Directory

Hi, is it possible to querry an Active Directory for servers? In detail i want to retrieve information about instances of MS Sql-/Sharepoint-/IIS-/ and AnalysisService-servers of a domain using C#. Which attributes do i have to check in order to find out which service is running on a machine? If it is not possible to get this information...

Integrating AD with web application running on Tomcat

Hello all Am trying to change my web application using AD for authentication. My application uses Tomcat 5.5.17. Currently it uses UserDatabaseRealm to authenticate users of the application. After reading many posts here, I used the following configuration in server.xml. (Since am just getting started, I didn't bother about roles). ...

adding a mail contact into AD

Hi, I am looking for a bit of guidence on how to create mail contacts in AD. This is a follow on question from SO Q#1861336. What I am trying to do is add a load of contact objects into an OU in Active Directory. I've been using the examples on CodeProject, however they only show how to make new user etc. How do I create a conta...

ForeignSecurityPrincipals with LDAP connection on Active Directory servers with trusted forest

The context is the following : Two domains mutually trusted dc=dom1 dc=dom2 a group cn=group1,ou=someou,dc=dom1 with users inside : cn=user11,ou=anotherou,dc=dom1 cn=user12,ou=anotherou,dc=dom1 cn=user13,ou=anotherou,dc=dom1 cn=user21,ou=anotherou,dc=dom2 cn=user22,ou=anotherou,dc=dom2 cn=user23,ou=anotherou,dc=dom2 The que...

How to search Active Directory for all objects that a user/group has permissions on

Is there a way to search Active Directory to find all objects that a user/group has permissions on? Can you, for example, use the DirectorySearcher object and a filter? ...

Checking if a user exists in an ou

Hi, I want check if a selected user exists within an OU (by the username he/she logs on to), what the rightest way to get this done? After that I want to select the user and change his/her password. I found some help here: http://www.codeproject.com/KB/system/everythingInAD.aspx#46 But the code I found looked like this: public stat...

What is the C# analog of this VBScript code that checks the Active Directory password expiration?

I have the following VBScript script that checks the password expiration of an Active Directory user account. Could someone please help me convert this code to C#? Thanks a lot. Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000 Const E_ADS_PROPERTY_NOT_FOUND = &h8000500D Const ONE_HUNDRED_NANOSECOND = .000000100 Const SECONDS_IN_DAY ...

Get a user's group memberships from Active Directory

How can I about getting a user's group memberships from AD, preferably using the same pattern as I use to get the user's Department property, as below? I have found several examples, but the intersecting set of all example techniques is quite small, and lacks the tightness and simplicity of this Department query: var adServer =...

Domain.GetDomain(...) fails when called from a web service

I have the following code in a class that is called from a web service: NetworkCredential credentials = new NetworkCredential("user", "password"); connection = new LdapConnection("domain"); connection.Bind(credentials); DirectoryContext directoryContext = new DirectoryContext(DirectoryContextType.Domain, "domain"); // This call...

Monitoring Active Directory events

How can I programatically detect any changes that occur to Microsoft's Active Directory? ...

How to upload an image file to Active Directory user profile in C# ?

I need a method which will take an *.jpg image file and upload it to a user profile in the Active Directory of Windows AD 2003. Also a method to retrieve the photo as stream or expose it as secure web service to be called by cross platform apps in java etc (Damn! am I asking too much!!!) The file being uploaded will be a *.jpg which i...

Change Local user settings from within c#

I need to write a program that will take a existing local windows user, change the "Start the following program at logon field" in their environment tab and change the password to a new password. I am using local users instead of AD, will System.DirectoryServices work? Also any tutorials on using System.DirectoryServices would be very h...

LDAP Query with sub result

I have been banging my head for quite a while with this and can't get it to work. I have a LDAP Query I do have working in AD Users and Computers but dont know how to do it programatically in C#. Here are my LDAP Query that works fine in the AD Tool: (memberOf=CN=AccRght,OU=Groups,OU=P,OU=Server,DC=mydomain,DC=com)(objectCategory=user)(...