Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Disabling services remotely

  • 08-07-2003 3:15pm
    #1
    Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭


    Hi All,

    I'm using the NETSVC servicename \\computername /stop to stop a service on a remote Win2k server machine. The only problem is, I want to disable it also.

    Anybody know how to do this?

    Thanks,

    TD.


Comments

  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,567 Mod ✭✭✭✭Capt'n Midnight


    Set it up and you can disable almost anything except DHCP client :) - all you need is IP - no netlogon or sharing any of that stuff

    Other options include a batch file - click it and it can close stuff down from that end.

    Start
    Run
    cmd
    Net Start > net stop.bat
    notepad netstop.bat
    and replace 4 spaces with NET STOP " and add another " at end of line.


    If you have a domain (XP home need not apply) you can use the server manager...


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Yes, we do use VNC and Windows Terminal Server.

    The reason I want to do it at the command line is that I have 30+ machines I need to disable a service on! I need to write a script to do it. I have tried rclient with a batch file (the /R switch) but it doesn't seem to run properly, may be permission related, I'm not so sure.

    As you know, with VNC/WTS I have to log in manually and disable each service in turn. It's no fun with that amount of machines and when I have to start them back up again....


  • Registered Users, Registered Users 2 Posts: 928 ✭✭✭jabberwock


    windows 200 resource kit.


    I have been playing around with the same idea for a week or so, as we are transfering from RCO to VNC.

    so far I've got a silent install of VNC over the network. sets the passwords up with a reg import and starts the service using the 'at' command.

    using the lines below in a bat file you can stop and disable a service.

    'sc' is in the Win2k resource kit

    sc \\%1 stop service
    sc \\%1 config service start= disabled


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,567 Mod ✭✭✭✭Capt'n Midnight


    you can use AT to schedule a command remotely - just set it for 5 minutes time. Note you should also setup Time synch on the network


    At > at-list.txt
    if errorlevel 1 goto checkOS
    find "net time /domain:MyDomain /set /y" < at-list.txt
    If errorlevel 1 At %1 11:00 /every:M,T,W,Th,F,S,Su net time /domain:MyDomain /set /y

    net time \\192.168.0.1 /Set /Y

    Note: could also use this in a logon script to start the schedule service etc...

    WinAT is a graphic version from the resource kit.

    Once upon a time I had to remote admin an NT 3.51 server - could not use VNC :( - so setup a batch file to run every 5 minutes
    it would check for the existance of another batch file - if it existed call it and then delete it. - so all i had to do was push a batch file in a shared folder on the server and wait 5 minutes...

    If you have a really secure folder (ha) you could use a central batch file and dump a text file locally so you know it has been run...

    Must post that VNC install - there is one on the FIRE cd too.


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Originally posted by jabberwock


    sc \\%1 stop service
    sc \\%1 config service start= disabled

    I've tried the disabled option, but it doesn't like the syntax. I've tried various permutations, still no joy. The stop service works fine.

    It tells me that the correct syntaxt is sc config service name - it doesn't give an option to do it on a remote machine (which seem quite odd). Am I missing something?


  • Advertisement
  • Closed Accounts Posts: 495 ✭✭Beëlzebooze


    write the correct value directly to the clients registry?
    HKLM\System\Currentcontrolset\services\"Service you want to control"

    Key: Start

    Value:
    1 = system
    2 = Automatic
    3 = manual
    4 = disable


  • Closed Accounts Posts: 132 ✭✭marrakesh


    use a VBS script and apply to all computers in the domain.


  • Registered Users, Registered Users 2 Posts: 1,237 ✭✭✭GUI


    lads,
    did ye all forget the WMI Interface?

    to control any computer on a domain with domain admin permissions..

    right-click on Computer Management
    and connect to another computer

    enter computer name

    then go to Services and Applications
    and u can control them as if u were at the local machine

    start stop configure services and device manager


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    Originally posted by GUI
    lads,
    did ye all forget the WMI Interface?

    to control any computer on a domain with domain admin permissions..

    Yes, I know, but the whole point is that there are over 30+ machines and to log into each on individually is too slow.

    Bit of background - working in an IT dept for a multinational, we have regular shutdowns, roughly every 3 months. We have a limited downtime in which to get loads of projects done (not just us - there are other groups aswell). We are the constraint of the shutdowns - we hold everybody up while we are logging into each machine and disabling services, same goes when we are bringing everything back up. Hence my need to script as much as possible and speed things up.

    I'll keep at it an let y'all know how I get on.

    TD.


  • Registered Users, Registered Users 2 Posts: 1,237 ✭✭✭GUI


    tom
    there are many resource kit tools that are designed for this purpose..

    ive used a few of them in the past


  • Advertisement
  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 93,567 Mod ✭✭✭✭Capt'n Midnight


    set PC BIOS to Resume if power failure (or boot on LAN)

    net view > pclist.txt
    parse the list using the FOR command
    Shutdown.exe \\PC /Y/ C (add /R for a reboot now) - resource kit

    to turn them all on again - trip the power - servers have UPS's don't they - ;)

    ( better yet leave a copy of cluster knoppix in a laptop )

    Disabling services - batch file
    net start > net-stop.bat - change 4 spaces to NET STOP" for the services you want to stop....


Advertisement