Page 1 of 1 1
Topic Options
#195079 - 2009-07-28 04:51 PM Run Kix Script as a different user
AlexG Offline
Fresh Scripter

Registered: 2009-07-28
Posts: 7
Loc: Philadelphia
We have PC's that login with a generic account and run Kix. I want to create a batch file that calls a different user other then the local
%username% account that is currently logged in on the PC and map that users drives.

Top
#195080 - 2009-07-28 04:59 PM Re: Run Kix Script as a different user [Re: AlexG]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Hi and welcome to the board.

You could use Runas (not secure) or RunnAs (more secure). Note the double N on the second one. Both are discussed frequently on this board. You can also setup a scheduled task on the target system. They can run with alternate credentials and the user is not able to read the password.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#195081 - 2009-07-28 05:28 PM Re: Run Kix Script as a different user [Re: Mart]
AlexG Offline
Fresh Scripter

Registered: 2009-07-28
Posts: 7
Loc: Philadelphia
Is there anyway to pass a password variable? We are using Sentillion's Vergence for Single Sign on. Have you had any experience with using this product and launching Kix Scripts?
Top
#195084 - 2009-07-28 07:51 PM Re: Run Kix Script as a different user [Re: AlexG]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
 Originally Posted By: AlexG

Is there anyway to pass a password variable?
....

With Runnas you can.
RUNNAS - Tokenized Runas Utility

When using any of the "run with other credentials apps", think it trough!
Get some pro's and con's cause only then you can make the correct decision to use it or not. Do not just throw in an app like this cause it might cause you more grief then pleasure. A scheduled task would still be the safest way imho.


 Originally Posted By: AlexG

....
We are using Sentillion's Vergence for Single Sign on. Have you had any experience with using this product and launching Kix Scripts?


Nope, sorry.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#195193 - 2009-07-31 08:18 PM Re: Run Kix Script as a different user [Re: Mart]
AlexG Offline
Fresh Scripter

Registered: 2009-07-28
Posts: 7
Loc: Philadelphia
Okay - thanks now I am bit confused, probably since I don't quite understand the syntax yet. I have tried passing the PW variable and it did not work for me. And what is a tokenized file? Thanks again for your help...
Top
#195194 - 2009-07-31 08:30 PM Re: Run Kix Script as a different user [Re: AlexG]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Are you using ruN-as or ruNN-as? "runas" comes with Windows and won't allow passing the password as an arg. "runnas" is an add-on program that allows passing the passoword, or even creating a "tokenized" (obfuscated) program with the password embedded in it.

I don't allow either in the environments I support. If an automated process needs to run with elevated rights, it's done with a scheduled task.

We do use runas for interactive admin sessions, just not for automation by non-admin users. (Our admins have "Clark Kent" accounts and use RunAs as a "phone booth" to turn into SuperAdmin and obtain elevated rights when needed. ;\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#195197 - 2009-07-31 08:49 PM Re: Run Kix Script as a different user [Re: Glenn Barnas]
AlexG Offline
Fresh Scripter

Registered: 2009-07-28
Posts: 7
Loc: Philadelphia
Yes - actually using ruNN-as with the 2 NN's - I have been searching this site for samples of how it would look to pass the PW credentials and have not found any...Is there a good source, or anyone know what the syntax would look like? Thanks
Top
#195209 - 2009-07-31 10:13 PM Re: Run Kix Script as a different user [Re: AlexG]
AlexG Offline
Fresh Scripter

Registered: 2009-07-28
Posts: 7
Loc: Philadelphia
Here is my example

"C:\Program Files\Sentillion\runnas.exe" /user:%1 %logonserver%\netlogon\logon.bat /pass:%2

not working of course

Authenticator passes the following arguments to the script at Logon (no arguments are passed at Logoff):
%1 = current username
%2 = current user’s password
%3 = current user’s domain

Top
#195212 - 2009-08-01 12:56 PM Re: Run Kix Script as a different user [Re: AlexG]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
It's unlikely that positional arguments would still be valid once you run a Kix script..

You may need a batch file to launch Kix - something like
 Code:
@kix32.exe kixtart.kix $USRNAME="%1" $USERPASS="%2" $USERDOMAIN="%3"


Kix doesn't recognize "%#" args, because they are special environmental args passed to the command shell. You could also try the GetCommandLine() function, but that's a bit tricky. I'd try the batch method to verify that it works, and then investigate GetCommandLine() to eliminate a Batch to Kix solution.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#195374 - 2009-08-10 05:41 PM Re: Run Kix Script as a different user [Re: Glenn Barnas]
AlexG Offline
Fresh Scripter

Registered: 2009-07-28
Posts: 7
Loc: Philadelphia
What I am doing is that the logon.bat will map drives for users. I can get the kixscript to run, and is shows the users drives mapping. The problem is that the local account USERA already has mapped drives, and the drives that are getting mapped by USERB do not show up. Can RuNNas be used for user drive mappings?
Top
#195378 - 2009-08-10 07:46 PM Re: Run Kix Script as a different user [Re: AlexG]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
AlexG -
Can I make sure we all understand correctly... You have a workstation(s) that uses a generic logon (AUser@Local.Domain.Com)?

Now BUser sits down at the workstation and needs to map additional drives via some script or batch file. There is no logon to the workstation required.

Where does your application come into play? When Buser launches it? What does it do? Does it read the properties of the User account in AD to find out what script to run at logon?
_________________________
Today is the tomorrow you worried about yesterday.

Top
#195383 - 2009-08-11 12:48 PM Re: Run Kix Script as a different user [Re: Gargoyle]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
I was reading it that he wants AUser@Local.Domain.Com to login and map drives based on that userid as well as BUser@Local.Domain.Com.

AlexG, if my interpretation is correct, why not create a group. Put AUser in it and give it what ever rights BUser has so that the login can happen all under one user id?

Top
#195384 - 2009-08-11 04:52 PM Re: Run Kix Script as a different user [Re: BradV]
AlexG Offline
Fresh Scripter

Registered: 2009-07-28
Posts: 7
Loc: Philadelphia
Correct - We have workstations that auto login using a generic account and maps a set of drives that are public. What I am trying to do is create a batch file where someone can map to there own personal, and department drives exlusively to them. What we are using is a product called Sentillion Vergence which has Single Sign on Cabability. The user is presented with a login box and they enter their credentials. I can get the Kix Login script to run, and it looks like the drives are mapping. But when I go to my computer, the Generic Accounts Drives are still there...I did check the Application Event Logs and got this error:

Event Type: Error
Event Source: KIXTART
Event Category: None
Event ID: 5
Date: 08/10/2009
Time: 3:47:03 PM
User: N/A
Computer: LKLKBLR
Description:
The description for Event ID ( 5 ) in Source ( KIXTART ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Failed to create cookie Error : Access is denied. (0x5/5).

Top
#195386 - 2009-08-11 05:52 PM Re: Run Kix Script as a different user [Re: AlexG]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Clearly the script is encountering permissions issues when it runs.

How are you passing the credentials to Kix?

How about posting your Kix script and any supporting scripts/batch files?

Did you consider the example I posted earlier about using positional args with Kix?

Since all you want to do is map drives based on a specific user, you don't need to RunAs anything.. in fact, doing so will set up a child process that will likely run, map drives, and then exit *(taking its mapped drives with it).

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

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
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.066 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

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