我试图远程启动安装,我不想禁用UAC。 如果我使用psexec远程启动进程,则安装程序将会停止等待UAC提示。 其他任务,如临时文件清理,服务重新启动等,会得到我拒绝访问错误。 有没有反正psexec可以走UAC如loginpipe理员,但具有TrustedInstaller特权或类似的东西?
顺便说一下,我的目标是Windows 2008 R2,但我认为这个问题也适用于Vista,2008和Windows 7。
您需要使用-u选项并指定具有本地pipe理员访问权限的帐户(本地帐户,域pipe理员帐户等)
-u Specifies optional user name for login to remote computer.
例如
psexec \\pc999.myDomain.loc -u pc999\Administrator <your exe >
-h参数在这里是关键的:没有它,psexec不会在Windows Vista及更高版本上使用UAC提升特权执行命令:
C:\Users\merickson>psexec /? PsExec v1.97 - Execute processes remotely Copyright (C) 2001-2009 Mark Russinovich Sysinternals - www.sysinternals.com PsExec executes a program on a remote system, where remotely executed console applications execute interactively. Usage: psexec [\\computer[,computer2[,...] | @file]][-u user [-p psswd] [-ns][-l][-s|-e][x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>] [-an,n,...] cmd [arguments] ... -h If the target system is Vista or higher, has the process run with the account's elevated token, if available. ...
(编辑:添加-h开关的存在的证据,下面的每个评论)
显然我的进程被阻止不是因为psexec忽略提供的login。
不知道为什么,但是使用Vista作为客户端机器时,使用-u和-pparameter passing的凭据实际上并未用于login服务器(通过使用服务器上的事件查看器)。 相反,它始终是正在使用的login用户。 显然这是两台机器在同一个域中时发生的情况。
必须打开凭证pipe理器(控制面板>用户帐户>pipe理您的networking密码),并为我想用于psexec的用户创build一个新的目标机器集。
psexec \<remote IP> -u user -p password -h netsh advfi rewall firewall add rule name="AllowRDP " dir=in action=allow protocol=TCP local port=3389
您可以使用-s标志在SYSTEM环境中运行该命令。 假设您尚未使用需要访问networking其他位置的其他凭据来运行该命令。
我有同样的问题。 我运行的命令是psexec.exe -accepteula -n 120 \ MyServer -u User -p Password cmd“/ C dir
我从win2008 r2运行它,目标(MyServer)是win2008 r2以及。
米格尔的build议为我工作后,我join了它的工作正常的凭据。
我也有这个问题,但是miguel的解决scheme是将证书添加到证书pipe理器中,为我解决了这个问题
使用psexec 1.98在域中的客户端和服务器上运行Windows 7 32位
我不知道这是否是一个错误,似乎是这样。