我嘗試撰寫以下代碼來檢查 Outlook 日歷權限:
$Usermailbox = Read-Host "Please enter the mailbox whose permissions you want to see"
Get-MailboxFolderPermission -Identity "$Usermailbox :\calendar"
但是當我嘗試這樣做時,我得到了一個錯誤
Get-MailboxFolderPermission: xxxx|Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundExceptio
n|The specified mailbox Identity:“xxx ” doesn’t exist.
我知道這是因為代碼可能將 $Usermailbox :\calendar 視為一個字串
如何將它們分開?
uj5u.com熱心網友回復:
郵箱和檔案夾名稱之間不應有空格。由于:是一個有效的變數名字符,使用$()分別表示變數:
Get-MailboxFolderPermission -Identity "$($Usermailbox):\calendar"
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/529123.html
標籤:电源外壳
