DSC resource run once

Welcome Forums DSC (Desired State Configuration) DSC resource run once

This topic contains 2 replies, has 2 voices, and was last updated by

2 years, 6 months ago.

  • Author
  • #52668

    Points: 2
    Rank: Member

    Hi Using Server 2012R2 with WMF 5.

    The LCM settings set to ApplyandAutocorrect and pull mode.

    Is it possible to make sure a dscresource runs 1 time only. Even though the mof file reruns after restart to finish all configuration?

    The custom resource I am talking about runs the SharePoint configuration Wizard (psconfig), which upgrades databases after installing specific SharePoint updates. I want each node to run psconfig once after joining the SharePoint farm.
    Simply put I want the psconfig resource to run only if the joinfarm resource runs 'Set', which it will only do once, to join the farm.

    I guess I could modify the xsharepoint joining resource to also run psconfig, but I'd rather not mess with Github resources that work great already.

    Can I use the ApplyandMonitor setting in the LCM? Will this make the node finish its mof before monitoring? Though if this works, the problem is still that a change in the configuration and rerun of the mof will launch the psconfig again which I dont want.

    Any suggestions or other steps to make this happen?



  • #52686

    Points: 0
    Rank: Member

    there is no way within dsc to say run this once. The proper way to do this would be to build a db schema check into the test function of the psconfig resource you wrote and when the schema is already on the correct version then return true.

  • #52731

    Points: 2
    Rank: Member

    Hi Ryan,
    Sounds like a good idea. Ill look into it.



The topic ‘DSC resource run once’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort