Skip to content

Instantly share code, notes, and snippets.

@Rugby-Ball
Last active November 3, 2023 17:19
Show Gist options
  • Select an option

  • Save Rugby-Ball/a4ff85e67aaf0b6bfe2f93ff218e70bf to your computer and use it in GitHub Desktop.

Select an option

Save Rugby-Ball/a4ff85e67aaf0b6bfe2f93ff218e70bf to your computer and use it in GitHub Desktop.
Pull information on an Active Directory user #Utility #Public #Security #Active_Directory #Snippet
# ad-user-information.ps1
# 11/1/2023
# Requires PowerShell AD Module to be installed.
# This website shows how to do this: https://4sysops.com/wiki/how-to-install-the-powershell-active-directory-module/
# This will pull information on a user in your Active Directroy.
# if you add | clip for Windows or | pbcopy for MacOS at the end of script, output will go to the clipboard.
Get-ADUser -Filter "Name -like '*chris*'" -Properties * | select @{n="DateRun";e={get-date -f "MM/dd/yyyy hh:mm tt"}},AccountExpirationDate, CanonicalName, CN, Company, createTimeStamp, SamAccountName, DisplayName, EmailAddress,LastLogonDate,logonCount,PasswordExpired,PasswordLastSet,enabled,LockedOut,Manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment