Avatar of ivan rosa
ivan rosa
Flag for United States of America

asked on 

Adding a filter to a property

Hi Folks,

i have wrote this line here to get a count of all users from an OU
(Get-ADUser -Filter "objectcategory -eq 'user'" -SearchBase "OU=microsoft=com").count

Open in new window


however i'm also trying to add a filter where it would only select active users... this line here i know will pick this specifici object but I don't know how to tell it just to pick the ones that are active
(Get-ADUser -Filter "objectcategory -eq 'user'" -SearchBase "ou=microsoft=com" -properties * | select-object enabled).count

Open in new window


does anybody have any idea on how to accompllish it?

thanks for looking
Powershell

Avatar of undefined
Last Comment
footech

8/22/2022 - Mon