Trying to develop a PowerShell GUI to run some Exchange 2010 Cmdlets, IM having trouble getting the textbox / variable value to work correctly within the syntax....
This command works....
Works Get-Mailbox -identity myalias | Search-Mailbox -SearchQuery `Subject:"MyStringValue"' -Force -DeleteContent >\\server\c$\temp\outreport.txt
This command doesn't work....
Get-Mailbox -identity myalias | Search-Mailbox -SearchQuery `Subject:'$Sub'` -Force -DeleteContent >\\myserver\c$\temp\outreport.txt
When I say doesn't work, the command actually runs but doesnt produce the desired outcome.... Generates the report file which reports 0 item count. Any thoughts????? Thanks
Djoe