#40438 - 2003-05-20 10:22 AM
Admin Script
|
stooz
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
|
|
|
|
#40442 - 2003-05-21 12:42 AM
Re: Admin Script
|
stooz
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
|
|
|
|
#40444 - 2003-05-20 01:47 PM
Re: Admin Script
|
AzzerShaw
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
|
|
|
|
#40447 - 2003-05-20 02:17 PM
Re: Admin Script
|
stooz
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
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?
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
|
|
|
|
#40451 - 2003-05-20 06:53 PM
Re: Admin Script
|
Breaker
Hey THIS is FUN
   
Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
|
|
|
Top
|
|
|
|
#40452 - 2003-05-20 07:03 PM
Re: Admin Script
|
stooz
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 895 anonymous users online.
|
|
|