Page 1 of 1 1
Topic Options
#32405 - 2002-11-13 08:23 PM admin rights stuff
SteveSG Offline
Fresh Scripter

Registered: 2002-11-13
Posts: 6
I have been searching the forums for a couple days, and a lot of the stuff is either too confusing/advanced for a newbie like me or inapplicable.

I have a very simple machine inventory script composed of essentially two functions, WMIQuery and WriteLog2. WMI Query gathers the information, WriteLog writes it to a log file. This is set to run as a custom script for all users. If a user with Local Admin / Domain Admin rights logs in and runs the script, what is written to the log looks like this (sample from log file):

2002/11/11 13:38:01 - IBM 2658BPU / No Asset Information, S/N: ******* /
*******, adminuser, 1.1.1.1, MachineName, NT 5.0.2195 : Service Pack 3

Where ******* are valid serial numbers, 1.1.1.1 is a valid IP, adminuser is the proper username, and MachineName is the correct client machine name.

If a user without such rights logs in (most of our employees), the same computer will write this to the log:

2002/11/12 09:17:30 - IBM___ TP-1M___ / , S/N: / , normaluser, 1.1.1.1,
MachineName, NT 5.0.2195 : Service Pack 3

Here the Model is hidden as well as the serial number, the rest is correct (and not part of what WMIQuery pulls).

I can only assume that since the user logging in does not have admin rights on the machine it will not report the information. Thus I wish to know
how to run the script under full local admin access so that even if Joe User logs in, the correct information is reported.

I'm not executing any external exe or vbs or anythingso I'm not sure taskscheduling is the thing for me, and I don't like the security problems with SU.exe.

The weird thing is, if I log in as Joe User and run wkix32.exe (I'm using scriptlogic) and the script, it works fine. But if I try to have the script do it during the logon process, it won't work unless the user has admin rights.

Very frustrating [Frown]

Top
#32406 - 2002-11-13 08:38 PM Re: admin rights stuff
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
It is nice to see that WriteLog2 is useful to you.

Do you need to collect this data once for each PC or do you require that a record be written at logon?

I you just need the data one time could you execute the code remotely pointing to each computer to collect it?

[ 13. November 2002, 20:42: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#32407 - 2002-11-13 08:38 PM Re: admin rights stuff
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Welcome to the board. If it works after the logon but not during, then push that portion of script to the RunOnce key.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#32408 - 2002-11-13 08:46 PM Re: admin rights stuff
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See also Installing an Application as an Admin
_________________________
There are two types of vessels, submarines and targets.

Top
#32409 - 2002-11-14 03:46 PM Re: admin rights stuff
SteveSG Offline
Fresh Scripter

Registered: 2002-11-13
Posts: 6
Thanks for the help

I'm collecting it once per PC. I'd point it to each PC if I knew what was out there [Smile]

I tried to avoid the installing an app as an admin stuff because it seemed pretty daunting, and I wasn't installing anything. I understand the connection though.

[ 14. November 2002, 15:59: Message edited by: SteveSG ]

Top
#32410 - 2002-11-14 03:53 PM Re: admin rights stuff
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
To get a list of your client computer names:

Use WriteProfileString and create a file in a hidden share. The name of the file would be @wksta.

Then collect the names of the files with "dir /b" or a UDF that was recently written using WSHPIPE.

This would be your target for the admin script.

[ 14. November 2002, 15:54: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#32411 - 2002-11-14 04:01 PM Re: admin rights stuff
SteveSG Offline
Fresh Scripter

Registered: 2002-11-13
Posts: 6
Good point, in fact I probably already have such a list because I've been running a log script the whole time.

I'd use RunOnce for executing the script if it were that easy, which in my haste for a solution forgot that it wasn't. It's not enough for the script to run, they need admin rights to run it. I had been trying some work arounds to no avail [Frown]

I'll go do some research now on remotely getting the info. Hopefully within a couple days I can get somethin working and show you. Slow learning the first week [Smile]

[ 14. November 2002, 16:04: Message edited by: SteveSG ]

Top
#32412 - 2002-11-14 04:04 PM Re: admin rights stuff
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You have already been provided with a thread detailing how to run a script under administrative privileges.

BTW, you could also run a script using WMI to collect the info remotely. The resources are all on this board, so please use the BBS Search to retrieve the relevant threads.

[ 14. November 2002, 16:06: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#32413 - 2002-11-14 04:20 PM Re: admin rights stuff
SteveSG Offline
Fresh Scripter

Registered: 2002-11-13
Posts: 6
Thanks, I've read that thread a number of times, it's just pretty advanced and there is tons to take in, so I don't understand it yet.

Any tutorials / good threads on running scripts on the server? I'll I've done so far is execute scripts at client logon.

[ 14. November 2002, 16:22: Message edited by: SteveSG ]

Top
#32414 - 2002-11-14 04:29 PM Re: admin rights stuff
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Look up the KSMS (KiXtart Systems Management Server) threads or take a look at the COM Forum when talking about WMI stuff. However, this will appear very advanced to you, too.

Additionally, the FAQ Forum is a very good starting point sonce we do have FAQs covering pretty much anything except how to brew a good cup of coffee. However, there's a thread about tea and whether to use cream and sugar ( Your favorite editor? ) [Wink]

[ 14. November 2002, 16:29: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#32415 - 2002-11-14 04:37 PM Re: admin rights stuff
SteveSG Offline
Fresh Scripter

Registered: 2002-11-13
Posts: 6
Ran into the KSMS thread before, thanks.
Thanks for the initiation, and for not flaming [Smile]

Just wish it was easier! The FAQs will help

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 1619 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.102 seconds in which 0.065 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