Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Exchange Online PowerShell: The targetmailbox parameter in cmdlet "new-mailboxsearch" doesn't exist?

$
0
0

I'm using remote powershell into Exchange Online (O365) as a global administrator and I'm attempting to run a New-MailboxSearch like this:

New-MailboxSearch -name "kevin-out" -Description "searching kevin out" -SourceMailboxes "XXX@XXX" -TargetMailbox "XXX@XXX"

But I get this error:

A parameter cannot be found that matches parameter name 'TargetMailbox'.
    + CategoryInfo          : InvalidArgument: (:) [New-MailboxSearch], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,New-MailboxSearch
    + PSComputerName        : pod51038psh.outlook.com

It also appears that the parameter "SearchQuery" is missing too:

New-MailboxSearch -name "kevin-out" -Description "searching kevin out" -SourceMailboxes "XXX@XXX" -SearchQuery "test search"

A parameter cannot be found that matches parameter name 'SearchQuery'.
    + CategoryInfo          : InvalidArgument: (:) [New-MailboxSearch], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,New-MailboxSearch
    + PSComputerName        : pod51038psh.outlook.com

The errors show up despite that the documentation shows the syntax that "TargetMailbox" and "SearchQuery" are valid parameters for New-MailBoxSearch.

SYNTAX
    New-MailboxSearch -Name <String> [-AllPublicFolderSources <$true | $false>] [-AllSourceMailboxes <$true | $false>] [-Confirm 
    [<SwitchParameter>]] [-Description <String>] [-DomainController <Fqdn>] [-EndDate <ExDateTime>] [-EstimateOnly 
    <SwitchParameter>] [-ExcludeDuplicateMessages <$true | $false>] [-Force <SwitchParameter>] [-IncludeKeywordStatistics 
    <SwitchParameter>] [-IncludeUnsearchableItems <SwitchParameter>] [-InPlaceHoldEnabled <$true | $false>] [-InPlaceHoldIdentity 
    <String>] [-ItemHoldPeriod <Unlimited>] [-Language <CultureInfo>] [-LogLevel <Suppress | Basic | Full>] [-MessageTypes 
    <KindKeyword[]>] [-PublicFolderSources <String[]>] [-Recipients <String[]>] [-SearchQuery <String>] [-Senders <String[]>] 
    [-SourceMailboxes <RecipientIdParameter[]>] [-StartDate <ExDateTime>] [-StatusMailRecipients <RecipientIdParameter[]>] 
    [-TargetMailbox <MailboxIdParameter>] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]

What am I doing wrong?

Thanks!

-Kevin


Viewing all articles
Browse latest Browse all 7132

Trending Articles



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