xNetworking Module – PowerShell Desired State Configuration Resource Kit

The xNetworking module is a part of the DSC Resource Kit, which is a collection of DSC Resources produced by the PowerShell Team. This module contains the xIPAddress and xDnsServerAddress resources that allow configuration of a node’s IP Address and DNS Server Address.

 
 
 
 
 
4.5 Star
(2)
8,743 times
Add to favorites
Networking
8/7/2015
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • xFirewall not creating rule
    1 Posts | Last post August 13, 2015
    • Hello,
      
      I have been trying to use the xFirewall resource to create a basic rule that opens a list of ports. I originally had a much longer stanza but kept getting an error that the rule was not created. I am now trying to create a very basic rule as per your example and I am still receiving the same error. The follow is my stanza followed by the START-DSCconfiguration output. 
      
      xFirewall Test {
          Name = "Test"
          Access = "Allow"
          ApplicationPath = "c:\windows\notepad.exe"
          }
      
      VERBOSE: [SAC-DEV-DSC3]: LCM:  [ Start  Resource ]  [[xFirewall]Test]
      VERBOSE: [SAC-DEV-DSC3]: LCM:  [ Start  Test     ]  [[xFirewall]Test]
      VERBOSE: [SAC-DEV-DSC3]:                            [[xFirewall]Test] TEST: Find rules with specified parameters
      VERBOSE: [SAC-DEV-DSC3]:                            [[xFirewall]Test] Get-FirewallRules: No Firewall Rules found for [Test]
      VERBOSE: [SAC-DEV-DSC3]:                            [[xFirewall]Test] TEST: Get-FirewallRules returned NULL
      VERBOSE: [SAC-DEV-DSC3]:                            [[xFirewall]Test] TEST: Returning False
      VERBOSE: [SAC-DEV-DSC3]: LCM:  [ End    Test     ]  [[xFirewall]Test]  in 0.0940 seconds.
      VERBOSE: [SAC-DEV-DSC3]: LCM:  [ End    Set      ]
      VERBOSE: Operation 'Invoke CimMethod' complete.
  • Test-TargetResource xIpAddress
    1 Posts | Last post July 29, 2015
    • Hi,
      
      It seems that the Test-TargetResource for IP Address returns a wrong result because of the if(!$currentIP.IPAddress.Contains($IPAddress))
      
      If your machine e.g. got the 192.168.178.12 by DHCP and you want to give it the 192.168.178.1 by DSC it returns true for the check because "192.168.178.12" contains "192.168.178.1"
  • xIPAddress NewIPAddress
    1 Posts | Last post June 30, 2015
    • IT looks like xIPAddress module is adding additional ip address rather then replacing the existing one. Is there a way to enforce removing an old ip address during DSC? I am able to access server on both ip addresses.
      
      xIPAddress NewIPAddress 
              { 
                  IPAddress      = "192.168.1.5"
                  SubnetMask     = 24 
                  AddressFamily  = "IPV4" 
                  InterfaceAlias = 'Ethernet'
              }  
  • Is it possible to enable or disable system pre defined rules with xFirewall?
    1 Posts | Last post March 05, 2015
    • Im trying to use xFirewall to enable File and Printer sharing in windows. However no matter what I do it seems to just be creating a new rule. So is it possible to enable or disable these rules that already exist? 
  • Server 2008 R2 with PoSH v4
    1 Posts | Last post February 17, 2015
    • The xFirewall resource isn't working due to the following error:
      
      The term 'Get-NetFirewallRule' is not recognized as the name of a cmdlet, function, script file, or operable program.
  • Requirements
    1 Posts | Last post November 03, 2014
    • The requirements section implies that installing WMF 4.0 is sufficient to use this resource. In fact, installing WMF 4.0 on Windows Server 2008 R2 does not supply the needed modules (NetTCP for example) to use this resource.
      
      If there is a way to use this resource on a Windows 2008 R2 server, please post a link to that information because I haven't been able to find it.
      
      Thanks,
  • Ensure these firewall rules are the only ones?
    1 Posts | Last post November 03, 2014
    • Is there a way to have the xFirewall set wipe out any other rules that are there and ensure only the configured ones exist?
  • Allow firewall groups that already exist?
    2 Posts | Last post August 06, 2014
    • I would like to use this to ensure firewall policies will allow remote desktop, how would that look? Just specify the group and then ensure present and allow it?
    • Here is my configuration (2012 R2):
      
      Registry reg_EnableRDP {
          Ensure = "Present"
          Key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server"
          ValueType = "Dword"
          ValueName = "fDenyTSConnections"
          ValueData = "0"
          }
      xFirewall fw_AllowRDP {
          Name = "RemoteDesktop"
          DisplayName = "Remote Desktop"
          DisplayGroup = "Remote Management"
          Ensure = "Present"
          Access = "Allow"
          State = "Enabled"
          Direction = "Inbound"
          LocalPort = ("3389")         
          Protocol = "TCP"
          Description = "Allows remote connections via RDP"
          }
  • DNS2 Assignment
    1 Posts | Last post August 05, 2014
    • Does this module account for assigning a secondary DNS server?
  • Import-DSCResource -ModuleName xFirewall or xNetworking ?
    2 Posts | Last post May 12, 2014
    • It seems that instead of  Import-DSCResource -ModuleName xFirewall in this example command we have to use Import-DSCResource -ModuleName xNetworking command:
      
      configuration Add_FirewallRule 
      { 
          param  
          ( 
              [string[]]$NodeName = 'localhost' 
          ) 
       
          Import-DSCResource -ModuleName xFirewall ### ??? 
       
          Node $NodeName 
          { 
              xFirewall Firewall 
              { 
                  Name                  = "MyAppFirewallRule"             
                  ApplicationPath       = "c:\windows\system32\MyApp.exe" 
                  Access                = "Allow" 
              } 
          } 
       }
    • Thanks for letting us know Oleg.  The issue should be fixed now.
      
      Thanks,
      
      John Slack
      Program Manager
      PowerShell Team