Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance 论坛
Viewing all articles
Browse latest Browse all 8719

Problem with Exchange 2010 scripts after installing PowerShell 4.0

$
0
0

Hi

After installing new updates for MS Exchange 2010 and PowerShell 4.0 I've got problems with PS scripts using buil-in

exchange commands.

I wrote interactive script for searching e-mails. Here is a pice of code where I get error after installing PS v4.

....

$SearchContent=Read-Host "Write sentence to find"

Get-Mailbox | Search-Mailbox -SearchQuery "$SearchContent" -TargetMailbox "Discovery Search Mailbox" -TargetFolder "Inner box" -LogOnly -Loglevel Full | Out-Null

....

After installing PowerShell 4.0 I get that bug and report in TargetMailbox is not genereated.

The property keyword isn't supported.

At C:\Administration\Scripts\T-SearchMail.ps1:122 char:1
+ Get-Mailbox | Search-Mailbox -SearchQuery "$SearchContent" -TargetMailbox "Disco ...
+ ~~~~~~~~~~~~~~~~~   

+ CategoryInfo          : InvalidArgument: (:) [], ParserException
    + FullyQualifiedErrorId : 35E6C841

Using PowerShell 2.0 everything was ok.

How to solve this problem?

Tomasz


Kind Regards Tomasz




Viewing all articles
Browse latest Browse all 8719

Trending Articles



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