我正在尝试编写一个脚本,以显示Outlook 2010邮箱中的资源委托。其代码为:
input > Get-CalendarProcessing -Identity $Alias | where {$_.ResourceDelegates -ne "{}"} | ft *
对我来说很重要的输出是资源和邮箱标识。
ResourceDelegates : {TEST/A/A Usr, TEST/A/Kelly Besant, TEST/A/A Usr,
Identity : TEST/A/A Usr
我需要标准格式而不是规范格式的名称,如何转换它们?
您可以将规范名称与 get-recipeint 一起使用,以解析为 Name、DisplayName 或 DN:
Get-CalendarProcessing -Identity $Alias |
where {$_.ResourceDelegates -ne "{}"} |
select -ExpandProperty ResourceDelegates |
get-recipient |
select -ExpandProperty Name
每个 ResourceDelegates 或 Identity 对象都有一个 name 属性(需要 EMS):
$Identity = @{n='Identity';e={$_.Identity.Name}}
$ResourceDelegates = @{n='ResourceDelegates';e={$_.ResourceDelegates | foreach {$_.Name}}}
Get-CalendarProcessing $alias| Select-Object $Identity,$ResourceDelegates