VMware Cloud Community
orian
Hot Shot
Hot Shot
Jump to solution

new meeting

Hi,

Is it possible to create a workflow which send a new meeting to outlook?

Thanks!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
orian
Hot Shot
Hot Shot
Jump to solution

I finally use powershell script:

before running these scripts you have to install on your exchange server the Exchange Web Service API.

The first script you have to run it from the orchestrator, in order the password will be available when you run the the second script from the orchestrator.

first script:

$password = "passw0rd"

$password | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File c:\script\vrapass.txt

second script:

Param(

  [string]$subject,

  [string]$body,

  [string]$location,

  [string[]]$attendees

)

Import-Module -Name 'C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll'

#$Credential = Get-Credential

$username = 'domain\vraadmin'

$password = Get-content 'c:\script\vrapass.txt' | ConvertTo-SecureString

$Credential = New-Object -TypeName System.management.automation.pscredential -ArgumentList $username, $password

$exchService = New-Object -TypeName Microsoft.Exchange.WebServices.Data.ExchangeService

$exchService.Credentials = New-Object -TypeName Microsoft.Exchange.WebServices.Data.WebCredentials -ArgumentList $Credential.UserName, $Credential.GetNetworkCredential().Password

#$exchService.AutodiscoverUrl($Credential.UserName, {$true})

$exchService.Url = 'https://outlook.co.il/EWS/Exchange.asmx'

#$Start = Get-Date

$time = "18:30"

$date = [System.DateTime]$time

$MeetingRequest = New-Object -TypeName Microsoft.Exchange.WebServices.Data.appointment -ArgumentList $exchService

$MeetingRequest.Subject = $subject

$MeetingRequest.Body = $body

foreach($attendee in $attendees){

  $MeetingRequest.RequiredAttendees.Add($attendee) | Out-Null

}

$MeetingRequest.Start = $date

$MeetingRequest.End = $MeetingRequest.Start.AddMinutes(30)

$MeetingRequest.Location = $location

#$MeetingRequest.ReminderDueBy = 30

$MeetingRequest.IsResponseRequested = $false

$MeetingRequest.Save([Microsoft.Exchange.WebServices.Data.SendInvitationsMode]::SendToAllAndSaveCopy)

View solution in original post

0 Kudos
5 Replies
daphnissov
Immortal
Immortal
Jump to solution

Clarify what you mean.

0 Kudos
orian
Hot Shot
Hot Shot
Jump to solution

The same way you can send a mail, I would like to send an outlook meeting to several persons.

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

vRO itself does not provide Outlook / MSOffice plug-in. However, it should be possible to automate sending an appointment from Outlook using PowerShell, and then call the PowerShell script from a vRO workflow.

As for how to automate Outlook via PowerShell - I guess you'll need to instantiate Outlook.Application object, create an appointment item, fill up its properties, and send it. I haven't done it, but there should be some helpful information (including code snippets) in MSDN and other online resources.

0 Kudos
filosmith
Enthusiast
Enthusiast
Jump to solution

You can add a .ics attachment to an email crafted with vRO. Example:

var fileAttachment = new MimeAttachment();

fileAttachment.name = provisionedVmName + " expiration.ics";

fileAttachment.content =    "BEGIN:VCALENDAR\n" +

                    "VERSION:2.0\n" +

                    "METHOD:" + method + "\n" +

                    "BEGIN:VEVENT\n" +

                        "DTSTART;VALUE=DATE:" + myRequest.dateSubmitted.toISOString() + "\n" +

                        "DTEND;VALUE=DATE:"+ expDate.toISOString() + "\n" +

                        "DTSTAMP:" + date.toISOString() + "\n" +

                        "TRANSP:TRANSPARENT\n" +

                        "ORGANIZER:vra-a@epic.com\n" +

                        "SEQUENCE:" + date.toISOString() + "\n" +

                        "SUMMARY:" + summary + "\n" +

                        "PRIORITY:5\n" +

                        "X-MICROSOFT-CDO-IMPORTANCE:1\n" +

                        "CLASS:PUBLIC\n" +

                    "END:VEVENT\n" +

                "END:VCALENDAR\n";

message.addMimePart(fileAttachment,"text/calendar; charset=UTF-8");

message.sendMessage();

RFC 5545 - Internet Calendaring and Scheduling Core Object Specification (iCalendar)

0 Kudos
orian
Hot Shot
Hot Shot
Jump to solution

I finally use powershell script:

before running these scripts you have to install on your exchange server the Exchange Web Service API.

The first script you have to run it from the orchestrator, in order the password will be available when you run the the second script from the orchestrator.

first script:

$password = "passw0rd"

$password | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File c:\script\vrapass.txt

second script:

Param(

  [string]$subject,

  [string]$body,

  [string]$location,

  [string[]]$attendees

)

Import-Module -Name 'C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll'

#$Credential = Get-Credential

$username = 'domain\vraadmin'

$password = Get-content 'c:\script\vrapass.txt' | ConvertTo-SecureString

$Credential = New-Object -TypeName System.management.automation.pscredential -ArgumentList $username, $password

$exchService = New-Object -TypeName Microsoft.Exchange.WebServices.Data.ExchangeService

$exchService.Credentials = New-Object -TypeName Microsoft.Exchange.WebServices.Data.WebCredentials -ArgumentList $Credential.UserName, $Credential.GetNetworkCredential().Password

#$exchService.AutodiscoverUrl($Credential.UserName, {$true})

$exchService.Url = 'https://outlook.co.il/EWS/Exchange.asmx'

#$Start = Get-Date

$time = "18:30"

$date = [System.DateTime]$time

$MeetingRequest = New-Object -TypeName Microsoft.Exchange.WebServices.Data.appointment -ArgumentList $exchService

$MeetingRequest.Subject = $subject

$MeetingRequest.Body = $body

foreach($attendee in $attendees){

  $MeetingRequest.RequiredAttendees.Add($attendee) | Out-Null

}

$MeetingRequest.Start = $date

$MeetingRequest.End = $MeetingRequest.Start.AddMinutes(30)

$MeetingRequest.Location = $location

#$MeetingRequest.ReminderDueBy = 30

$MeetingRequest.IsResponseRequested = $false

$MeetingRequest.Save([Microsoft.Exchange.WebServices.Data.SendInvitationsMode]::SendToAllAndSaveCopy)

0 Kudos