Questions tagged [adsi]

Active Directory Services Interfaces

Microsoft's implementation of LDAP, ADSI is the protocol Windows computers use to maintain a domain relationship, including groups, Organizational Units (OU's), domain controllers, etc.

268 questions
59
votes
3 answers

IIS application using application pool identity loses primary token?

(This is a question about a vague problem. I try to present all relevant data, in the hope that someone has helpful information; apologies for the long description.) Our web app We have a .NET 4 web application running in IIS 7.5 accessing Active…
26
votes
5 answers

Memory Leak when using DirectorySearcher.FindAll()

I have a long running process that needs to do a lot of queries on Active Directory quite often. For this purpose I have been using the System.DirectoryServices namespace, using the DirectorySearcher and DirectoryEntry classes. I have noticed a…
Can Gencer
  • 8,822
  • 5
  • 33
  • 52
18
votes
5 answers

Full name rather than the domain id in User.Identity.Name

The User.Identity.Name property returns the domain login id. Which class/property exposes the actual user name? For user "John Doe" who logs into the web application supplying my_domain\jdoe **User.Identity.Name -** Returns :…
adsi_help
14
votes
4 answers

Active Directory user password expiration date .NET/OU Group Policy

I have searched the site for information and found this: ASP.NET C# Active Directory - See how long before a user's password expires which explains how to get the value of when the password expires as per Domain Policy. My question is this: what if…
dexter
  • 7,063
  • 9
  • 54
  • 71
11
votes
2 answers

In active directory, what is mailNickname used for?

In active directory, should mailNickname always equal samaccountname? Or, should it always be equal to the mail property (minus the "@domain")? My reason for asking is that we have recently changed everyone's primary email address to the first.last…
dotjoe
  • 26,242
  • 5
  • 63
  • 77
10
votes
4 answers

Print Local Group Members in PowerShell 5.0

I use the following code to determine members of the local Administrators group: $obj_group =…
myron-semack
  • 6,259
  • 1
  • 26
  • 38
10
votes
4 answers

ADsOpenObject() returns -2147024882 (0x8007000E) -> OUT_OF_MEMORY

I have a C++ DLL that is used for authentication that gets loaded by a Windows service for every login. In that DLL I use the Windows ADSI function ADsOpenObject() to get a user object from Active Directory. HRESULT hr =…
juergen d
  • 201,996
  • 37
  • 293
  • 362
9
votes
1 answer

How do I query effective permissions on an Active Directory Object?

I'm trying to programmatically determine whether the current user has certain permissions on a given Active Directory object (specifically in this case, I'm trying to determine whether the user has the "Send As" permission for another Exchange user…
Oliver Giesen
  • 9,129
  • 6
  • 46
  • 82
9
votes
2 answers

list all local users using directory services

The following method I created seem does not work. An error always happens on foreach loop. NotSupportedException was unhandled...The provider does not support searching and cannot search WinNT://WIN7,computer. I'm querying the local machine …
ikel
  • 1,790
  • 6
  • 31
  • 61
9
votes
4 answers

Best way to quickly determine whether a user account is a member of an AD group?

I currently have some code that pulls down a list of users in a group and then iterates through that group to determine if a given account exists, but it seems like there ought to be a more concise (and perhaps faster) way to accomplish this. This…
JohnFx
  • 34,542
  • 18
  • 104
  • 162
9
votes
1 answer

How to set connection time out when establishing context - PrincipalContext

using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain, Domain, UserName, Password)) { UserPrincipal U = new UserPrincipal(ctx); U.GivenName = strFirstName; U.Surname =…
StackTrace
  • 9,190
  • 36
  • 114
  • 202
9
votes
1 answer

Add IIS AppPool\ASP.NET v4.0 to local windows group

I'm trying to script with PowerShell the act of adding the user IIS AppPool\ASP.NET v4.0 to the Performance Monitor Users group, to be able to use custom performance counters from an ASP.NET application. But, I can't figure out how to address the…
Erik A. Brandstadmoen
  • 10,430
  • 2
  • 37
  • 55
7
votes
2 answers

Query AD Group Membership Recursively Through SQL

Background I'm creating some SQL to assist with security auditing; this will take security info from various systems databases and from Active Directory and will produce a list of all anomalies (i.e. cases where accounts are closed in one system but…
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
7
votes
1 answer

Using LDAP or ADSI with Delphi for user account management

We have a large Transaction Processing System (batch processing) ERP Solution for large Healthcare claims processing organizations and businesses. We currently implement our own user account management. i.e., a user with the appropriate rights/roles…
JakeSays
  • 2,048
  • 8
  • 29
  • 43
6
votes
3 answers

Setting "Log on as a service" and "Allow logon locally" with ADSI

I am trying to create a powershell script to automate user creation which is working great using ADSI. However I need to set the following properties and I am not sure how (or if ADSI can even do this): Log on as a service Allow logon locally Any…
Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
1
2 3
17 18