michalek19
asked on
Powershell script to modify service startup type from Automatic to Manual
Hi
Can some help me to modify a powershell script to change STARTUP Type for some of services from AUTOMATIC to MANUAL ?
This script is for starting service. I need the same script to modify Startup Type.
$serverList = gc servers.txt
$serviceList = gc services.txt
ForEach ($server in $serverList)
{
ForEach ($service in $serviceList)
{
Get-Service -Name $service -ComputerName $server | Start-service
}
}
Can some help me to modify a powershell script to change STARTUP Type for some of services from AUTOMATIC to MANUAL ?
This script is for starting service. I need the same script to modify Startup Type.
$serverList = gc servers.txt
$serviceList = gc services.txt
ForEach ($server in $serverList)
{
ForEach ($service in $serviceList)
{
Get-Service -Name $service -ComputerName $server | Start-service
}
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Qlemo would you be able to explain why its better to do it your method vs Jose.
Yours look more straight forward, but is there any benefit in performance?
Yours look more straight forward, but is there any benefit in performance?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
orOpen in new window