I was cleaning up a new directory and found the krbtgt account password hadn’t been reset for over two decades. When I tried resetting it, I could not due to complexity requirements.
Each DC in an AD domain runs a Kerberos Distribution Center (KDC) service that handles all Kerberos ticket requests. AD uses the krbtgt account for Kerberos tickets. This account is an important one and can be used in attacks, such as Golden Ticket attacks: https://techcommunity.microsoft.com/t5/security-compliance-and-identity/how-microsoft-advanced-threat-analytics-detects-golden-ticket/ba-p/250341
I was asked to get a baseline for generating reports within AD. The two important pieces of information which were required to generate these reports were the ip address and FQDN of each domain controller. The script would then connect to each individual system to gather data. While I was at it, I added the MAC Address just to see what other pieces of data would be useful out of the Win32_NetworkAdapterConfiguration class.
I was recently asked to get a quick report of all Windows 7 computers within a multi-domain AD forest. After banging my head into the keyboard for a while, I finally figured it out. The script below should do the trick.
Also, if you use the OperatingSystemVersion attribute, you will find that Server 2008 R2 shares version “6.1 (7600)". So, the best way to find Windows 7 only, is to search for “Windows 7*” with the wildcard character against the OperatingSystem attribute. That will ensure all Windows 7 versions are returned and will exclude Server 2008 R2 from your results.
Here is a little script I put together for one of our developers here at work. Feel free to use, abuse, change, tweak, fix, etc.
'* Script name: List All Attributes.vbs '* Created on: 01/28/2009 '* Author: Andrew J Healey '* Purpose: Exports all attributes from the user object type within '* the Active Directory schema. '* Usage: cscript /nologo "list all attributes.vbs" > Attributes.csv '* History: Andrew J Healey 01/28/2009 '* - Created script ' Option Explicit 'Declarations Dim objUserClass : Set objUserClass = GetObject("LDAP://schema/user") Dim objSchemaClass : Set objSchemaClass = GetObject(objUserClass.Parent) wscript.echo chr(34) & "Mandatory" & chr(34) & "," & _ chr(34) & "Name" & chr(34) & "," & _ chr(34) & "Syntax" & chr(34) & "," & _ chr(34) & "Single/Multi Valued" & chr(34) Call GetAttributes(objUserClass.MandatoryProperties,objSchemaClass,True) Call GetAttributes(objUserClass.OptionalProperties,objSchemaClass,False) Private Sub GetAttributes(x,y,z) Dim strAttribute 'Loop through all attributes For Each strAttribute in x Dim strOut : strOut = "" 'Compares whether the attribute is mandatory or optional 'Prints whether mandatory/optional and name of attribute If z = True then strOut = strOut & chr(34) & "Yes" & chr(34) & "," & _ chr(34) & strAttribute & chr(34) & "," Else strOut = strOut & chr(34) & "No" & chr(34) & "," & _ chr(34) & strAttribute & chr(34) & "," End If 'Get the attributes syntax: i.e. Integer, String, NumericString, etc. Dim objAttribute : Set objAttribute = y.GetObject("Property", strAttribute) strOut = strOut & chr(34) & objAttribute.Syntax & chr(34) & "," 'Determines whether column holds multi or single values If objAttribute.MultiValued Then strOut = strOut & chr(34) & "Multi" & chr(34) Else strOut = strOut & chr(34) & "Single" & chr(34) End If 'Print string to screen. Each line its own CSV. wscript.echo strOut strOut = Empty Next Set objAttribute = Nothing strAttribute = Empty End Sub
The other day I was contacted by a Cpt Miller with the Connecticut Army National Guard (CTARNG). It turns out that the entire CTARNG uses the program I wrote called Active Directory UserMod Assistant. Cpt Miller needed some modifications made to make it work in his environment. I was able to help him out with his mods. It was a bit odd getting a request like that in Iraq. He didn’t know I was here but it was nice knowing that the program I wrote is helping out the Military.
I finally got around to a new release of Active Directory UserMod Assistant -> adumass.
This was a major release as it fixed some pretty serious bugs and also greatly improved the UI and back end code. I also added a few functions for data validation.
Thanks to all those that have helped and submitted support requests. The next version should have a translation pack for those users that want to help with translations.