Skip to content

Instantly share code, notes, and snippets.

View ZackWhiteIT's full-sized avatar

Zack White ZackWhiteIT

View GitHub Profile
@ZackWhiteIT
ZackWhiteIT / Get-ADUserInfo.ps1
Created April 1, 2020 22:19 — forked from 9to5IT/Get-ADUserInfo.ps1
PowerShell: Get Active Directory User Information
Import-Module ActiveDirectory
$aResults = @()
$List = Get-Content ".\List.txt"
ForEach($Item in $List){
$Item = $Item.Trim()
$User = Get-ADUser -Filter{displayName -like $Item -and SamAccountName -notlike "admin-*" -and Enabled -eq $True} -Properties SamAccountName, GivenName, Surname, telephoneNumber, mail
$hItemDetails = New-Object -TypeName psobject -Property @{