Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to disable Network Service

Status
Not open for further replies.

teqmod

Technical User
Sep 13, 2004
303
US
Please Help!! I am very new to VBScript and need to put this together if possible.

We need to disable the Check point Securemote service on the network interfaces for remote users and then enable them again. This can be 2 seperate scripts but I do not know where to even start for this.

Here is the situation:
Sales staff travel all around and need to access resources in the office. Our parent company provides the firewall and VPN solution. When a user is in a hotel that requires them to use the Hotel proxy (and click OK on a web page) they cannot because the Check point service is preventing this. Our parent company gave us the solution of turning this off to connect and then turning it back on however our sales staff are really struggling trying to do this. Since we do not have direct access to the firewall we cannot actually fix the problem, just use the workaround.

Proposed solution:
What I would like to do is come up with a script the user can run that disables the network service. The user can then connect and authenticate at the hotel and then have a second script that enables the network service.

If anyone can help me with this I would greatly appreciate it.

 
What it sounds like you want is not to disable the network service, but to disable the checkpoint firewall service and re-enable it again later.

To give you a starting point...

Start by locating to checkpoint service you will need to stop with your script.

Then the script should do 2 things.

1st - Stop the service
2nd - disable the service (this may not be needed unless the service auto restarts)

Here is a sample script from VBscript to stop a service and it's Dependants to get you going.

Code:
' Stop a Service and Its Dependents

' Windows Server 2003 : Yes
' Windows XP : Yes
' Windows 2000 : Yes
' Windows NT 4.0 : Yes
' Windows 98 : Yes

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colServiceList = objWMIService.ExecQuery("Associators of " _
    & "{Win32_Service.Name='NetDDE'} Where " _
        & "AssocClass=Win32_DependentService " & "Role=Antecedent" )

For Each objService in colServiceList
    objService.StopService()
Next

Wscript.Sleep 20000

Set colServiceList = objWMIService.ExecQuery _
        ("Select * from Win32_Service where Name='NetDDE'")
For Each objService in colServiceList
    errReturn = objService.StopService()
Next

John

 
Thanks for the input but simply stopping the Checkpoint firewall service is not enough to get this to work. The network bunding prevents communication if this is not running so it needs to be disabled as well.

I have attached an image of what needs to be unchecked in order for this to work.
 
 http://www.geocities.com/teqmod/network.bmp
I see your dilemma now. That will take a bit longer to figure out. I have not tried to disable a network service that is bound to an adapter before. Thanks for the image that explained what you needed much better.

John
 
Yeah, I have not been able to figure it out yet. Been looking for a little while now and no success. If you come up with anything please let me know.

-Chris
 
Have you tried o change the NDIS binding order? I know it sounds crazy, but I had to do it for a 8000 plus sales force to solve some other opportunities and it helped with the checkpoint firewall of other outsourcer. Microsoft has a white paper on the steps. I also have a script I will send to do this through a GP.
 
Unfortunately this has fallen a bit to the side. Shall I say "Overcome by Events" We have just removed the VPN client from most machines for those who travel extensively. We have moved several key applications onto Citrix for them and Since we can use Outlook with RPC over HTTP we were able to get the users working sufficiently this way. Those users who just work from home don't have the issue.

If you have a script of some kind I would love to have a look as I am sure this issue will resurface in the next couple months.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top