Change Node Name through Code or Command

Welcome Forums DSC (Desired State Configuration) Change Node Name through Code or Command

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

4 years, 4 months ago.

  • Author
  • #19660

    Points: 0
    Rank: Member

    Is there any way to have the node name in configuration data file to be changed through program or and command. Actually I am creating DSC scripts and after that I am provisioning a new VM so till the Vm is created I dont know the node name and my DSC scripts are copied there and then they needs to be run, so I want to change the node name automatically in Configuration data after VM is created.

    Thanks in advance 🙂

  • #19661

    Points: 24
    Team Member
    Rank: Member

    If your configuration script takes the node name as parameter you can specify any name necessary to generate the MOF document.

    Configuration Example
        [String] $NodeName
      Node $NodeName
        # ...
    Example -NodeName HelloWorld
    # Will generate HelloWorld.mof
    Example -NodeName 4d383c33-aefe-422b-8329-b2b0544fd958
    # Will generate 4d383c33-aefe-422b-8329-b2b0544fd958.mof

The topic ‘Change Node Name through Code or Command’ is closed to new replies.

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