Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用powershell获取包含特定描述的所有Active Directory组_Powershell - Fatal编程技术网

使用powershell获取包含特定描述的所有Active Directory组

使用powershell获取包含特定描述的所有Active Directory组,powershell,Powershell,我正在尝试查找Active Directory中所有在描述中包含“专用”一词的组 目前我有以下代码: Get-ADgroup -filter {GroupCategory -eq "Security" -and Description -like "*Dedicated*"} | Select-object Name, description 我不断得到以下错误: 此操作返回,因为超时时间已过期 有人能帮我查询返回所有这些组及其描述的列表吗?如果目录中有许多对象,则对非索引属性(如descri

我正在尝试查找Active Directory中所有在描述中包含“专用”一词的组

目前我有以下代码:

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