我正在尝试获取设置用户的日历文件夹的权限,然后将其导出为CSV,以便我们可以轻松查看权限。
Get-Mailbox |
Get-MailboxPermission |
Select-Object AccessRights, User, Identity, IsValid |
Export-Csv -Path 'c:\Users\Connor\Desktop'
Export-Csv : Access to the path 'C:\Users\Connor\Desktop' is denied. At line:1 char:89 + ... hts,User,Identity,IsValid | Export-Csv -Path 'c:\Users\Connor\Desktop' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (:) [Export-Csv], UnauthorizedAccessException + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.ExportCsvCommand
答案 0 :(得分:1)
您需要确保PowerShell对您要写入的文件夹具有写入权限。您可以通过
C:\temp\
(加上您的filename.csv
)[System.IO.Path]::GetTempPath()
在PS中致电Path.GetTempPath
另请参见:Export-Csv - Access to the path 'C:\export.csv' is denied