Click here to Skip to main content
15,892,269 members
Everything / Active Directory

Active Directory

active-directory

Great Reads

by DotNetLead.com
Azure AD for authentication and authorization of users for your website
by saddam abu ghaida
Active Directory Web services which handles Authentication, SSO for other apps, aside from Native Routines
by Gareth Barlow (NBNi)
Integrating Roles Based Access Control with the Azure Active Directory Graph API in a ASP.net MVC application
by pckola
Accessing userProxy, userProxyFull From AD Light Weight Directory Services

Latest Articles

by aniapp_
Use Microsoft.Graph.Auth to work with Azure AD
by Bruno van Dooren
Basics of Service Principal names, and what they mean for SQL Server security
by Bruno van Dooren
When retrieving claims information from user token, SDK documentation concerning the supported data types is incorrect.
by Matt Pogue
I was reading a great article recently about subdomain enumeration services and it got me thinking about Let's Encrypt and internal domains.

All Articles

Sort by Score

Active Directory 

27 Oct 2015 by saddam abu ghaida
Active Directory Web services which handles Authentication, SSO for other apps, aside from Native Routines
2 Apr 2014 by Gareth Barlow (NBNi)
Integrating Roles Based Access Control with the Azure Active Directory Graph API in a ASP.net MVC application
4 Mar 2014 by pckola
Accessing userProxy, userProxyFull From AD Light Weight Directory Services
19 Aug 2014 by Jinan Kordab
This article and tip describes how to create or delete an Active Directory Services Email using ASP.NET web page, remotely.
20 May 2016 by ZurdoDev
Second google result has an example from Microsoft. Creating Users with Active Directory Lightweight Directory Services (Windows)[^]For future reference, this is the type of question that is easily answered by asking google. You'll learn a lot more by doing research yourself first and...
18 Feb 2020 by MadMyche
The obvious reply is going to be not to use IE Chris Jackson, MS CyberSecurity Internet Explorer is a compatibility solution. We’re not supporting new web standards for it and, while many sites work fine, developers by and large just aren’t...
23 Oct 2013 by OriginalGriff
You can't do this:protected void b1_Click(object sender, EventArgs e) { ... return passwordz;A void method cannot return a value of any sort.And if you define a method that returns a value then:1) It cannot be used as the handler for an event,...
21 Feb 2014 by Chiranthaka Sampath
I have 2 SQL Servers, the details are as at the below. The New SQL Server is using to host the databases of the old SQL Database server. OLD SQL Server Windows Server 2008 R2 SQL Server 2008 R2 AD DS Installed & Added to a Domain named 'TheKingsburycmb.com' IP Static -...
26 May 2014 by Sergey Alexandrovich Kryukov
In any non-nonsense secured password-based system, no one can ever retrieve a password. Passwords are not stored anywhere; this is absolutely not needed for authentication but unsafe. No one is supposed to know a password, except a person who created it. To understand how it's possible, please...
5 Jun 2014 by stukselbax
I need to build a trees of domains in a forest. So far I have used the following code:using System.DirectoryServices.ActiveDirectory;...List domains = new List(); // flat list of domainsforeach (Domain dom in Forest.GetCurrentForest().Domains){ try { ...
22 Aug 2014 by rcgneo
Hello, I am trying to create a library using System.DirectoryServices.AccountManagement that will let users manage(add, delete, unlock,etc.) any Active Directory they want to manage. Whether they are using the code in a domain joined computer or not and supporting SSL. I am able...
23 Feb 2015 by ZurdoDev
You can use the System.DirectoryServices[^] namespace to run LDAP queries. A user could belong to multiple groups. I'd suggest googling for sample LDAP queries if you are unfamiliar with them.
23 Feb 2015 by judah9107
I've made a Login with Active Directory in Asp.net and C#, in my Local Pc it works fine, I can Login with Active Directory Users, but after I published the Application in the domain www.mydomain.com it doesn't work.I don't know if this is happening because to get the connection with Active...
23 Mar 2015 by Amogh Natu
This tip explains how to display forms authentication login page when using Active directory login instead of the general Windows authentication login pop up.
13 Apr 2015 by varmartins
I've been at this for a while and I'm always getting:System.DirectoryServices.AccountManagement.PrincipalServerDownExceptionWhich I think means my connection setup(connection string) is wrong.When I write "dsquery server" on cmd on the computer where the Active Directory is I...
9 Oct 2015 by galanderavi
My code for authentication with clear text is as below. How do i authenticate user with hash password? PrincipalContext adContext = new PrincipalContext(ContextType.Domain); UserPrincipal user = UserPrincipal.FindByIdentity(adContext,...
7 Apr 2016 by Richard Deeming
Assuming you mean VB.NET, you can use the System.DirectoryServices[^] assembly / namespace to query and update Active Directory.There are lots of examples on this site; for example: Querying Active Directory using .NET classes and LDAP queries[^]If you meant VB6 or earlier, you'd need...
15 Apr 2016 by Adeem Zanoub
Hello,I am not very good in English but I will try to explain my problem in simple as I can,I try to build web method in web service which create user in active directory,when I invoke this method locally from browser in server it work fine but when I invoke this method from browser in another...
9 May 2016 by Nathan Minier
You'll want to switch from forms to windows authentication and deny anonymous users. This should open a login...
3 Nov 2017 by Dave Kreskowiak
Yeah, that code is not starting the process on the remote machine. It's starting the process on whatever machine this code is running on. The Process class, IIRC, will not launch a process on a remote machine. WMI would be better suited to this and you can launch NON-INTERACTIVE remote...
6 Feb 2018 by an0ther1
The distinguished name for a Security Group includes the Organisational Unit, therefore instead of getting the Units in the first place, just query for all Groups public static List ListOu() { List ous = new List(); using (DirectoryEntry root = new...
16 Jul 2018 by Member 13721474
I am developing the WPF tool in other domainand I need to connect to the Active directory in other domain.How to connect? What I have tried: PrincipalContext context = new PrincipalContext(ContextType.Domain,stringDomainName); It is only taking the current domain .I needed the other domain.
21 Sep 2018 by Richard Deeming
Try PasswordLastSet instead of PwdLastSet. As far as I can see, there isn't a PwdAge property; you'll need to calculate it from the PasswordLastSet property. Something like this should work: Search-ADAccount -AccountInactive -TimeSpan 90 -UsersOnly -SearchBase "OU=User...
6 Nov 2018 by W.G.C.
If possible, use System.DirectoryServices.AccountManagement instead. Dim LocalMachineContext As DirectoryServices.AccountManagement.PrincipalContext Dim LocalGroupPrincipal As DirectoryServices.AccountManagement.GroupPrincipal Dim DomainContext As...
26 Dec 2018 by Dave Kreskowiak
OK, GetObject isn't really appropriate for this. This requires quite a bit more code to work properly. First, your code is hard-coding the directory path to "search", as your code doesn't really do any searching at all. It also hard-codes the IP to use. That's bad because if that server is down...
31 Dec 2018 by DataBytzAI
Active directory (AD) is not restricted to the Enterprise Network - it's also available on Azure Cloud.
30 Oct 2019 by Patrik Melander
A simple and straight forward example of how to configure Azure for access to Microsoft Graph. Sample code in C# included.
21 Feb 2020 by jaideepsinh
My problem get resolved in IE by deselecting Enable Integrated Windows Authentication option, located at "Internet Opetions-> Advanced -> Security-> Enable Integrated Windows Authentication".
28 Mar 2020 by phil.o
Weird to get distinct results by just changing the search method. I noticed that you do not use exact casing for LDAP property names. Could it be that a non-paged search performs case-insensitive searches, whereas a paged search would need proper...
26 May 2020 by Jeremy Likness
How can you connect securely without storing credentials in the client and hosting your own identity service? The solution is to use Azure Active Directory for authentication and communicate securely with a serverless Azure Function.
4 Jun 2020 by Kevin Mack
How to use the new Azure AD provider in Terraform
22 Apr 2022 by Matt Pogue
I was reading a great article recently about subdomain enumeration services and it got me thinking about Let's Encrypt and internal domains.
6 Oct 2022 by Bruno van Dooren
When retrieving claims information from user token, SDK documentation concerning the supported data types is incorrect.
4 Oct 2023 by aniapp_
Use Microsoft.Graph.Auth to work with Azure AD
8 Mar 2024 by Andre Oosthuizen
Your first issue is happening with this code - return pc.ValidateCredentials(username, password); No credentials were found, returning a 'NULL' value. The second part then, based on the NULL value is - // Redirect to login if username is...
9 Oct 2013 by Joseph Basil
Hi all,I have a active directory search in my project and works fine when i run from visual studio. But when i host the same in IIS it does not work. Can anybody please help?The following is the code i useSystem.DirectoryServices.DirectoryEntry entry = new...
9 Oct 2013 by zan07
Hi,I am working on a module which is gonna be used for our multiple projects.This module simply checks for Active Directory groups and users for each application.I want to manage all using windows authentication.I am able to allow and deny roles/users for single Application but not...
10 Oct 2013 by Joseph Basil
Actually the domain name it took a different one when i run from Visual Studio and a different one when i run from IIS.I identified it and got it cleared.Thanks all for your comments
15 Oct 2013 by Member 10337489
Hello im trying to create users in the AD with my code, i have a standard code that creates a user, but i would like to add some things such as SamAccountName + firstname + Lastname, all the code does now is to create a user called "TESTUSER" without any samaccount/passowrod etcusing...
15 Oct 2013 by Pheonyx
Have you bothered to do any substantial research? There are hundreds of articles on how to do this in various forms.There are even a few on this site.Infact this one:Howto: (Almost) Everything In Active Directory via C#[^]Comes top of a Google search for "c# active directy user...
15 Oct 2013 by Member 10337489
I have actually read just that article, but as many who tries it, some things there doesn't work. For example the section called "create_user.cs:"It's supposed to create a AD user but instead it generates alot of errors in the console.So i found this code that i just posted now, which...
22 Oct 2013 by MattFFunke
I'm attempting to use VB and ASP.NET 2.0 to read an ActiveDirectory group and determine whether the current user is in the group or not. The name is passed to the function in loginStr. It should be dead simple, but I'm getting weird results, and would appreciate it if someone could let me know...
22 Oct 2013 by laxmikant01
Try below codepublic bool VerifyUserGroup(string userName) { bool returnValue = false; PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "YOUR DOMAIN NAME"); UserPrincipal up = UserPrincipal.FindByIdentity(ctx,...
22 Oct 2013 by phil.o
For Each adsGrpcn In oResult.GetDirectoryEntry().Properties("memberOf").ValuesYou may put an extra 's' at the end of this line, and see if it does the trick.
23 Oct 2013 by Member 10337489
Hi guys, im working on a ASP.net project were i have bumped in to some errors this i probablly a rookie misstake here is what im trying to do:As you can see i have two "returns" how should i do this i really would like to have this random password thing =)You can see my error here it's a...
23 Oct 2013 by Member 10337489
What should i do then =) ?I really need this function, i could to it reallt easy and to it like this: object[] password = { "12345678ADWdddw" };and then user.Invoke("SetPassword", password);But this will set a static password, i would really like a randomized.
25 Oct 2013 by Matt T Heffron
It looks like you think you need a return to get the passwordz value out of the scope where it is built. You don't.Where are you declaring the object[] password that you pass to the createUser(...) ??You don't need for the password to be an object[].Read up on the params keyword. That is...
5 Nov 2013 by Vaibhav Aggarwal
Hi,I want to extract AD data using c#. I have used directory services, but not able to extract some attributes like lastlogon, tsallowlogon. Please help me by providing your inputs about other .net classes or sample code which can be used here. I cannot use quest cmdlets for some reason.Thanks
7 Nov 2013 by Prasad Avunoori
Hi,I need to get User sAMAccountName by passing EmployeeId to the active directory.Please help me.
9 Nov 2013 by Prashant. B. Chavan
Hi,Check below link, this may help you out.Get Username of ActiveDirectory[^]
17 Nov 2013 by madan.mohan2k6
Hi,How to check logged-in user name in Active Directory specific Group and make visible InfoPath Form view's with out custome code. Can some one please help me...Thanks,Madan.
19 Nov 2013 by Prasad Avunoori
Hi All,I want to retrieve Date of joining and Date of birth from Active directory by passing Login name in C#.Net.Thanks in Advance.Prasad Avunoori
26 Nov 2013 by FresherBoy
Hi guys~ how can i show active directory table on report viewer (rdlc)? i spend alot times to did some research but report viewer must have data sources or database to query. Is there anyway to display active directory results on report viewer (rdlc)? Wish can get some idea, information or...
26 Nov 2013 by phil.o
Since SSRS (SQL Server Reporting Services) are bound to SQL Server, as far as I know there must be some SQL Server database to query.So there must be a solution, but not a straightforward one as you seem to hope:0) Create a database according to informations you want to retrieve1) Query...
1 Dec 2013 by FresherBoy
Hi guys i can make AD results display on ReportViewer.Below is the solutions! private void ActiveDirectoryRecords_Load(object sender, EventArgs e) { DataTable dtable = new DataTable(); DataRow rows; dtable.Columns.Add("UserID"); ...
16 Dec 2013 by s#@!k
Hi,I need to implement authentication using remote service like"http://url.asmx" in my asp.net site.I think this is going to hit active directory/exchange server.I have added the url as webreference but didn't get exactly the authenticate method.. need help with some suggestions.
16 Dec 2013 by Ramadurai Uthami
I want to use Email-id as Login Name in Active directory. Is there any possible way to achieve this ?
17 Dec 2013 by ravikhoda
first of all your method should be public in the web service. you can access that method by web reference like this : webreference obj = new webreference ();Result objResut = obj.validateuser(username ,password);objresult can be anything based on the return value of your method....
6 Jan 2014 by Espen Harlinn
Connect to AD using something like this:var username = "your username";var password = "your password";var domain = "your domain";var ctx = new PrincipalContext(ContextType.Domain, domain, username, password);and then perform the operations using the PrincipalContext...
7 Jan 2014 by MichCl
I'm writing a backup program for our new server. I'm an administrator, and I'm learning a lot. The issue is that I can back up a file on the c:\ drive to the c:\ drive, but not for the drives on the SAN, like when I try to backup a file on the T drive (SAN) to the H drive (server). I tried using...
8 Feb 2014 by $ultaNn
i have to get list of users in a group of Active directory i have different group when user select the group name itshould fill the list of users belog to that group in gridview i am using below code for getting the list of user but its not getting all the users in Active Directory...
25 Feb 2014 by mrDivan
Good day everyone I am trying to access the log in event of the pc so when the user types his username and password and clicks login Does anyone know how to access that event using c# and activeDirectory.Thanks in advance
19 Mar 2014 by fasher_the_one
Hello,while I am developing a project where I use the asp.net DB, the membership there, where I create users, edit, give permissions, etc etc. .. all that is possible to do with these users. I integrated this DB with the db of my application to have a unique DB ... it's all working...
23 Mar 2014 by fasher_the_one
Hello,I have an application with its own database and authentication scheme logion (form authentication) now appeared a need for integration with Active Directory. I did some research on the subject and saw that first have to store the GUID of the User's account from AD. I need to do is...
27 Mar 2014 by ashok rathod
Probably users are not populating because after adding user your not performing acceptchanges operation on your datatable.after (resultsTable.Rows.Add(dr))so please update above code with this lines of code (Hear my assumption is that users are populated in searchresults (and...
3 Apr 2014 by Saurav Jaiswal
Hi,I need to call the Active Directory People finder to search people from my webpage?Is there a way in which I can do it programmatically?I am able to get the details of the person if I know the identity, but my requirement is to allow admin to select a person from the AD and then get...
3 Apr 2014 by Dave Kreskowiak
Your either going to go directly to ActiveDirectory with your own code to find what you want, or if you want to use PeopleFinder for some reason you'll have to ask the people who wrote PeopleFinder to see what interface they exposed to applications to use, if any.
26 May 2014 by Dinesh Reghunath
Just check the below URL. May be helpful.Working with Active Directory in VB .NET
29 Jun 2014 by Sangit Gurung
Hello Everyone i am trying to develop a program that will list will all the user of Active Directory and when i select one user the program should be able to show the computers associated with that user. i.e the Computers that are accessible to that AD user. I have written code to list all user...
16 Jul 2014 by wonder-FOOL
Hello dear CPians,I want to delete a active directory group by using PrincipalContext instead of using DirectoryEntry. Is this possible?I have found how to delete a group by using DirectoryEntry here[^]. Thanks in advance.
21 Jul 2014 by Member 10960629
I'm in need to supply users with an ability to change their password via webserver. The password is maintained by Active Directory and the password change shall be done by the users credentials without any administrative authorizations.This is easy for regular passwords:- bind with users...
25 Jul 2014 by Member 10971697
i've built a Web Form with Master Page that authenticates with Azure AD. It works great and all the users in the organiztion can login and access the site.However, I'd like to restrict all or parts of the site based on the security group they are a member of in AD.i can't figure out how...
3 Aug 2014 by aditya behara
Can any one help me with setting the password expiry date in AD using C#.I have come across some articles in msdn and stack overflow which show how to set the password expiry dates. But I have noticed that these methods or snippets are valid till Server 2003.I am having server...
3 Aug 2014 by _Amy
I think this is not possible. You can only mark the password as expired. See AD Password Policy[^]--Amy
2 Sep 2014 by Solai Raja
How do I create the Azure Active Directory and their Applications automatically?So far I walk through on on-line to automate the Creation of Azure's Web application, Mobiles Service and other things provided by Azure account has been quit easy to create using the power shell scripts.I...
5 Sep 2014 by Surendra1978
Hi,I have an asp .net application. It has been installed at many of our client's server under a domain and is working successfully with single sign on. A new client is added to our list where i got stuck with the Active Directory SSO issue. I have checked the settings in IIS for the...
5 Sep 2014 by Richard Deeming
No, you can't bypass the credential prompt if they've disabled automatic logon, or disabled the Local Intranet zone.If they're not prepared to work with you to resolve the issue, then they'll either have to live with the credential prompt, or solve the issue themselves. :)
11 Sep 2014 by Member 11029647
The bit I'm struggling with is when I run the code as per below it populates the table with an image of an X in a square box.If I run the code with Response.BinaryWrite as the command i get a blank screen with my thunbnailPhoto attribute displayed.I have spent 2 months trying to resolve...
11 Sep 2014 by Kishore Pogaru
check this http://stackoverflow.com/questions/14720929/is-there-anyway-to-display-dynamically-generated-bitmap-on-a-asp-image-control[^]
21 Sep 2014 by Member 11099342
How do I retrieve details of all users from AD and display them in my page using java. I need to display contact extension details from AD for all users on a single page?
8 Oct 2014 by Member 10960629
solved now, help no longer required.
28 Oct 2014 by Santhosh Kumar Chindam
Hi,am developing a Windows Store 8.1 app using C# and xaml.I am performing single sign on using Azure Active Directory Account login.Case 1: I have added few users in Active directory and log in with the "X User"credentials in the app.When i delete that X user in AD and i try...
28 Oct 2014 by Santhosh Kumar Chindam
Hi,Am developing a Windows Store 8.1 app using C# and xaml.In the app, Initially user will log in into the app using Azure Active directory single sign on log in(With Internet connection)But how to authenticate the user in Azure Active Directory when the user is not connected to the...
26 Nov 2014 by marimir
I have to do a project for a company . This is the situation :- The Computers are in a network under WORKGROUP- There is a local website running there- If they click on a specified link , then they should enter their the ActiveDirectory username & password for getting their user's info...
30 Nov 2014 by Santhosh Kumar Chindam
Hi am developing a windows store 8.1 app using C# and xamlFor log in, am authenticating the user with Windows Azure Active directory Single Sign-on using JavaScript back-end.Once the user is logged in and i have the access token, how to get the logged in user's user email id and Username...
4 Dec 2014 by Member 11241903
Because the IIS Server Manager doesn't have Windows AuthenticationMy concept is to pull username/ user info if it is the a user account in AD then the user is able to access the ASP.NET website.
4 Dec 2014 by Thanks7872
See these links. It should help youHowto: (Almost) Everything In Active Directory via C#[^]Application Login through Active Directory (LDAP)[^]http://serverfault.com/a/130556[^]http://stackoverflow.com/a/11459729/2645738[^]Regards..
10 Dec 2014 by Sanket Saxena
Hi,I have an web application hosted on a server outside the client network and the client wants to provide the facility to there internal users to access that web application using their AD account. As per AD/Windows Authentication the client and server should be on same network but in...
10 Dec 2014 by Kornfeld Eliyahu Peter
In some way AD must be accessible for the site, otherwise authentication is impossible...There is a Microsoft document on how to expose your AD directory services to sites on the DMZ - http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=3957[^]If it helps you may read this...
19 Dec 2014 by ponnapureddy
I have the requirement like below.I want to get maxPwdAge value for specific Organization Unit or Group wise.Anybody help me how to do it. I am able to get domain level maxPwdAge like below long maxPwdAge=0; string domain="LDAP://10.10.1.100/OU=Dev,DC=test,DC=com"; ...
28 Dec 2014 by Yesudass Moses
Hi,I am having SQL Server 2008 on my local system. I can create and manage databases through Management Studio from the Local Administrator account.But when I try to access or create database from my Domain Account, It shows this error. "CREATE DATABASE permission denied in database...
28 Dec 2014 by Arjsrya
You should have administrator rights in your machine.follow below steps to add users or groups1.Right click on the My Computer and Select Manage2.Go to Local users and Groups & add respective users and groups.3.Restart the machine.
30 Dec 2014 by shaprpuff
I want to save the Department ABCD+ here + should be save as super script.currently i am storing it by string only but when i use in signature it displays ABCD+ where + does not display as super scripted.
30 Dec 2014 by Dave Kreskowiak
You can't. Superscript is a font formatting thing and that stuff isn't stored in Active Directory. You can only store a plain old string, without any formatting.
6 Jan 2015 by Member 11194850
Hello, Am writing a vb.net code where I want to retrieve the email address associated with a Distribution list (not the email addresses mapped in the DL). For example, if there is a DL named ABC-Support and its associated mail id is ABC-Support@example.com. In my application when a user...
6 Jan 2015 by odicha
HiIf you look at your query, you filter it and only receive usersdsSearchDir.Filter = "(&(objectClass=user)(|(displayName=" + strPRID + ") It might be (objectClass=User)(objectClass=Group) for also reading groups (DLs)