Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

PowerShell Exchange Command

$
0
0

Try to build a GUI for some mailbox administration stuff..... 

The command below produces syntax errors.

Get-Mailbox $dlist.alias -Resultsize Unlimited | Search-Mailbox -SearchQuery "Received:`$DateFromvar..`$DateTovar Subject:$Sub" -DeleteContent -Force >\\Server\Share\file.txt

Error: Please adjust the date time. Make sure it is in the correct format.

When I output $DateFromvar and $DateTovar is appears to be correct. Running the command natively in PowerShell runs successful as well. 

What am I missing? 

Thanks


Djoe



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>