我正在尝试使用活动目录更改密码cfexecute
。
我的页面上唯一的代码是这样的(填写用户名和新密码):
<cfexecute
name="c:\windows\system32\cmd.exe"
arguments="NET USER username password /domain"
outputfile="C:\Users\administrator\Desktop\test.txt"
timeout="90">
</cfexecute>
当我尝试在我的电脑上通过 Dreamweaver 运行此代码时,浏览器中的选项卡甚至在 5 分钟后仍不断旋转...我关闭选项卡,转到登录的服务器,其中 text.txt 为空。但我无法删除它,因为它说 Coldfusion.exe 正在使用它???它还没有更改用户密码。
然后我在电脑上打开命令行并运行NET USER username password /domain
它给了我一个System error 5 has occured. Access is denied.
.
然后我继续以管理员身份登录服务器运行NET USER username password /domain
它起作用了。
如何告诉 cfexecute 在运行时以该管理员身份运行,以便其正常工作?
我查阅了 cfexecute 的文档,它不像 cfldap 那样可以选择用户名和密码。
任何对此的帮助将不胜感激!
Edit
还检查了管理中的日志文件,它指出:
Error occurred: coldfusion.tagext.lang.ExecuteTag$TimeoutException: Timeout period expired without completion of c:\windows\system32\cmd.exe
(它无法在 90 秒超时内运行这个简单的命令?但是当我在命令行中运行它时立即运行?)使用 cfexecute 有什么问题吗?
编辑可以吗?要添加用户,它总是运行以更改密码,如下所示?:
"/c net user /user:domain\Administrator <admin-pwd> username password /domain"