?
Solved

Psexec execute a vbs remotely without username or password

Posted on 2011-02-23
1
Medium Priority
?
1,767 Views
Last Modified: 2012-08-13
Hi,

I need to be able to run a script with PsExec without specifiyng username or password

here it is.

the process is to extend a virtual drive ona remote server.

First I run the batch file:

doexpand.cmd server e:\

@echo off
---
set SERVER=%1
set PARTITION=%2

C:\bootini\PsTools\PsExec.exe \\%SERVER% cscript "\\10.66.66.49\bootini\extend\"extendvb.vbs %PARTITION%""
---
the extendvb runs fine locally.

But when I use the psexec, it says:

C:\Users\malabelle\Desktop\tests\extend>doexpand.cmd SEQDEV3 e:\
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

CScript Error: Loading script "\\10.66.66.49\bootini\extend\extendvb.vbs" failed
 (Access is denied. ).
cscript exited on SEQDEV3 with error code 1.

I check the share and it works and the permissions are good.

any ideas?

0
Comment
Question by:malabelle
1 Comment
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 34964384
Won't work; check psexec's help: "If you omit a user name the process will run in the context of your account on the remote system, but will not have access to network resources (because it is impersonating). Specify a valid user name in the Domain\User syntax if the remote process requires access to network resources or to run in a different account. Note that the password is transmitted in clear text to the remote system."
You need to copy extendvb.vbs to the remote machine, then run it locally; example:
@echo off
set SERVER=%1
set PARTITION=%2
if not exist \\%SERVER%\c$\temp md \\%SERVER%\c$\temp
copy \\10.66.66.49\bootini\extend\extendvb.vbs \\%SERVER%\c$\temp
C:\bootini\PsTools\PsExec.exe \\%SERVER% cscript.exe C:\Temp\extendvb.vbs %PARTITION%

Open in new window

0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question