与AD相关任务的PowerShell / ADSI权限问题
我正在开发一个PS脚本,它将为用户提供一个graphics用户界面(GUI)和一些button,以便执行一些基本任务,例如解锁帐户,启用/禁用,更改密码和查杀进程/closures用户。 不工作的部分是:启用/禁用用户和更改密码。 首先,一切工作作为域pipe理员,但我不能让用户一个域pipe理员,所以请不要build议:) 这是更改密码部分: $name = "osman" $Searcher = [ADSISearcher]"(sAMAccountName=$Name)" $Results = $Searcher.FindOne() $password = "pezevenk@321" [string]$adspath = $Results.Properties.adspath $enable = [ADSI]$adspath $enable.psbase.invoke("SetPassword", $password) $enable.psbase.CommitChanges() 错误是非常通用的: Exception calling "Invoke" with "2" argument(s): "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" At line:14 char:13 + $enable.psbase.invoke("SetPassword", $password) 现在,很明显,我试图给予用户适当的权限,即使我尝试了这个:我正在运行此用户具有“重置密码”和“更改密码”权限委托AD中的“用户”文件夹其中包括所有的用户。 有什么方法可以看到我错过了什么权限? 你们能想到其他的东西吗? 编辑:这些是OU的权限: "CN=Users,DC=domainname,DC=root,DC=com","All","User","ReadProperty, GenericExecute","Descendents","00000000-0000-0000-0000-000000000000","bf967aba-0de6-11d0-a285-00aa003049e2","InheritedObjectAceTypePresent","Allow","domainname\osman","False","ContainerInherit","InheritOnly" "CN=Users,DC=domainname,DC=root,DC=com","Pwd-Last-Set","User","ReadProperty, WriteProperty","Descendents","bf967a0a-0de6-11d0-a285-00aa003049e2","bf967aba-0de6-11d0-a285-00aa003049e2","ObjectAceTypePresent, InheritedObjectAceTypePresent","Allow","domainname\osman","False","ContainerInherit","InheritOnly" […]