首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Powershell ADSI ntSecurityDescriptor

Powershell ADSI ntSecurityDescriptor
EN

Stack Overflow用户
提问于 2014-06-17 00:29:18
回答 1查看 2.8K关注 0票数 0

您好,我在获取谁将计算机加入该域的信息时遇到了一些问题。我可以使用这段代码,但这是供一些不能访问Powershell ActiveDirectory模块的非管理用户使用的。

代码语言:javascript
复制
Get-ADComputer myComputer -Properties ntSecurityDescriptor | Select ntSecurityDescriptor -ExpandProperty ntSecurityDescriptor

这是我在这里感兴趣的owner属性。但现在到了真正的交易中,我需要让它与ADSI一起工作

代码语言:javascript
复制
$Computer = [ADSI](([ADSISearcher]"(name=myComputer)").FindOne().Path)
$Computer.nTSecurityDescriptor
System.__ComObject

如何使用ADSI“扩展”nTSecurityDescriptor的属性?

EN

回答 1

Stack Overflow用户

发布于 2014-06-17 08:21:09

Powershell足够聪明,它会尝试向你展示一个对象的最佳表示,以及它认为你将需要的最常见的属性。但是,有时您需要获取原始对象,您可以使用PSBase属性在其下获取原始对象。这里有一个link to Jeffrey Snover在谈论它。尝尝这个

代码语言:javascript
复制
$Computer = [ADSI](([ADSISearcher]"(name=myComputer)").FindOne().Path)
$Computer.PsBase.ObjectSecurity.Owner
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24248259

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档