Page 1 of 1 1
Topic Options
#40438 - 2003-05-20 10:22 AM Admin Script
stooz Offline
Fresh Scripter

Registered: 2003-05-19
Posts: 11
I am quite new to kix scripting, but I'd like to know how to change a registry key on computers without admin rights. I understand that I have to run an admin script or something.... can someone please give me an example on how this can be done? I have the registry values etc. but not all the users have admin rights, so putting it in the login sript won't help!!

Any suggestions/examples of how this can be achieved will be much appreciated!!

Thanks

Top
#40439 - 2003-05-20 10:30 AM Re: Admin Script
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Stooz,

welcome on board!!!

Take a look at Installing an Application as an Admin in the KiX-FAQ.

I'm sure it will help you... If not report back.
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#40440 - 2003-05-20 10:39 AM Re: Admin Script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hi Stooz,

I think you'd be better served with the classic admin script running on a central admin machine looping through a list of Computernames, mapping ipc$, doing action, log the action ... etc.

The parts you need for that are already available here too, you just have to find them, patch 'em together and make them work for you [Wink]

Questions left ?
_________________________



Top
#40441 - 2003-05-20 11:07 AM Re: Admin Script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, if it's just a writevalue thingie...

$computernamelist ;you can collect this
for each $computer in $computernamelist
$returncode=writevalue("\\"+$computer+"\HKLM\mykey","myvalue","myvaluedata","REG_SZ")
next
_________________________
!

download KiXnet

Top
#40442 - 2003-05-21 12:42 AM Re: Admin Script
stooz Offline
Fresh Scripter

Registered: 2003-05-19
Posts: 11
I've tried several of the RUNAS commands, can someone please give me an example of how I can achieve the following....

I want to call a Kix script, which will enter a registry key, as a user that has admin rights on the domain. This script must be called on a UNC path...

I've tried several methods but I still struggle!!

Thanks all

Top
#40443 - 2003-05-20 01:26 PM Re: Admin Script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you don't need that if you are already remotely calling the script.
as if you have enough rights, your rigths are enough.

and if you call the script, even though it does remote stuff, it will do it under your rights.
_________________________
!

download KiXnet

Top
#40444 - 2003-05-20 01:47 PM Re: Admin Script
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Dude - Im a little confused on what you want but hope this helps ;

This is what If i want a pc to auto logon, it also locks out the keyboard and mouse, so the job cant be stopped half way by an ordinary bod, but the Pc will need to be restarted for the changes to be kicked into place, hope this is the sort of thing you were after !! (Just out of interest I take it you know the Admin password?)

code:
; Kix script to add AutoAdminLogon

Use u: "\\servername\Scripts" /user:DOMAIN1\username /Password:userpassword /persistent:no

Open (1,"u:\DomainAdmin\Administrator.ini") ;holds the admin password
$Password=ReadLine(1)

WriteValue("HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultPassword","$Password","REG_SZ")
WriteValue("HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon","DefaultUserName","Administrator","REG_SZ")
WriteValue("HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon","1","REG_SZ")
WriteValue("HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon","DontDisplayLastUserName","0","REG_SZ")
WriteValue("HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon","LegalNoticeCaption","","REG_SZ")
WriteValue("HKEY_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon","LegalNoticeText","","REG_SZ")
WriteValue("HKEY_Local_Machine\System\CurrentControlSet\Services\KBDCLASS","Start","4","REG_DWORD")
WriteValue("HKEY_Local_Machine\System\CurrentControlSet\Services\MOUCLASS","Start","4","REG_DWORD")

Sleep 5

_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#40445 - 2003-05-20 01:51 PM Re: Admin Script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
azzer, that is working script alright, but this way you need to expose admin pass!

that is security by ignorance and will kick you on the butt at some point.

you could do this remotely too.
if done remotely all you would need to know is the computername where to change these.
_________________________
!

download KiXnet

Top
#40446 - 2003-05-20 01:57 PM Re: Admin Script
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
The Domain password ? No.. Only the username that can access the admin file, which is locked down with more security that at alcratraz [Smile]

Also the keyboard locks and so does the mouse, it cant be stopped....

But anything is possible [Wink]
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#40447 - 2003-05-20 02:17 PM Re: Admin Script
stooz Offline
Fresh Scripter

Registered: 2003-05-19
Posts: 11
Let me explain my whole situation..... Maybe that will give some clarity on my issue!

The lgin srcipt pops up a messagebox with a disclaimer, if the person clicks Yes, he logs on. If he clicks No, he is logged off.

On Win2000/XP, the login script executes in the background, a user can then access the internet or e-mail without actually clicking Yes or No. I created a script to check for and to add the appropriate registry key, but only persons with Admin rights will be able to do this.... I want to be able to run this as a user with domain admin rights. I have looked at encryption etc. for security.

Hope this gives more clarity on my situation

Top
#40448 - 2003-05-20 03:57 PM Re: Admin Script
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Sounds like what you need is to set the RunLogonScriptSync key in the registry - am I right? [Wink]

Try adjusting something like this to your needs - its a script I used recently to hack a slight adjustment to our client remote control software. You can run this script from your PC, with your admin rights, assuming your user account does have the rights to do this manually over the network.

code:
;Script body
Break On

$Hosts = "pc1","pc2","pc3","etc"

;Enter all PC hostnames above in list

For Each $Host In $Hosts

If WriteValue("\\" + $Host + "\HKEY_LOCAL_MACHINE\Software\Funk Software, Inc.\Proxy Host\Settings","Permission","0","REG_DWORD") = 0

? "Proxy access permissions set successfully on " + $Host

Else

? "Unable to set Proxy access permissions on " + $Host

Endif
Shell 'cmd.exe /c shutdown.exe \\' + $Host + ' /R /C > NUL'

Next

:end
Exit

Hopefully you can see what this is doing - a good long read of the FAQs on this site and the manual that is downloaded with Kix would be a good idea.

Let us know how you get on with this.

Breaker

PS You probably will want to remove the line containing the Shutdown command, unless you have really understanding users!

The RunLogonScriptSync value is found under the HKLM\Software\Microsoft\Windows NT\CurrentVesrion\Winlogon key.

Breaker

[ 20. May 2003, 15:59: Message edited by: Breaker ]
_________________________
================================================
Breaker


Top
#40449 - 2003-05-20 04:02 PM Re: Admin Script
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Not sure if this will work - you other guys can check here for background to this thread

[Wink] [Wink]
_________________________
================================================
Breaker


Top
#40450 - 2003-05-20 06:11 PM Re: Admin Script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
wonder why you shell for shutdown...

anyway, it looks awesome [Big Grin]
_________________________
!

download KiXnet

Top
#40451 - 2003-05-20 06:53 PM Re: Admin Script
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Hmmm, awesome... yeah!

[Big Grin] [Wink] [Razz]
_________________________
================================================
Breaker


Top
#40452 - 2003-05-20 07:03 PM Re: Admin Script
stooz Offline
Fresh Scripter

Registered: 2003-05-19
Posts: 11
That works quite well!!

Is there a command to do it on all domain members? Or should I enter all pc's Manually?

Top
#40453 - 2003-05-20 07:10 PM Re: Admin Script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Use the NetView... UDFs from the UDF Forum to enumerate the computers in a domain.
_________________________
There are two types of vessels, submarines and targets.

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 895 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.068 seconds in which 0.027 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