• Pingback: Windows Server Operating System Security Hardening | Cloud Solutions Architect()

  • Pingback: Active Directory Health Check, Audit and Remediation Scripts()

  • Jeff Brosius

    First, you’re a life saver. This script does about 90% of what I want for my customers. Well, technically, it does MORE than what I need.

    I made some minor tweaks to what data is collected (added GivenName and SurName to the $obj | add-Member” section), and the script runs great.

    Here’s my only issue: I can’t get the csv to export correctly. It puts all of the following into the first column of the CSV file: Account User Name;First Name;UACValue;Flags;LastLogon)

    Any ideas?

    Thanks!

    • Hi Jeff,

      Thanks for the awesome feedback!

      Yes, I had some bad habits with some earlier scripts.

      The output will be due to the delimiter, so change it to a comma instead of a semi-colon.

      You’ll also need to change the following line…
      $obj | Add-Member -MemberType NoteProperty -Name “Flags” -value ([string]::Join(“,”,($flags)))
      to…
      $obj | Add-Member -MemberType NoteProperty -Name “Flags” -value ([string]::Join(“|”,($flags)))
      So we’re separating the flags with a character other than a comma.

      Hope that helps.

      Cheers,
      Jeremy

Previous post:

Next post: