stop and start website on a remote iis 6.0 server

I want to start and stop a website on a IIS Server on server 2003 from windrows XP. All the machines are on one single domain. I have managed to get a script together to do this on the server but cannot do the same from the local machine. The error permeation denied comes up because the script s using my windrows credentials. I dont want to add the user to administrative group on the server. The scrip is as below.

strComputer = "(Remot machin/IP address)"  'e.g.
strPath = "W3SVC/6167585"         'e.g. W3SVC/1
strUname = "administrator"
strPassword = "********"

' ------ END CONFIGURATION ---------
set objIIS = GetObject("IIS://" & strComputer & "/" & strPath)

WScript.Echo "Web site " & strComputer & "/" & strPath & " successfully stopped"

WScript.Echo "Web site " & strComputer & "/" & strPath & " successfully started"

Can some one advise on how to make this script work from client machin may be use the GetObject in a better way.
Thank you.
Who is Participating?
Qouted from the fore mentioned article.

4673 » How do I allow users to Start, Stop, and Pause a Windows 2000 / Windows XP Service? 11-Jan-02

In order to Start, Stop, and Pause a service, users need the following permissions:


Stop, Start, and Pause

These permissions are only exposed in Group Policy.

You can create OUs that contain the workstations that you want the policy applied to.

To assign service permissions to the computers in an OU:

01. Open the Active Directory Users and Computers snap-in.

02. Right-click a domain and press New and Organizational Unit.

03. Name the OU and press OK.

04. Right-click this new OU and press Properties.

05. Select the Group Policy tab.

06. Press New and name the policy.

07. Highlight the new policy and press Edit.

08. Navigate to Computer Configuration / Windows Settings / Security Settings /System Services.

09. Double-click the service you want users to manage.

10. Check the Define this Policy Setting box.

11. Remove the Everyone group.

12. Add the System account, Domain Admins and any user or groups you desire.

13. Grant the System account and Domain Admins Full Control. Grant the other users and groups both Read and Stop, Start, and Pause permissions.

14. Press OK.

15. Change the startup mode from Disabled to Automatic or Manual.

16. Press Apply and OK.

17. Close the policy and press OK.

18. Move the computer accounts that you want effected into the OU.

NOTE: See tip 2184 » Windows 2000 Group Policy refresh.

Have you tried running the script on your XP workstation using the RunAs Command and providing the server administrator credentials?
You can script a simple shell cmd of
Runas sc  \\dcname stop servicename
RunAs sc \\dc start servicename

sc is a resource kit utility

and example script to shell as in vbscript

If you use the msscript debugger built into office, or another script editor it will compile it into an exe for you so your passwords not given in the script plain to read.  Otherwise you might as well give him admin rights.

I think an easier/more secure/safer option would be to allow the user the right to do it his with his own account though,

"How do I allow users to Start, Stop, and Pause a Windows 2000 / Windows XP Service"

this will also apply to 03 AD I use it myself.


Any success setting up your service gpo?

Just checking back with you to see how you made out.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.