使用powershell获取包含特定描述的所有Active Directory组
我正在尝试查找Active Directory中所有在描述中包含“专用”一词的组 目前我有以下代码:使用powershell获取包含特定描述的所有Active Directory组,powershell,Powershell,我正在尝试查找Active Directory中所有在描述中包含“专用”一词的组 目前我有以下代码: Get-ADgroup -filter {GroupCategory -eq "Security" -and Description -like "*Dedicated*"} | Select-object Name, description 我不断得到以下错误: 此操作返回,因为超时时间已过期 有人能帮我查询返回所有这些组及其描述的列表吗?如果目录中有许多对象,则对非索引属性(如descri
Get-ADgroup -filter {GroupCategory -eq "Security" -and Description -like "*Dedicated*"} | Select-object Name, description
我不断得到以下错误:
此操作返回,因为超时时间已过期
有人能帮我查询返回所有这些组及其描述的列表吗?如果目录中有许多对象,则对非索引属性(如
description
)的子字符串搜索可能会非常慢
您可以取而代之的是检索具有描述的所有组,并使用Where Object
在客户端对它们进行过滤
请注意,默认情况下,Get-ADGroup
不会返回description
值,您需要使用-Properties
参数指定:
Get-ADgroup -filter {GroupCategory -eq "Security" -and Description -like "*"} -Properties Description |Where-Object {$_.Description -like "*dedicated*"} |Select-Object Name,Description