running as a different user

  • Thread starter Christos Kritikos
  • Start date
C

Christos Kritikos

hello

I want to write a bat script for a very simple task: copy
a folder from Server1 to Server2... but... I want to
access Server2 using specific credentials
(username\password).

Is there a way to do this?

Is there a way I can prompt for the password so it is not
visible?

many thanks
christos
 
P

Paul R. Sadowski

See runas /?

The runas command will prompt for the password. You can prompt for the
username in the usual manner since you don'thave to worry about that being
visisble.
 
G

Gautam Anand

You can additionally encode the batch file so that the password is not
visible in plain text.

Download Script Encoder:
http://www.microsoft.com/downloads/...67-C447-4873-B1B0-21F0626A6329&displaylang=en

--
Gautam Anand
e: gautam at hotpop dot com
---------------------------------
| See runas /?
|
| The runas command will prompt for the password. You can prompt for
the
| username in the usual manner since you don'thave to worry about that
being
| visisble.
|
message
| | > hello
| >
| > I want to write a bat script for a very simple task: copy
| > a folder from Server1 to Server2... but... I want to
| > access Server2 using specific credentials
| > (username\password).
| >
| > Is there a way to do this?
| >
| > Is there a way I can prompt for the password so it is not
| > visible?
| >
| > many thanks
| > christos
| >
|
|
 
P

Paul R. Sadowski

Gautam Anand said:
You can additionally encode the batch file so that the password is not
visible in plain text.

I don't think the scren works with batch files but it's in no way secure and
should not be trusted to maintain a password or any other sensitive
information.
 
G

Gautam Anand

yes the runas can actually be run using a VBScript which I remember
was pretty easy to write. I would have mailed it had I the script on
hand

and I dont see a problem (other than carelessness) in actually placing
that file on the admins workstation or on the servers where a
non-admin cant get to it.

Its a time saver and eases administration of repetitive-tasks. In
wrong hands it could definately be decrypted to reveal in clear text
the password.

I generally like to create an account which is part of the admin
group - but doesnt have InteractiiveLogon rights. I give the user only
rights which are reqd and again: i dont give the encoded scripted file
to anyone else but admins.

Do you agree?

--
Gautam Anand
e: gautam at hotpop dot com
---------------------------------
|
| | > You can additionally encode the batch file so that the password is
not
| > visible in plain text.
|
| I don't think the scren works with batch files but it's in no way
secure and
| should not be trusted to maintain a password or any other sensitive
| information.
|
|
 
P

Paul R. Sadowski

Gautam Anand said:
I generally like to create an account which is part of the admin
group - but doesnt have InteractiiveLogon rights. I give the user only
rights which are reqd and again: i dont give the encoded scripted file
to anyone else but admins.

Do you agree?

The last para I can accept, but I still don't like scren.
 
C

Christos Kritikos

well, aparently 'runas' doesn't have a parameter to
include the password or am I wrong?

-ck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top