尝试将哈希表中2个对象的属性转换为新的哈希表
0
我收到以下错误
$names.add = Foreach ($A in $grps.keys) {Get-DistributionGroupMember -
Identity '$A' | select name | Group-Object -Propertyname -AsHashTable}
感谢任何帮助
答案 0 :(得分:0)
$Grps = Get-DistributionGroupMember -Identity DG@company.com | select name | Group-Object -Property name -AsHashTable
$addr = $GRPS.GetEnumerator() | ForEach-Object {Get-DistributionGroupMember -Identity $_.name | select primarysmtpaddress| Group-Object -Property PRIMARYSMTPADDRESS -ashashtable }
Foreach ($A in $Addr.keys) {add-MailboxFolderPermission -id ${A}:\Calendar -user user@company.com -AccessRights limiteddetails}