I have a list of users(.txt):
user1
user2
user3
user4
That I would like to use as a filter on a cmdlet (get-qaduser). I would like to ignore the users in the list.
I try
$filter = Get-Content users.txt | Foreach-Object { " AND Name!='{0}'" -f $_}
but this starts my filter with AND and I have a linebreak between each user.
How would I do this nicely?
Sune:)
Give this a try:
The filter would look like: