Hello,
I wolud like to remove for all users in csv, emailaddress on specific domain. I used something like this, but not working. Could Someone help me to solve this error?
foreach ($q in $importcsv) | ? {$_.AddressString -like "*@domain.pl"} | %{ {Set-Mailbox $q.login -EmailAddresses @{remove="$_"}}}
Error below:
At C:\Users\lcholewa\Desktop\migracja_csv.ps1:54 char:27
+ foreach ($q in $importcsv) | ? {$_.AddressString -like "*@domain.pl"} | %{ {Set ...
+ ~
Missing statement body in foreach loop.
At C:\Users\lcholewa\Desktop\migracja_csv.ps1:54 char:28
+ foreach ($q in $importcsv) | ? {$_.AddressString -like "*@domain.pl"} | %{ {Set ...
+ ~
An empty pipe element is not allowed.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : MissingForeachStatement
BR/Lukas