有誰知道如何爲AD用戶屬性上的ACL生成報告。 例如誰有權使用Active Directory用戶「讀取縮寫」或「寫入縮寫」屬性。 我已經找到PowerShell命令來獲取AD用戶對象本身的ACL,但不是在屬性級別。如何使用PowerShell獲得AD用戶對象上屬性的有效權限
3
A
回答
2
查看PowerShell Access Control module。 3.0版在PowerShell中幾乎完全實現,與使用Get-Acl相比,它非常慢,但我認爲它可以做你要求的(並且我正在處理速度問題)。
它有一個名爲Get-EffectiveAccess的函數,它可以計算一個委託人對安全對象的有效訪問權限,但我不認爲這就是你要找的。這聽起來像你想要得到一個提供讀/寫'首字母'屬性的ACE的列表。爲此,您可以使用Get-AccessControlEntry:
# Get any ACEs that grant or deny read or write access to the 'initials' property:
Get-ADUser TestUser | Get-AccessControlEntry -ObjectAceType initials
# Get any ACEs that grant or deny write access to the 'initials' property:
Get-ADUser TestUser | Get-AccessControlEntry -ObjectAceType initials -ActiveDirectoryRights WriteProperty
# Get any ACEs that grant write access to the 'initials' property:
Get-ADUser TestUser | Get-AccessControlEntry -ObjectAceType initials -ActiveDirectoryRights WriteProperty -AceType AccessAllowed
這些示例都使用Get-ADUser來查找單個用戶。無論您使用AD模塊還是DirectorySearcher,您都應該能夠爲任何AD對象提供該功能。您甚至可以將專有名稱作爲-Path參數提供給函數。
-ObjectAceType參數應該能夠接受一個GUID,或者您可以放入一個或多個屬性/屬性集合/驗證的寫入/擴展權限/類對象名稱(您可以使用*作爲通配符)。
如果你確實想計算實際有效訪問,這裏是GET-EffectiveAccess功能的一些例子:
# Get effective access that 'AnotherUser' has over 'TestUser' object (this doesn't include property, property set, validated write, etc effective permissions):
Get-ADUser TestUser | Get-EffectiveAccess -Principal AnotherUser
# Same as before, but this time include effective access down to the ObjectAceType level:
Get-ADUser TestUser | Get-EffectiveAccess -Principal AnotherUser -ObjectAceTypes initials
Get-ADUser TestUser | Get-EffectiveAccess -Principal AnotherUser -ObjectAceTypes init*
,而在過去的幾個例子的工作,我注意到,有一些錯誤是當使用Get-EffectiveAccess和-ObjectAceTypes參數編寫時,即使函數看起來工作正常。如果我有周末的時間,我可以解決這個問題,但我可能只是等待4.0版本。
相關問題
- 1. 如何查看AD用戶對象的所有屬性?
- 2. PowerShell的變化AD用戶屬性
- 3. Powershell CMDLET返回屬性值AD /用戶
- 4. 權限上使用PowerShell
- 5. PowerShell的:獲取ACL,並獲得遠程文件夾對特定用戶權限
- 6. Powershell:試圖識別沒有特定權限組的AD帳戶
- 7. 使用Powershell修改非AD LDAP對象
- 8. AD使用新用戶帳戶的權限
- 9. Powershell - WMI&AD對象
- 10. 如何使用Powershell授予用戶註冊表項的權限?
- 11. 獲得用戶權限的FB密碼
- 12. 在Powershell的屬性名稱中使用「#」訪問對象屬性?
- 13. 對SQL Server用戶的有限權限
- 14. 如何通過使用請求用戶屬性獲取非超級用戶的用戶權限
- 15. 如何根據objectGUID獲取AD用戶的'memberof'屬性值?
- 16. 試圖獲得codeigniter用戶登錄非對象的屬性
- 17. KeyProperty對象沒有屬性獲得
- 18. 'CurrentUserDefault' 對象有沒有屬性 '用戶'
- 19. '用戶' 對象有沒有屬性 'DATE_FORMAT'
- 20. 「用戶」對象有沒有屬性「假」
- 21. 如何獲得Facebook上的`fb:explicit_shared`權限
- 22. 如何獲得用戶在django監護人中具有特定權限的所有對象?
- 23. 'collections.OrderedDict'對象沒有屬性'用戶名'
- 24. 'QueryDict'對象沒有屬性'用戶'
- 25. Django的用戶帳戶的WSGIRequest'對象沒有屬性「用戶」
- 26. Powershell獲取用戶屬性給定samaaccount
- 27. 使用NSFetchedResultsController獲取對象的屬性
- 28. 如何使用對象的屬性... Python!
- 29. 如何使用NSNotificationcenter的對象屬性
- 30. 如何使用屬性的類對象
感謝Rohn, Get-AccessControlEntry完美地工作。當我運行Get-EffectiveAccess時出現了一些錯誤,但是我從Get-AccessControlEntry獲得了我需要的報告。 再次感謝! Majid – 2014-11-25 22:01:38