locked
getting the following error on adding the recipient RRS feed

  • Question

  • Hi together,

    For me, this solution isn't working.   Powershell Script to create new Outlook Meeting

    I've tried the scriptlet you've posted on October 16 and are getting the following error on adding the recipient/required attendees to the array.

    PS C:\WINDOWS\system32> $ol = New-Object -ComObject Outlook.Application
    $meeting = $ol.CreateItem('olAppointmentItem')
    $meeting.Subject = 'Test # 4'
    $meeting.Body = 'Let''s have a meeting'
    $meeting.Location = 'Virtual'
    $meeting.ReminderSet = $true
    $meeting.Importance = 1
    $meeting.MeetingStatus = [Microsoft.Office.Interop.Outlook.OlMeetingStatus]::olMeeting
    $meeting.Recipients.Add('jsmith@contoso.net')
    $meeting.Recipients.Add('mjones@contoso.net')
    $meeting.ReminderMinutesBeforeStart = 15
    $meeting.Start = [datetime]::Today.Adddays(1)
    $meeting.Duration = 30
    $meeting.Send()
    You cannot call a method on a null-valued expression.
    At line:9 char:1
    + $meeting.Recipients.Add('jsmith@contoso.net')
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
     
    You cannot call a method on a null-valued expression.
    At line:10 char:1
    + $meeting.Recipients.Add('mjones@contoso.net')
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
     
    Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
    At line:14 char:1
    + $meeting.Send()
    + ~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (:) [], COMException
        + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
     
    
    PS C:\WINDOWS\system32> 

    What I am looking for is a script to generate multiple meeting requests from an Excel-File. But I'm struggling by the send method and adding recipients.

    I am using Powershell 5.1 and Office 365 ProPlus (Build 1806 C2R).

    I would be very glad if somebody can help me because Google did not.

    Best regards

    Patrick




    • Split by jrv Thursday, September 6, 2018 8:00 AM New question
    • Edited by jrv Thursday, September 6, 2018 8:01 AM Added link
    Thursday, September 6, 2018 7:32 AM

All replies