#156694 - 2006-02-06 12:33 PM
disabling sound on mass (scripts/forms)
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Hi all,
I am using a combination of exe and script to be able to mute the sound control on remote pcs. The script below works although i'm aware it isn't very tidy and help with with would be much appreciated...
Another problem that I have is that I want my Teachers to be able to change passwords, now I am using the form from kixforms that works fine, only the thing is it works only if your are Domain admins. Is there anyway I can pass Domain admin or user credentials in my script so that the person has elevated rights?
Many thanks
<
Code:
Break On
Setconsole("hide")
$Form = CreateObject("Kixtart.Form") $Form.Text = "Disable sound -By S. Wintle" $Form.Size = 330,490 $Form.BackColor = 186,218,240 ;$Image = $Form.Image("\\harry\netlogon\holte1.bmp",200,20,60,60) $TextBox = $Form.TextBox("",150,100,80,20) $Listbox = $Form.ListBox("",20,100,80,80) $ListBox.OnClick = "ListBox_Click()" $Label = $Form.Label("Click on a class room to enable or disable PC sound.",20,10,150,30) $ListBox.List = "ICT1","ICT2","ICT3","LIBRARY","DT2","Multi","music" $Label1 = $Form.Label("The following rooms below are disabled.",20,200,150,30)
$Button1 = $Form.Button("Disable PC sound",10,340,120,40) $Button2 = $Form.Button("Enable PC sound" ,150,340,120,40) $ExitButton = $Form.Button("Exit",85,410,110,40)
$ExitButton.onClick = "Quit()" $Button1.OnClick = "Button1_Click()" $Button2.onClick = "Button2_Click()"
$Form.Center $Form.Show
While $Form.Visible $=Execute($Form.DoEvents) Loop Quit()
Function ListBox_Click $TextBox.Text = $ListBox.Value EndFunction
Function Button1_Click
$cont = MessageBox("sound disabled OK?", "KiXtart", 36)
If $cont = 6 Endif
SELECT
CASE $TextBox.Value = "ICT1"
;Run "c:\winnt\system32\beyondexecv2 \\ICT1-01 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-02 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-03 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-04 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-05 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-06 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-07 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-08 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-09 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-10 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-11 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-12 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-13 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-14 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-15 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-16 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-17 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-18 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-19 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-20 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-21 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-22 c:\winnt\nircmd.exe mutesysvolume 1" Run "c:\winnt\system32\beyondexecv2 \\ICT1-23 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-24 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-25 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-26 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-27 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-28 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-29 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-30 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-31 c:\winnt\nircmd.exe mutesysvolume 1" ;Run "c:\winnt\system32\beyondexecv2 \\ICT1-32 c:\winnt\nircmd.exe mutesysvolume 1"
ENDSELECT EndFunction
Function Button2_Click
$cont = MessageBox("PC sound enabled OK?", "KiXtart", 36)
If $cont = 6 Endif
SELECT CASE $TextBox.Value = "ICT1" Run "c:\winnt\system32beyondexecv2 \\serv2k1 c:\winnt\nircmd.exe mutesysvolume 1"
CASE $TextBox.Value = "ICT2"
Run "c:\winnt\system32beyondexecv2 \\serv2k1 c:\winnt\nircmd.exe mutesysvolume 1"
CASE $TextBox.Value = "ICT3"
Run "c:\winnt\system32beyondexecv2 \\serv2k1 c:\winnt\nircmd.exe mutesysvolume 1"
CASE $TextBox.Value = "LIBRARY"
Run "c:\winnt\system32beyondexecv2 \\serv2k1 c:\winnt\nircmd.exe mutesysvolume 1"
CASE $TextBox.Value = "DT2"
Run "c:\winnt\system32beyondexecv2 \\serv2k1 c:\winnt\nircmd.exe mutesysvolume 1"
CASE $TextBox.Value = "multi"
Run "c:\winnt\system32beyondexecv2 \\serv2k1 c:\winnt\nircmd.exe mutesysvolume 1"
CASE $TextBox.Value = "music"
Run "c:\winnt\system32beyondexecv2 \\serv2k1 c:\winnt\nircmd.exe mutesysvolume 1"
ENDSELECT
EndFunction
EXIT
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#156696 - 2006-02-06 01:02 PM
Re: disabling sound on mass (scripts/forms)
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Hi,
Thanks for that pointer, you know it really is great to have guys like you that don't patronise and are willing to help out!
Are you suggesting that we add a pupil worstation account on each local machine? Give local admin rights. As I am interested in changing pupils domain passwords (or rather the teacher doing this) would this allow us to this?
Many thanks.
Steve
|
|
Top
|
|
|
|
#156698 - 2006-02-06 02:47 PM
Re: disabling sound on mass (scripts/forms)
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Hi thanks again,
Because the format of my machine names are [string]-01...[string]-09 then [string]-10 ... [string]-30 the script does nothing, I tried it from command line and it works fine. Tried the following: Code:
;$LT_machineCount = 9 ;for $=1 to $LT_machineCount ;Run "c:\winnt\system32\beyondexecv2 \\LT-"+right("0"+$,2)+" c:\winnt\nircmd.exe mutesysvolume 1" ;next
$LT1_machineCount = 30 for $=10 to $LT1_machineCount Run "c:\winnt\system32\beyondexecv2 \\LT-"+right($,2)+" c:\winnt\nircmd.exe mutesysvolume 1" next
Regards
Steve.
|
|
Top
|
|
|
|
#156700 - 2006-02-06 03:03 PM
Re: disabling sound on mass (scripts/forms)
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Hi,
About adding to groups, on each workstation to local groups we have added to administrators group the domain group staff. Now every teacher belongs to the local admins group on each workstation. Should teacher now be able to change passwords in active directory?
Regards.
Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#156702 - 2006-02-06 04:01 PM
Re: disabling sound on mass (scripts/forms)
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Ok thanks,
But how might I employ the script below and incorporate it into a kix script? Given that I want to give a group (staff) not an invididual user rights to change the passwords for users in OU [curriculum].
regards
Steve.
Code:
Const ADS_ACETYPE_ACCESS_ALLOWED_OBJECT = &H5 Const ADS_FLAG_OBJECT_TYPE_PRESENT = &H1 Const ADS_FLAG_INHERITED_OBJECT_TYPE_PRESENT = &H2 Const ADS_RIGHT_DS_CONTROL_ACCESS = &H100 Const ADS_ACEFLAG_INHERIT_ACE = &H2
Set objSdUtil = GetObject("LDAP://OU=Finance, DC=fabrikam,DC=Com") Set objSD = objSdUtil.Get("ntSecurityDescriptor") Set objDACL = objSD.DiscretionaryACL
Set objAce = CreateObject("AccessControlEntry")
objAce.Trustee = "FABRIKAM\kmyer" objAce.AceFlags = ADS_ACEFLAG_INHERIT_ACE objAce.AceType = ADS_ACETYPE_ACCESS_ALLOWED_OBJECT objAce.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT OR ADS_FLAG_INHERITED_OBJECT_TYPE_PRESENT objAce.ObjectType = "{ab721a53-1e2f-11d0-9819-00aa0040529b}" objACE.InheritedObjectType = "{BF967ABA-0DE6-11D0-A285-00AA003049E2}" objAce.AccessMask = ADS_RIGHT_DS_CONTROL_ACCESS objDacl.AddAce objAce
objSD.DiscretionaryAcl = objDacl
objSDUtil.Put "ntSecurityDescriptor", Array(objSD) objSDUtil.SetInfo
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#156705 - 2006-02-08 10:21 AM
Re: disabling sound on mass (scripts/forms)
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Thanks,
I would be grateful if at all possible is their a way that a user can somehow pass user credentials in a kix script (login and password details)?
Regards
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(mole)
and 1300 anonymous users online.
|
|
|