Share via

Export users from AD

Glenn Maxwell 13,761 Reputation points
2022-08-08T18:55:43.78+00:00

Hi All

We have office in Ireland. for few users office location in Active Directory is given are Dublin, Ireland and for few users it is given as Remote, Ireland
I want to export the users with the office locations Dublin, Ireland & Remote, Ireland ,which of the below syntax is correct. i am not sure of Remote, Ireland

(Office -like '*Remote*' -and Office -like 'Ireland*') -or (Office -like '*Dublin, Ireland*')  
or  
(Office -like '*Remote*' -and Office -like '*Ireland*') -or (Office -like '*Dublin, Ireland*')  
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

Rich Matheisen 48,116 Reputation points
2022-08-08T21:01:45.773+00:00

Why complicate things?

(Office -like '*Remote, Ireland*' -or Office -like '*Dublin, Ireland*')  

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Glenn Maxwell 13,761 Reputation points
    2022-08-08T22:39:03.753+00:00

    lets say in office location tomorrow if it is Remote Ireland ABC, or ABC Remote Ireland or anything. i want to make sure my query pulls the words Remote and Ireland from office location.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.