Dear,We change the code a little and we are introducing the variable $server.
The message box will show which server was found.
Also we look at Windows 2000 and NT4 Domain_Controller. You see there are other values possible.
The code was stripped from our script os.kix.
New code:
code:
;
; - first part of your script f.e. to mapped minimum amount of drives
;
$execute_mode="yes"
$os_product=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")
SELECT
CASE (@inwin = 1) AND ($os_product <> "WinNT") AND (@dos = "5.0") ; - Windows 2000 -
$server="W2K_Server"
CASE (@inwin = 1) AND ($os_product = "LANMANNT") ; - Windows NT -
$server="NT4_Domain_Controller"
CASE (@inwin = 1) AND ($os_product = "ServerNT") ; - Windows NT -
$server="NT4_Member_Server"
CASE 1
$server="no"
ENDSELECT
IF (INGROUP("Domain Admins") <> 0) AND ($server <> "no")
$answer=MessageBox("Administrator, do you want to run the login script?","Message "+$server,20,60)
IF ($answer = 7) ; - 7 = No -
$execute_mode="no"
ELSE ; - 6 = Yes / -1 = No response from user -
$execute_mode="yes"
ENDIF
ENDIF
IF ($execute_mode <> "yes")
GOTO end_script
ENDIF
;
; - second part of your script f.e. registry settings
;
:end_script
EXIT
Some ideas:
- we have no problem at all to run our script on any server at all. It detects automatically
who is logged on and save all kind of information about this user.
Also it is normally not possible that a normal user can reach the server.
- we run those scripts on server to check all kind of things. Most important result is: everything
works ok and some important information has been replicated between some servers.
- by running scripts it is important what resources they are using. Very heavy scripts can
stopped the primay task of servers for an unexpectable periode.
The idea of asking to stop an unwanted script run we like.
You may extend it with a time interval f.e. within office-hours this message box will be
showed and in all other cases the script will be running.
- another interesting thing of runnning script is: you may benchmark your server and you
have the capability to see that the situation on your server is changing. We log those
benchmark information to the eventlog.
Greetings.