منتديات شبكة الجيل الجديد للتكنولوجيا
 
أقسام موقع ITNAT        
 
 
 

 
 

شاهد الدورات المتاحة الآن وصوت ماهي الدورة الأفضل بالنسبة لك،، اضغط هنا

 

 
 
العودة   ITNAT.COM Forums > الأرشيف > أرشيف منتدى ITNAT لغاية تاريخ 20 - 5 - 2008 > الشبكات العام > ENGLISH Network Forum

ENGLISH Network Forum This Forum will provide complete support for non-arabic members.

رد
 
أدوات الموضوع طرق مشاهدة الموضوع
قديم 28-09-2006, 10:18 AM   #1
fmfm
مشرف إداري
 
الصورة الرمزية fmfm
 
تاريخ التسجيل: Mar 2005
المشاركات: 2,257
افتراضي Starting and stopping services across an entire domain

Stopping and starting services within windows is quite easy. From the command line you can simply type:

net stop to stop a service

or

net start to start a service

Or even easier, open the service manager by clicking on start, run and then type 'services.msc' and click OK



A complete list of services is displayed:



Now you can right click on the service you would like to modify, and start or stop it using the respective menus.

The tricky part is when you need to stop the same service on 400 machines across your LAN. That could be a real pain. What if, for example, [عزيزي الزائر يتوجب عليك التسجيل للمشاهدة الرابطللتسجيل اضغط هنا] and you wanted to quickly stop it on every machine within your network?

The first question we need to ask: How can we stop or start a service remotely?

One way is to use the GUI. The service manager I showed you before can connect to a remote computer. Using this method it takes three clicks and about 45 seconds. 45 Seconds x 400 machines = about 5 hours of lots of clicking.

We definitely want to use the command line for this one.

Microsoft has a utility in the resource kit for Windows XP professional named (sc.exe)

It follows this syntax:

sc.exe computername action service_name

It lets you start and stop services of a remote computer from the command line. Now we are on the right track. Still...I don't like the way this program operates. The major feature it is missing is authentication. I want to provide a username and password all in the same command line tool.

I took the liberty to create such a tool. (Free) It can be [عزيزي الزائر يتوجب عليك التسجيل للمشاهدة الرابطللتسجيل اضغط هنا]

It follows this syntax:

RemoteService.exe HOST ACTION SERVICENAME [USERNAME] [PASSWORD]

Possible actions are: STOP, or START

Username and password are optional.

Here is what it would look like if we used it to start and stop WinVNC on a computer named Computer1



Now. How do we automate this to stop or start a service on *every* computer within a domain? Simple: We create a VB script that will do it for us.

You can download it from here (Right click, and Save As...)

[عزيزي الزائر يتوجب عليك التسجيل للمشاهدة الرابطللتسجيل اضغط هنا]

Here is how it works:

It gets a list of all the computers within the domain you specify. Then it executes our RemoteService.exe with the appropriate command line parameters. RemoteService.exe then returns an exit code, which we use to display the result.

Here is the syntax for the script

RemoteService.vbs Domain Action ServiceName [UserName] [Password]

Action can be either STOP, or START

Again, username and password are optional

I suggest using the cscript.exe VB Script interpreter to invoke it, otherwise you will get a message box for each machine that it processes.

Lets see an example use of the script. Lets say I want to stop WinVNC on all machines within the IntelliAdmin domain:

cscript.exe RemoteService.vbs IntelliAdmin Stop WinVNC

(Make sure RemoteService.vbs and RemoteService.exe are in the same folder)

Another question that pops up is: What is the appropriate service name for use on the command line?

This is a good question. If we go back to our service list that we viewed before (By Launching services.msc) We can double click on any of the services. Now a property window will be shown.



The "Service Name" is what you need to use when invoking the script. It sometimes can be confusing since the name of the service displayed in the GUI can be totally different than the name you can use within the command line.

That's all there is to it. Now with only one line in the command window you can stop or start a service across your entire domain.

Posted By: [عزيزي الزائر يتوجب عليك التسجيل للمشاهدة الرابطللتسجيل اضغط هنا] on Friday, September 22, 2006
__________________
fmfm
-----------------------------------------------------

fmfm غير متواجد حالياً  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
رد مع اقتباس
قديم 28-09-2006, 02:55 PM   #2
kingssongs
مراقب قسم الكتب الإلكترونية
 
الصورة الرمزية kingssongs
 
تاريخ التسجيل: Feb 2006
الدولة: ♥ العراقـــ ♥
المشاركات: 548
افتراضي

بصراحه اذا اكول الموضوع راقي راح اقصر وما انطيه حقه
شكراً جزيلاً وننتظر المزيد من الأبداعات
__________________
[عزيزي الزائر يتوجب عليك التسجيل للمشاهدة الرابطللتسجيل اضغط هنا]
kingssongs غير متواجد حالياً  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
رد مع اقتباس
قديم 02-12-2006, 10:27 PM   #3
edrees84
شبكي
 
تاريخ التسجيل: Dec 2006
المشاركات: 10
افتراضي

مشكوووووووووور
__________________
شبكة الجيل الجديد للتكنولوجيا
www.itnat.com
edrees84 غير متواجد حالياً  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
رد مع اقتباس
رد


الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 
أدوات الموضوع
طرق مشاهدة الموضوع

تعليمات المشاركة
لا تستطيع كتابة مواضيع
لا تستطيع كتابة ردود
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

كود [IMG] متاحة
كود HTML معطلة
Trackbacks are معطلة
Pingbacks are معطلة
Refbacks are معطلة
الانتقال السريع إلى

 
     
 
الساعة الآن: 11:54 AM


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
حقوق الطبع محفوظة للجيل الجديد للتكنولوجيا
 

Copyright ©2008 ITNAT Networks, Inc. All rights reserved.

 

Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.