Monday, May 01, 2006

Tech Tip: Turning off services remotely with Windows

This article applies to Windows Server OS's (Server & Advanced Server 2000, 2003), Windows XP and greater with the Service Controller Query Tool - sc.exe.

sc.exe is contained within the Windows Resource Toolkit. From the Microsoft website:

"The Microsoft® Windows® Server 2003 Resource Kit Tools are a set of tools to help administrators streamline management tasks such as troubleshooting operating system issues, managing Active Directory®, configuring networking and security features, and automating application deployment."

Anyway, what we need is a list of all of the computers on the local network and administrator rights within that domain. To do this, open up the command prompt (Windows-R -> cmd, Start -> Run -> cmd ...) or open the command prompt from the start menu and use the net command to list all available computers.

The usage is:

net view

Then, we need to identify the service name we want to stop. (A useful list of windows services can be obtained through your favourite search engine or here.) Then we do the following (again at the command line):

sc \\hostname stop servicename

where \\hostname is one of the names on the list we got from the net view command. An example would be to remotely stop windows automatic update:

sc \\machine stop wuauserv

The output will look something like the following:

SERVICE_NAME: wuauserv
TYPE : 20 WIN32_SHARE_PROCESS
STATE : 3 STOP_PENDING
(NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x1
WAIT_HINT : 0x3a98


If you need to do this on your local machine, you can either use the hostname of the machine, or leave out the hostname entirely and it should work. Using localhost, however, does not work...

As always, any questions or comments, feel free to post ;)


Tech Tip: YouTube & Bebo - update

Ok, so the instructions for getting a YouTube video for a Bebo flashbox stopped working. This is because YouTube changed the way their videos play. A possible reason for this is the rate at which they're spending their startup capital...

The new way to get a link that works is to view the video on YouTube. Select the text from the box which says 'Embeddable Player'. Copy and paste this into a text editor (Notepad, Word etc). Then copy the website link, it'll look something like this

http://www.youtube.com/v/dsX3zSfktQI



Paste the link into your browser (internet explorer, or if you're cooler, firefox) and hit enter. Then copy the address that comes up once the video starts to play. That's the swf url that bebo are looking for.

The link should look something like this:

http://www.youtube.com/p.swf?video_id=dsX3zSfktQI&eurl=&iurl=http%3A//stati
c15.youtube.com/vi/dsX3zSfktQI/2.jpg&t=OEgsToPDskJYcUEudiZEiNquYCp0sdDY


Any problems with this method, feel free to leave a comment.