I have the following DSC resource:
Service sacsvrManual {
Name='sacsvr'
StartupType='Manual'
}
Notice that there is no State mentioned. But when it runs, I get the following, indicating it tested it and decided that it needed to be RUNNING:
VERBOSE: [MTS1020]: LCM: [ Start Resource ] [[Service]sacsvrManual]
VERBOSE: [MTS1020]: LCM: [ Start Test ] [[Service]sacsvrManual]
VERBOSE: [MTS1020]: LCM: [ End Test ] [[Service]sacsvrManual] in 0.0160 seconds.
VERBOSE: [MTS1020]: LCM: [ Start Set ] [[Service]sacsvrManual]
VERBOSE: [MTS1020]: [[Service]sacsvrManual] Service ‘sacsvr’ already exists. Write properties such as Status, DisplayName,
Description, Dependencies will be ignored for existing services.
VERBOSE: [MTS1020]: LCM: [ End Set ] [[Service]sacsvrManual] in 2.5780 seconds.
PowerShell DSC resource MSFT_ServiceResource failed to execute Set-TargetResource functionality with error message: Failure starting service
‘sacsvr’. Please check the path ‘C:\Windows\System32\svchost.exe -k netsvcs’ provided for the service. Message: ‘Exception calling “WaitForStatus”
with “2” argument(s): “Time out has expired and the operation has not been completed.”’
+ CategoryInfo : InvalidOperation: ( , CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : MTS1021
I can’t figure out why it is deciding to start the service.