Questions tagged [principalsearcher]
21 questions
0
votes
0 answers
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 style of query, everything I have seen are only equal…

P S
- 23
- 1
- 3
0
votes
2 answers
Get AD Groups with ASP.NET WebAPI C# not working on Windows Server 2016 Datacenter
I have a ASP.NET Web API Application which loads all the Groups which contains a Specific Name from Active Directory into internal Database.
This was working on Dev. PC (Windows 10), Testserver and old Productive Server (Windows Server 2012 R2)
But…

Osti
- 43
- 6
0
votes
1 answer
How can I find computers with LastLogonTimestamp less than a certain date OR null
The following code returns all the computerprincipals that have logon date prior to 3 months ago but does not get those with null for a lastlogontimestamp
PrincipalContext context = new…

dragonspeed
- 255
- 2
- 13
0
votes
1 answer
PrincipalSearcher Wrong Username Or Password error
I'm trying to get user data from the active directory. Authentication process is true.
var context = new PrincipalContext(ContextType.Domain, "localhost-ad.local", "OU=LocalOu,DC=localhost-ad,DC=local", ContextOptions.Negotiate);
var login =…

Gökhan YILDIZ
- 131
- 3
- 16
0
votes
1 answer
DirectorySearcher doesn't respect the SizeLimit property if the SizeLimit is 256 or over
I'm using PrincipalSearcher and DirectorySearcher to filter users and specify which properties to grab. On testing it on 2 different networks. One network has 8K+ records and the other has 135K+. On the 135K+ network, it fails to save the records to…

ernest
- 1,633
- 2
- 30
- 48
0
votes
1 answer
How would i assign only DisplayName and Name from PrincipalSearcher to List?
I have the following sample code:
namespace DirectorySearcher
{
class Program
{
static void Main(string[] args)
{
using (var context = new PrincipalContext(ContextType.Domain, "bobo.net"))
{
using (var…

Dwayne Dibbley
- 355
- 3
- 20