您好,我在获取谁将计算机加入该域的信息时遇到了一些问题。我可以使用这段代码,但这是供一些不能访问Powershell ActiveDirectory模块的非管理用户使用的。
Get-ADComputer myComputer -Properties ntSecurityDescriptor | Select ntSecurityDescriptor -ExpandProperty ntSecurityDescriptor这是我在这里感兴趣的owner属性。但现在到了真正的交易中,我需要让它与ADSI一起工作
$Computer = [ADSI](([ADSISearcher]"(name=myComputer)").FindOne().Path)
$Computer.nTSecurityDescriptor
System.__ComObject如何使用ADSI“扩展”nTSecurityDescriptor的属性?
发布于 2014-06-17 08:21:09
Powershell足够聪明,它会尝试向你展示一个对象的最佳表示,以及它认为你将需要的最常见的属性。但是,有时您需要获取原始对象,您可以使用PSBase属性在其下获取原始对象。这里有一个link to Jeffrey Snover在谈论它。尝尝这个
$Computer = [ADSI](([ADSISearcher]"(name=myComputer)").FindOne().Path)
$Computer.PsBase.ObjectSecurity.Ownerhttps://stackoverflow.com/questions/24248259
复制相似问题