我試圖使用這個PowerShell模塊以一種可解釋的方式獲取wmi對象的ACL。 (安全描述符對於理解用戶的權限很有幫助) 我想在多個服務器上使用的腳本中使用它。我不想將模塊複製到每臺服務器,而是將它放在網絡共享上。 問題是,我每次導入模塊(導入模塊)時出現以下錯誤。從UNC導入Powershell模塊(powershellaccesscontrol)
Import-Module : Die Datei oder Assembly "file://\\necron\C$\tests\PowerShellAccessControl\ROE.PowerShellAccessControl.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Der Vorgang wird nicht unterstützt. (Ausnahme von
HRESULT: 0x80131515)
In Zeile:1 Zeichen:1
+ Import-Module '\\necron\C$\tests\PowerShellAccessControl'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
德國零件的簡短說明,如果需要的話。 (找不到.dll文件/程序集或它的依賴性。不支持此進程。例外HRESULT ...)
執行策略處於繞過狀態。解除阻止文件不起作用。 隨着模塊的第3版,我可以在第二次嘗試中導入它,但是當我嘗試使用get-accesscontrolentry讀取acl時,我得到另一個錯誤。
Get-SecurityDescriptor : Error invoking the WMI method 'GetSecurityDescriptor' on the input object '\\TESTSERVER\ROOT\cimv2:[email protected]': Unerwarteter Fehler
In \\necron\C$\tests\PowerShellAccessControl\PowerShellAccessControl.psm1:897 Zeichen:38
+ $CurrentObject | Get-SecurityDescriptor -Audit:($AuditProper ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-SecurityDescriptor
預覽版本4根本沒有導入。
我曾在一點工作,但不能再生產。有任何想法嗎?
檢查模塊是否爲x86,如果是,請運行x86 powershell並嘗試導入。 – Vesper
請檢查JPBlanc解決方案,如果它不起作用,我會盡量發佈一個可以幫助你的提示。 – ALIENQuake
@alialistair macbain,你應該把答案作爲很好的答案,upvote或downvote,如果它不起作用。你也可以評論答案。 – JPBlanc