gpt4 book ai didi

windows - 无需 AD 搜索即可获得计算机组成员资格

转载 作者:可可西里 更新时间:2023-11-01 10:43:21 25 4
gpt4 key购买 nike

是否有无需运行 AD 搜索即可获取计算机的 AD 组成员资格的等效方法?我需要能够检索 AD 中计算机组成员的组 SID,即使机器没有连接到域 Controller ,作为标准用户帐户运行。

基本上是在寻找与此等效的内容,但当前计算机帐户除外。

$groups = [System.Security.Principal.WindowsIdentity]::GetCurrent().Groups

最佳答案

我通过逆向工程 gpresult 弄清楚了如何做到这一点。为此,我首先以管理员身份授予标准用户访问 WMI 命名空间 root\rsop\COMPUTER

我更喜欢无需执行此操作的解决方案,但需要进一步调查。

使用脚本一次性设置机器 Set-WmiNamespaceSecurity.ps1

Set-WmiNamespaceSecurity.ps1 root/rsop/COMPUTER add Users Enable 

现在,作为标准用户,我可以从机器中检索 Active Directory 计算机组 SID,即使它没有使用以下 PowerShell 连接到网络:

(Get-WmiObject -Namespace "root\rsop\COMPUTER" -Class RSOP_Session -Property SecurityGroups).SecurityGroups

关于windows - 无需 AD 搜索即可获得计算机组成员资格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39029775/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com