我很好奇,如果有人可以描述如何枚舉通過綁定實例可用的ADSI方法,如[ADSI]$instance.psbase.Invoke()
?是否可以通過[ADSI]對象的Invoke()枚舉所有可用的方法和屬性?
研究已經轉向了"refer to the docs for the ADSI interface"。但我對這個答案並不滿意。
如果我實例化:
[ADSI]$lhost_group="WinNT://./Administrators,group"
然後嘗試:
@($lhost_group.psbase.Invoke("Members")) | foreach-object {$_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null)}
PowerShell的將返回GetProperty("Name")
的out
爲包含在組中的每個對象。
如何枚舉所有可用的方法和屬性,將通過任何給定的ADSI接口可用?
This answer from Shay Levy是使用[ADSI]$_.GetTypes().InvokeMember()
和[ADSI]$_.psbase.Invoke()
的語法的另一個例子。
我想添加我自己的賞金這個問題,但我不知道如何? –
我不認爲你可以添加額外的賞金。與聊天室中人口最稠密的房間(頂部工具欄)檢查。 – mbrownnyc
確定我已閱讀文檔^^,在開始新文章之前必須等待賞金結束......太糟糕了 –