foreach ($group in $ADMSObjects){
$searchString = $group.GroupDisplayName
$count = (Get-AzureADGroup -All $true -SearchString "$searchString" | Get-AzureADGroupMember -ALL 1).COUNT
write-host $group.GroupDisplayName , $count
}
我只需要函数“扩展”实际导出$group.GroupDisplayName和$count到Excel工作表。
当我试着做这样的事情时:
x一个一个一个一个x一个一个二个x
我真的不知道该怎么办。
2条答案
按热度按时间kiayqfof1#
你可以使用PSCustomObject来获得你的结果。我猜你提到的
$group
是组显示名称。我没有测试它的环境。所以请从你的端测试它。谢谢!oxf4rvwz2#
我尝试在我的环境中重现该方案:
$group.DisplayName
***运行使用以下代码:
csv或excel文件创建成功:
我们可以在csv文件中看到所需的字段