I am trying to build an application to monitor for account lockouts on my Active Directory server. Has anyone done this? What type of component monitor would it be?
Is it safe to assume you're not interesting in using the Log Forwarder for Windows?
Here's a previous thread on the topic with some ideas:
Well, I realized that Syslog was one way to go, but I would like to do it with APM if at all possible.
Would this be a WMI Monitor, and if so, which type?
C#.net solutionall the "_" variables are strings==================================
try { PrincipalContext insPrincipalContext = new PrincipalContext(ContextType.Domain, _domainName, _domainContent, _adminUserName, _adminPassword); UserPrincipal insUserPrincipal = new UserPrincipal(insPrincipalContext); insUserPrincipal.Name = "*"; PrincipalSearcher insPrincipalSearcher = new PrincipalSearcher(); insPrincipalSearcher.QueryFilter = insUserPrincipal; PrincipalSearchResult<Principal> results = insPrincipalSearcher.FindAll(); foreach (UserPrincipal p in results) { if (p.IsAccountLockedOut()) { lbxLockedUsers.Items.Add(p); } } insPrincipalContext.Dispose(); insPrincipalSearcher.Dispose(); insUserPrincipal.Dispose(); results.Dispose(); }====================================GET LIKE ME NERDS!!!!!!
Zeik, that code looks fantastic. Thanks for sharing.
You've inspired me to create this application template for immediate use in APM.
">
Borgan: Could you please download this, and validate it. I tested it with and without trust relationships, and provide a 'prefix' switch so people can target a specific OU. Please have a read of the comments before use!
Peter, I dunno what APM is, I'm very unfamiliar with most of the solar wind product line. We only use 1 product at work and the IT guys use it. I'm Mostly a .NET developer.