5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

'op_Addition' という名前のメソッドが含まれないため、メソッドの呼び出しに失敗しました。

Posted at

#ググってトップに出なかったけど、わかれば何とはないエラー
Office365の設定にPowerShellいじってて基本的なところで躓いたのでメモ。

以下だと2ループ目以降「'op_Addition' という名前のメソッドが含まれないため、メソッドの呼び出しに失敗しました。」というエラーになる。

$mbxs = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited
foreach ($mbx in $mbxs){
  $alias = ${mbx}.alias
  $item =(Get-MailboxFolderStatistics $alias | ? {$_.FolderType -eq "Calendar"})
  $output+=New-Object PSObject -Property @{name=$item.name;Identity=$item.Identity}
}
$Output|Out-GridView

「$Outputは配列だよ( $output=@())」、って書いてやるだけでした。

$mbxs = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited
$output=@()
foreach ($mbx in $mbxs){
  $alias = ${mbx}.alias
  $item =(Get-MailboxFolderStatistics $alias | ? {$_.FolderType -eq "Calendar"})
  $output+=New-Object PSObject -Property @{name=$item.name;Identity=$item.Identity}
}
$Output|Out-GridView

(参考)
PowerShellで全ユーザーの予定表権限を変更 - 日々徒然

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?