【问题标题】:Calendar meetings using Exchange Web Services使用 Exchange Web 服务的日历会议
【发布时间】:2020-01-28 19:31:06
【问题描述】:

Leading on from the following thread 'time-spent-in-meetings-using-exchange-web-services'

以及通过发布的建议链接进行操作

EWS-Script-to-Export

我试图弄清楚如何省略某些电子邮件域,但不确定如何在数组中执行此操作。

运行以下:

$item.RequiredAttendees.Where{$_.address -notlike "*@excludeDomain.com"}

将自行工作。

但是在数组中它会删除所有内容。

脚本的原始代码

foreach($attendee in $Item.RequiredAttendees){
  $atn = $attendee.Address + "; "  
  $rptObj.Attendees += $atn
  }

例子:

    foreach($attendee in $Item.RequiredAttendees.Where{$_.address -notlike "*@excludeDomain.com"}){
  $atn = $attendee.Address + "; "  
  $rptObj.Attendees += $atn
  }

在这种情况下,创建自定义对象或将 foreach 语句变为变量会更好吗?

非常感谢

【问题讨论】:

    标签: arrays powershell exchangewebservices


    【解决方案1】:

    最后想通了。

    foreach($attendee in $Item.RequiredAttendees.Where{$_.Address -notlike 
    "*@ExcludeDoman.com" -and 
    $_.Address -notlike "*@ExcludeAnotherDoman.com"}){
    $atn = $attendee.Address + "; "
    $rptObj.Attendees += $atn
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-07
      • 1970-01-01
      • 1970-01-01
      • 2015-07-27
      • 2014-05-06
      • 1970-01-01
      • 2019-01-13
      • 1970-01-01
      相关资源
      最近更新 更多