#32405 - 2002-11-13 08:23 PM
admin rights stuff
|
SteveSG
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
|
|
Top
|
|
|
|
#32406 - 2002-11-13 08:38 PM
Re: admin rights stuff
|
Howard Bullock
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 ]
|
|
Top
|
|
|
|
#32409 - 2002-11-14 03:46 PM
Re: admin rights stuff
|
SteveSG
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
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
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 ]
|
|
Top
|
|
|
|
#32411 - 2002-11-14 04:01 PM
Re: admin rights stuff
|
SteveSG
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
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]](images/icons/smile.gif) [ 14. November 2002, 16:04: Message edited by: SteveSG ]
|
|
Top
|
|
|
|
#32413 - 2002-11-14 04:20 PM
Re: admin rights stuff
|
SteveSG
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
|
|
|
|
#32415 - 2002-11-14 04:37 PM
Re: admin rights stuff
|
SteveSG
Fresh Scripter
Registered: 2002-11-13
Posts: 6
|
Ran into the KSMS thread before, thanks. Thanks for the initiation, and for not flaming
Just wish it was easier! The FAQs will help
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1619 anonymous users online.
|
|
|