![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Services on remote machines Would appreciate any help with the following script. The script reads a text file containing a list of services that I want to change the startup type on. For example: alerter,disables. This works fine on the local machine. How do I read in a list of remote machines along with the list of services. I want to set the startup type on services of remote servers. Thanks You. foreach ($service in get-content "V:\Program Files\PowerGUI\my scripts\windows 2003 elective services.txt") { $newAry = $service.split(',') $strsvcs = $newAry[0] $strtype = $newAry[1] $chkservice = get-service -name $strsvcs -ErrorAction silentlycontinue If ( ! $chkservice) {"not installed"} Else {set-service $strsvcs -startuptype $strtype "$strsvcs is $strtype"} } |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Services on remote machines get-service doesnt work remotely.. you need to use .NET or WMI. In your case I would use WMI. $service = get-wmiobject win32_service -computer Server1 -filter "name='<ServiceName>'" $service.state "BarbS" <BarbS@xxxxxx> wrote in message news:ECD22465-1A70-4CD6-BD01-450F14ADF27A@xxxxxx
| ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remote assistance between XP and Vista machines | Olumide | Vista General | 4 | 07-05-2008 07:33 AM |
| Remote assistance between XP and Vista machines | Olumide | Vista networking & sharing | 1 | 06-17-2008 08:58 PM |
| Can't remote into Vista Ultimate machines | eappell | Vista networking & sharing | 4 | 02-23-2008 07:23 AM |
| Terminal Services - Remote Desktop Connection | AJD | Vista General | 3 | 11-07-2006 01:28 PM |
| interact with remote machines | JJ Streicher-Bremer | PowerShell | 2 | 08-03-2006 04:59 AM |