Dav*_*ton 9 coldfusion cmd net-use cfexecute
我正在尝试使用Active Directory更改密码cfexecute.我页面上唯一的代码是这个(填写用户名和新密码):
<cfexecute
name="c:\windows\system32\cmd.exe"
arguments="NET USER username password /domain"
outputfile="C:\Users\administrator\Desktop\test.txt"
timeout="90">
</cfexecute>
Run Code Online (Sandbox Code Playgroud)
当我尝试通过我的电脑上的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,你可以选择用户名和密码.
任何有关这方面的帮助将不胜感激!
编辑
还检查了admin中的日志文件,并说明了这一点:
Error occurred: coldfusion.tagext.lang.ExecuteTag$TimeoutException: Timeout period expired without completion of c:\windows\system32\cmd.exe
Run Code Online (Sandbox Code Playgroud)
(它不能在90秒的超时内运行那个简单的命令?但是当我在命令行中运行它时立即运行?)使用cfexecute有什么问题吗?
编辑是否可能? 要添加用户,它总是运行以更改密码,如此?:
"/c net user /user:domain\Administrator <admin-pwd> username password /domain"
Run Code Online (Sandbox Code Playgroud)
ColdFusion只能访问ColdFusion服务使用的域和用户帐户.
如果要使用任何版本的ColdFusion对本地系统或Windows域验证用户名/域,请考虑使用CFX_EXEC标记.
http://adiabata.com/cfx_exec.cfm
<CFX_EXEC
CMD="NET USER username password /domain"
USER="Administrator"
PWD="pass"
DOMAIN="domain"
FILE="C:\Users\administrator\Desktop\test.txt">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1295 次 |
| 最近记录: |