Page 1 of 1 1
Topic Options
#15094 - 2001-12-10 11:20 PM Passing user/pass to share
tezz Offline
Fresh Scripter

Registered: 2001-12-10
Posts: 11
We are using KIXTART 95 to specify container shares. Is there a way to have KIXTART pass a username/password to map a protected drive?

EL

Top
#15095 - 2001-12-10 11:32 PM Re: Passing user/pass to share
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
use the shell command to execute a "net use" statement.

shell ("%comspec% /c net use h: \\server\share etc... ")

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15096 - 2001-12-10 11:35 PM Re: Passing user/pass to share
tezz Offline
Fresh Scripter

Registered: 2001-12-10
Posts: 11
I understand how to map the share, but how to pass the username/password with the request?

EL

Top
#15097 - 2001-12-10 11:58 PM Re: Passing user/pass to share
tezz Offline
Fresh Scripter

Registered: 2001-12-10
Posts: 11
A little more info....here is a portion of my script:

if ingroup("1Rises")
use q: "\\siberia\rises$"
endif

...etc.

If the above share required a user/pass that was different than their login user/pass, how would you include that user/pass in this script so it would be an automatic share without extra user input?

EL

Top
#15098 - 2001-12-11 12:20 AM Re: Passing user/pass to share
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
don't use the kix 'USE' command

use the dos 'NET USE' command

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15099 - 2001-12-11 01:13 AM Re: Passing user/pass to share
tezz Offline
Fresh Scripter

Registered: 2001-12-10
Posts: 11
I'm sorry, you will have to spell that one out to me...how will changing use to net use assist me in passing a username/password to a protected share?

EL

Top
#15100 - 2001-12-11 01:21 AM Re: Passing user/pass to share
tezz Offline
Fresh Scripter

Registered: 2001-12-10
Posts: 11
Duh...ok, I see what you are saying.

For anyone else out there:


NET USE [devicename | *] [\\computername\sharename[\volume] [password |*]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]


Makes my life easier.

EL

Top
#15101 - 2001-12-11 02:10 AM Re: Passing user/pass to share
tezz Offline
Fresh Scripter

Registered: 2001-12-10
Posts: 11
Oh boy. Well, I can almost feel success but haven't got there yet.

I can run the NET USE command in a DOS window and it correctly passes the user/pass, but when I put it in the script I get a script error.

USE:

NET USE s: "\\thelocation\thelocation /USER:domainname\username password"

Any ideas?

EL

Top
#15102 - 2001-12-11 02:30 AM Re: Passing user/pass to share
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Tezz,

Shell ("%comspec% /c Net Use .. ")

Or

Use ..


You can do exactly the same with the KiXtart Use command !

BUT whatever you choose to use, you have to expose the password in plan text !!


From the KiXtart manual:

----------------------------------------------------------------------------------------------------

Command: Use

Action:
Enables you to list the current connections.
Also enables you to connect a device, such as a drive or a printer, to a network resource or
to disconnect a device from a network resource.

Syntax:
USE LIST
USE < * | "device" | "resource"> /DELETE [/PERSISTENT]
USE ["device"] <"resource"> [/USER:user] [/PASSWORD:PassWord] [/PERSISTENT]

Remarks:
Use USE * /DELETE to delete all current connections except those to a NETLOGON share and those to
the drive or share from which KiXtart was started.
If a resource name contains non-alphanumeric characters (such as - or +), you must enclose the name in quotation marks.

On Windows NT only, you can use the /USER and /PASSWORD parameters,
which allows you to override the security context of the current user.

Check the value of @ERROR to see if USE was successful (a value of 0 indicates success).

Examples:
USE E: "\\SERVER\PUBLIC" /PERSISTENT
USE * /DELETE
USE E: "\\SERVER\PUBLIC" /user:Yogi /password:Bear
USE E: "\\SERVER\PUBLIC"
USE LPT1: "\\SERVER\LASER" /user:testlan\USER1
USE L: /DEL
USE LIST
USE H: @HOMESHR ; connect to user's home share
IF @ERROR = 0
H:
CD @HOMEDIR ; change directory to user's home directory
ENDIF

----------------------------------------------------------------------------------------------------

As you can see the KiXtart Use command is capable of doing the same as Net Use


You can get the 'online' manual from here:
HTML Help file from ScriptLogic

Just another way of telling you: LOOK IN THE MANUAL


-Erik

[ 11 December 2001: Message edited by: kholm ]

Top
#15103 - 2001-12-11 03:33 AM Re: Passing user/pass to share
tezz Offline
Fresh Scripter

Registered: 2001-12-10
Posts: 11
This is what I was looking for.

USE E: "\\SERVER\PUBLIC" /user:Yogi /password:Bear

Thank you; I will download the new manual and RTFM.

EL

Top
#15104 - 2001-12-11 04:37 PM Re: Passing user/pass to share
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Just a warning about a pitfall in Windows NT authentication:

You can only authenticate one username per domain controller, otherwise you get the 'credentials conflict with an existing set' error.

_________________________
There are two types of vessels, submarines and targets.

Top
#15105 - 2001-12-19 08:29 PM Re: Passing user/pass to share
Squyrrel Offline
Fresh Scripter

Registered: 2001-12-19
Posts: 8
Loc: UK
Might help to use global group/local group with a trust (in the right direction).

add GG to LG on that resource, and use the trust to authenticate. Use NET USE to map drive without extra authentication...

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2082 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.067 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org