Avatar of tonelm54
tonelm54

asked on 

Get-ADUser(s)

Ive got a simple PowerShell script, which checks an account for when the password was last set:-
Get-ADUser -identity tony.cross -properties passwordlastset | sort name | ft Name, passwordlastset

Open in new window


But I want to check several users. Short of putting them into an array and checking each one at a time, is there a way I can put them in an array and check them all, eg:-
$arr = ['tony.cross', 'user4', 'user3']
Get-ADUser -identity $arr -properties passwordlastset | sort name | ft Name, passwordlastset

Open in new window


Any ideas?
PowershellActive Directory

Avatar of undefined
Last Comment
Shabarinath TR

8/22/2022 - Mon