Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.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 如何检查广告用户对广告组的权限?_Powershell_Active Directory - Fatal编程技术网

Powershell 如何检查广告用户对广告组的权限?

Powershell 如何检查广告用户对广告组的权限?,powershell,active-directory,Powershell,Active Directory,我想通过PowerShell检查用户是否具有特定组的Active Directory权限,例如读取或写入权限 我找到了一种使用获取acl的方法,向我展示一些关于组和用户的信息,但我不确定我是否可以以及如何进一步处理这些信息。我想这可能就是您想要的 $user = get-aduser "username" -Properties memberof $userGroups = $user.MemberOf | Get-ADGroup $group = Get-ADGroup &

我想通过PowerShell检查用户是否具有特定组的Active Directory权限,例如读取或写入权限


我找到了一种使用
获取acl
的方法,向我展示一些关于组和用户的信息,但我不确定我是否可以以及如何进一步处理这些信息。

我想这可能就是您想要的

$user = get-aduser "username" -Properties memberof
$userGroups = $user.MemberOf | Get-ADGroup
$group = Get-ADGroup "group to check"
$group.DistinguishedName -in $userGroups.DistinguishedName

如果我理解正确,您希望检查特定用户对特定组的广告权限。下面的示例将返回分配给某个组的所有个人权限

Get-ADGroup "GroupToCheck" | Foreach-Object {
    foreach($dacl in Get-Acl AD:$($_.distinguishedname))
    {
        foreach($ace in $dacl.Access)
        {
            [PSCustomObject]@{
                "Group Name"          = $_.name
                "Group Owner"         = $dacl.owner
                ActiveDirectoryRights = $ace.ActiveDirectoryRights
                AccessControlType     = $ace.AccessControlType
                IdentityReference     = $ace.IdentityReference
            }
        }
    }
} -OutVariable AllRights

您可以检查用户或用户所在的组是否具有权限,按身份分组/筛选结果等。

这是否有帮助:?或this:或this:或….如果没有:请回答您的问题并澄清用户是否具有特定组的Active Directory权限。@OcasoProtal I虽然“get acl”很清楚,但很抱歉。我更新了我的问题。