DSC Service Resource

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Justin King Justin King 10 months, 1 week ago.

  • Author
    Posts
  • #34380
    Profile photo of Ed O'Connor
    Ed O’Connor
    Participant

    Hi,

    I am trying to ensure that the Remote Registry Service is always set to Automatic (triggered) with a dependency on the "Remote Procedure Call (RPC)" Service. No matter what I do I am getting a error when trying to generate the MOF that it is not in the correct format or the "Remote Procedure Call (RPC)" Service does not exist.

    Here is what I tried:

    #Ensure Remote Registry is set to Automatic
    	Service RemoteRegistry
    	{
    		Name = "RemoteRegistry"
    		DependsOn = "[Service]RpcSs"
    		StartupType = "Automatic"
    	}
    #Ensure Remote Registry is set to Automatic
    	Service RemoteRegistry
    	{
    		Name = "RemoteRegistry"
    		DependsOn = "[Service]Remote Procedure Call(RPC)"
    		StartupType = "Automatic"
    	}
    

    When I run a Get-Service for RPCSS I get this info:

    Name: RPCSS
    DisplayName: Remote Procedure Call (RPC)
    ServiceName: RPCSS

    I know this service exists and I have tried both the name and display name to no avail. Can someone tell me what I am doing wrong here?

    Thanks, Ed

  • #34381
    Profile photo of Don Jones
    Don Jones
    Keymaster

    So, to begin with, you can't have two Service resources with the same name – you've got them both set to RemoteRegistry.

    DependsOn is not a "this service depends on this other service," which is how you're trying to use it. DependsOn creates an application order for DSC settings. You haven't defined a Service resource named "Remote Procedure Call(RPC)," which is why you're getting an error. Similarly, you've not defined a Service resource named RpcSs.

    The Service DSC resource does not currently support setting service dependencies.

  • #34382
    Profile photo of Ed O'Connor
    Ed O’Connor
    Participant

    I realized I had two service resources, I just wanted to show the two ways I was trying to get this to work.

    Thanks for the feedback, makes sense.

  • #34501
    Profile photo of Justin King
    Justin King
    Participant

    (it's late, this question is silly , and I can't find the delete button. Feel free to ignore)

You must be logged in to reply to this topic.