Created
November 3, 2017 19:45
-
-
Save faststeak/f86839f54b8cd6b0423773b7960f6cf8 to your computer and use it in GitHub Desktop.
Splunk search for deleted systems from Active Directory data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index=msad earliest=-1y sourcetype=activedirectory Computer | |
| makemv delim="|" objectClass | |
| search objectClass=computer | |
| makemv delim="|" memberOf | |
| makemv delim="|" servicePrincipalName | |
| stats last(objectClass) as objectClass last(distinguishedName) as distinguishedName last(sAMAccountName) as sAMAccountName last(cn) as cn last(userAccountControl) as userAccountControl last(isDisabled) as isDisabled last(isDeleted) as isDeleted last(whenChanged) as whenChanged last(whenCreated) as whenCreated last(dNSHostName) as dNSHostName last(operatingSystem) as operatingSystem by objectSid | |
| search isDeleted=True | |
| eval nt_host=if(like(operatingSystem,"Windows%"), (upper(substr(sAMAccountName, 1, len(sAMAccountName)-1))), null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment