CFEXECUTE分配它以管理员权限运行 [英] CFEXECUTE assigning it to run with administrator rights

查看:127
本文介绍了CFEXECUTE分配它以管理员权限运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用cfexecute更改活动目录的密码. 我页面上唯一的代码是这个(填写用户名和新密码):

I am trying to change a password with active directory using cfexecute. The only code on my page is this (username and the new password are filled in):

<cfexecute
name="c:\windows\system32\cmd.exe"
arguments="NET USER username password /domain"
outputfile="C:\Users\administrator\Desktop\test.txt"
timeout="90">
</cfexecute>

当我尝试通过pc上的dreamweaver运行此代码时,即使5分钟后,浏览器中的选项卡仍保持旋转状态.但是我无法删除它,因为它说Coldfusion.exe正在使用它?同样,它也没有更改用户密码.

When I tried running this code through dreamweaver on my pc the tab in my browser just kept spinning even after 5 min... I closed the tab went to the server logged in and the text.txt was there empty. But I am unable to delete it because it says coldfusion.exe is using it???? Also it did not change the users password.

然后我打开PC上的命令行并运行NET USER username password /domain,它给了我System error 5 has occured. Access is denied..

So then I opened up the command line on my pc and ran NET USER username password /domain it gave me a System error 5 has occured. Access is denied..

然后我继续以管理员身份运行NET USER username password /domain并登录的服务器.

So then I went on to the server logged in as an administrator ran NET USER username password /domain and it worked.

如何让cfexecute以该管理员身份运行,以使其正常运行?

How do I tell cfexecute to run as that administrator when it runs so that it works properly?

我查阅了cfexecute的文档,它与cfldap一样,您可以选择用户名和密码.

I looked up the docs of cfexecute and it is not like cfldap where you can choose a username and password.

任何帮助,将不胜感激!

Any help with this would be greatly appreciated!

修改

还检查了admin中的日志文件,并指出了这一点:

Also checked log files in admin and it stated this:

Error occurred: coldfusion.tagext.lang.ExecuteTag$TimeoutException: Timeout period expired without completion of c:\windows\system32\cmd.exe

(它不能在90秒的超时时间内运行该简单命令?但是当我在命令行中运行它时立即运行吗?)使用cfexecute是否有问题?

(It cant run that simple command within a 90 second timeout? But runs instantly when I run it in the command line?) Is there something wrong with using cfexecute?

可以编辑吗? 要添加用户,它总是像更改密码那样运行吗?:

EDIT IS IT POSSIBLE? To Add a user it always runs as to change the password like so?:

"/c net user /user:domain\Administrator <admin-pwd> username password /domain"

推荐答案

ColdFusion仅能访问ColdFusion服务使用的域和用户帐户.

ColdFusion is only able to access the domain and user account that is used by the ColdFusion service.

如果您想使用任何版本的ColdFusion针对本地系统或Windows域对用户名/域进行身份验证,请考虑使用CFX_EXEC标记.

If you want to authenticate a username/domain against local system or Windows domain using any version of ColdFusion, consider using the CFX_EXEC tag.

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">

这篇关于CFEXECUTE分配它以管理员权限运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆