在Outlook中创建Skype会议的PowerShell脚本

时间:2019-06-17 13:58:54

标签: powershell outlook office365 skype-for-business

我能够使用Powershell创建代码以在Outlook中创建约会。我想在Outlook中创建Skype会议,但无法做到这一点。

我写了以下脚本在Outlook中创建约会

$Outlook = New-Object -ComObject Outlook.Application
$OutlookFolders = $Outlook.Session.Folders.Item(1).Folders
$tzs = $Outlook.TimeZones
$NewEvent = $Outlook.CreateItem(1)
$NewEvent.Subject = "Meeting";
$NewEvent.Start = [datetime]”6/13/2019 19:00"
$NewEvent.End = [datetime]"6/13/2019 20:00"
$NewEvent.SendUsingAccount = 'abch@email.com'
$NewEvent.Recipients('abc@email.com')
$NewEvent.save()

我想创建一个Skype会议。

1 个答案:

答案 0 :(得分:1)

Outlook对象模型不提供用于创建Skype会议的任何属性或方法。您在Outlook UI中看到的是Outlook的附加组件。您可以尝试以编程方式执行功能区按钮,请参见CommandBars.Execute方法。您只需要传递内置控件的idMso值即可。

您可以使用Skype for Business User API (UCWA)来创建会议,方法是Skype for Business Online (Office 365)

POST   `https://lyncweb.contoso.com/ucwa/oauth/v1/applications/103...740/onlineMeetings/myOnlineMeetings HTTP/1.1`
  Accept: application/json
  Content-Type: application/json
  Authorization: Bearer cwt=AAEB...buHc
  X-Ms-Origin: http://localhost
  X-Requested-With: XMLHttpRequest
  Referer: https://lyncweb.contoso.com/Autodiscover/XFrame/XFrame.html
  Accept-Language: en-US
  Accept-Encoding: gzip, deflate
  User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3)
  Host: lyncweb.contoso.com
  Content-Length: 185
  DNT: 1
  Connection: Keep-Alive
  Cache-Control: no-cache
  {
      "attendanceAnnouncementsStatus":"Disabled",
      "description":"hey guys let's do a musical!",
      "subject":"holiday party",
      "attendees": ["sip:Chris@contoso.com","sip:Alex@contoso.com"],
      "leaders": []
  }

作为参考,您可以看一下: