I found the answer over at Microsoft's Technet Scripting Center forum.
Just in case anyone is searching for this also on this forum, I found out
that Microsoft System Center Configuration Manager will push batch files
also. So it would be easier, for me at least, to create a batch file than
a VB script. But, if anyones is looking for the VB script, here is what
was posted over there:
sComputer = "."
aTargetSvcs= Array("SERVICE1","SERVICE2","SERVICE3")
Set oWMIService = GetObject("winmgmts:" &
"{impersonationlevel=impersonate}!\\" _
& sComputer & "\root\cimv2")
Set cServices = oWMIService.ExecQuery("SELECT * FROM Win32_Service")
For Each oService In cServices
For Each sTargetSvc In aTargetSvcs
If LCase(oService.Name) = LCase(sTargetSvc) Then
If oService.State <> "Stopped" Then
oService.StopService()
End If
If oService.StartMode <> "Disabled" Then
oService.ChangeStartMode("Disabled")
End If
End If
Next
Next
The other suggestion over there, if you were going to create a batch file,
is to use the sc.exe command; 'sc stop' and 'sc config'
--
Have a Better One,
Edward Crosby
http://www.edwardcrosby.com
-----
"There are no atheists in foxholes or firmware updates."
Merlin Mann
> I'm hoping someone here has some pretty good knowledge on scripting. I am
> looking for a VB script to run on some Windows 2003 servers.
> Here is what I posted on Technet and other forums:
> I am currently searching through Google results but I was hoping someone
> would be able to assist me here too.
> I am looking for a VB script that will stop more than one service on a
> Windows 2003 server then set it to Disabled silently, without user
> interaction.
> We are using System Center Configuration Manager in our environment and I
> want to use this to push a VB script to a few servers on our domain to
> stop some services and then set the services to Disabled. This script will
> need to be written to run locally, instead of remotely, as Config Manager
> will be pushing it to the local machine.
>
>
> --
> Have a Better One,
> Edward Crosby
> http://www.edwardcrosby.com
> -----
> "There are no atheists in foxholes or firmware updates."
> Merlin Mann
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Unique Geek" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/theuniquegeek?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "The
Unique Geek" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/theuniquegeek?hl=en.