Link to home
Start Free TrialLog in
Avatar of sirichaiphumirat
sirichaiphumiratFlag for United States of America

asked on

exchange 2010 powershell command issue

Need some help with a powershell command. I'm kinda new with using powershell.

How can i append something to a current variable. Is it even possible.  For example the command below

$mailbox = get-mailbox 'testuser'

now $mailbox holds the value for testuser,

how can i add other users into the variable also. For example I wanted to add testuser10 to the variable.  

So when i run $mailbox i'll get the info for both user.  My point for doing this is so i can run a command to delete some emails for a few users. The command i want to be able to run when i have all my users in the variables is below.

$mailbox| Search-Mailbox -SearchQuery 'Subject:"this is a test"' -DeleteContent

thanks in advance.
SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sirichaiphumirat

ASKER

great thank you.