Admittedly i am fairly new to powershell but this is proving more complicated than it needs to be. I have been asked to export all users from AD and then filter out any user with an employee id that is not the standard form of 6 numbers. I have tried to output all users using the following one liner which gives me all the data including non standard employee ids
get-aduser-filter {employeeid-like"*"-andmail -like"*" } -Propertiesdistinguishedname,mail,employeeid|Select-Objectemployeeid,mail, distinguishedname
i now need to whittle that down to only employee ids that are 6 numbers in length and exclude all characters. I have tried using match instead of like to filter but it seems that is not allowed.
Thanks