Solved

Psexec execute a vbs remotely without username or password

Posted on 2011-02-23
1
1,673 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 84

Accepted Solution

by:
oBdA earned 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

738 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