我正在尝试使用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正在使用它?此外,它也没有更改用户密码。
于是,我打开了pc上的命令行,运行了NET USER username password /domain,它给了我一个System error 5 has occured. Access is denied.。
因此,当管理员运行NET USER username password /domain时,我继续登录到服务器上,并且运行起来了。
如何让cfexecute在运行时以管理员身份运行,以使其正常工作?
我查找了cfexecute的文档,它不像cfldap,您可以在那里选择用户名和密码。
任何帮助,这将是非常感谢!
编辑
还检查了admin中的日志文件,并声明如下:
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"发布于 2017-02-16 14:19:55
ColdFusion只能访问ColdFusion服务使用的域和用户帐户。
如果要使用任何版本的ColdFusion针对本地系统或Windows域对用户名/域进行身份验证,请考虑使用CFX_EXEC标记。
exec.cfm
<CFX_EXEC
CMD="NET USER username password /domain"
USER="Administrator"
PWD="pass"
DOMAIN="domain"
FILE="C:\Users\administrator\Desktop\test.txt">https://stackoverflow.com/questions/42234407
复制相似问题