Avatar of kuzum
kuzum
 asked on

powershell to pull All AD accounts

Can you please let me know how to get All Enabled user accounts with their names, surnames, usernames? you can change below code

Search-ADAccount -AccountInactive -TimeSpan 30.00:00:00 -UsersOnly | where {$_.Enabled -eq $true -and $_.Name -notlike "SystemMailbox*" -and $_.Name -notlike "SVC_*"} | Get-ADuser -pr LastLogonTimestamp | Select Name,GivenName,Surname,samaccountname,@{N='LastLogon'; E={[DateTime]::FromFileTime($_.LastLogonTimestamp)}},Enabled | Export-csv C:\temp\test1.csv -nti


report needs to exclude anything with "svc_" system mailbox"
thanks
PowershellActive DirectoryScripting Languages

Avatar of undefined
Last Comment
SubSun

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
SubSun

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck