Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
166 views

Using PrincipalSearcher to find users matching pattern

I have a somewhat particular situation I couldn't find answers to through google. I need to query my active directory for users whose SAMAccountName fits a particular pattern (3 letters followed by 4 ...
mvi2110's user avatar
  • 31
0 votes
0 answers
79 views

Is there a way of searching for a list of users on AD who have not logged on in the last year?

I am trying to find a way of getting a list of UserPrincipal objects that have not logged in for a year. There is a Last Logon property on the object, but I can't figure out how to do a less than ...
P S's user avatar
  • 33
1 vote
1 answer
535 views

Find if Active Directory is Enabled/Disabled with Email

I'm trying to find if a user has an Active Directory account by searching with their email address and checking the Enabled property (if I return Enabled as true - run code, if I return false - run ...
bubbajake00's user avatar
1 vote
1 answer
7k views

Complex Search Filtering with PrincipalSearcher

I am searching in Active Directory for specific SamAccountName values using the PrincipalSearcher object because I want to return UserPrincipal's. I was wondering how I can apply two filters to that ...
BlueBarren's user avatar
6 votes
2 answers
5k views

Extend UserPrincipal class

I do the extension of the UserPrincipal class to retrieve some missing properties that i need: [DirectoryObjectClass("user")] [DirectoryRdnPrefix("CN")] class UserPrincipalExt : UserPrincipal { ...
Matt's user avatar
  • 95
1 vote
2 answers
5k views

Search Users in Active Directory based on First Name, Last Name and Display Name

I trying to search my organization Active directory for users. If the FirstName or LastName or DisplayName matches a particular string value, it should return the users. My Code: // create your ...
Ramesh Durai's user avatar
  • 2,686