locked
Want to delete meeting from multiple selective recipient via CSV import in Powershell RRS feed

  • Question

  • I am trying to run this command but it says "Identity" Null.

    ============================================

    PS C:\WINDOWS\system32> $Users = import-csv "C:\Users\Manish Mandot\Desktop\people.csv"
    >> ForEach ($i in $Users) {
    >> $Search = 'Subject: "' + $i.Subject + '"'
    >> If ($i.StartDate -ne $Null -and $i.EndDate -ne $Null) {
    >> $Search = $Search + ' Received:"' + $i.Startdate + '..'+ $i.Enddate + '"'}
    >> $Command = { Search-Mailbox -Identity $i.Name -SearchQuery "Subject: Class 5th Hindi By Mr. Vijay Baghel Sir." -TargetFolder Search -TargetMailbox CServices -LogLevel Full }
    >> Write-Host "Searching" $i.Name "using query" $Search
    >> Invoke-Command -ScriptBlock $Command }
    >>                                                                                                                                                                                                                                                                     Searching  using query Subject: ""
    Cannot bind argument to parameter 'Identity' because it is null.
        + CategoryInfo          : InvalidData: (:) [Search-Mailbox], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Search-Mailbox
        + PSComputerName        : ps.outlook.com

    Monday, June 8, 2020 4:41 AM