Using xNetworking on Server 2008 R2

This topic contains 8 replies, has 4 voices, and was last updated by Profile photo of Andrew Pearce Andrew Pearce 1 year, 8 months ago.

  • Author
    Posts
  • #22679
    Profile photo of Rich Hopkins
    Rich Hopkins
    Participant

    I posted this on the Q&A for the module, but figured I'd ask here just in case someone already has a workaround...

    I'm trying to use the xNetworking module to set Firewall rules on Windows 2008 R2 but keep getting this error: The term 'Get-NetFirewallRule' is not recognized as the name of a cmdlet, function, script file, or operable program. From what I can see, the Get-NetFirewallRule cmdlet isn't available until Win8/2012, so I'm guessing I need to work something out with NETSH.

  • #22680
    Profile photo of Don Jones
    Don Jones
    Keymaster

    That resource does rely on commands introduced in Win2012. You'd have to rewrite the resource to use something older.

  • #23439
    Profile photo of Andrew Pearce
    Andrew Pearce
    Participant

    Hi Rich,

    I have written a DSC Resource to set Firewall rules on Windows Server 2008 R2 as I ran into the same problem. I've got some detail around the resource on my blog, see link below. I haven't covered the Set-TargetResource or Test-TargetResource bits yet, but happy to provide the resource if you'd like it. (and yes, this blog hasn't been updated in a few months ... I need to get back onto that!)

    See [url]http://techielife.net/powershell[/url] for the PowerShell related entries.

    Andrew

  • #23452
    Profile photo of Rich Hopkins
    Rich Hopkins
    Participant

    Perfect! I've love a copy. Do you have to up on GitHub or anywhere?

  • #23474
    Profile photo of Andrew Pearce
    Andrew Pearce
    Participant

    I haven't gotten round to sorting out GitHub and getting my modules up on there yet. (have never looked into how to do that either actually!).

    I've uploaded a the resource to my blog for now... one day I'll sort out GitHub!

    [url]http://techielife.net/wp-content/uploads/2015/03/cLegacyFirewall.zip[/url]

    • #23484
      Profile photo of Steven Murawski
      Steven Murawski
      Participant

      Hey Andrew,

      With your permission, I can get your resources up on the PowerShell.org github repository. Happy to help you share the awesome!

    • #23506
      Profile photo of Andrew Pearce
      Andrew Pearce
      Participant

      Sounds good Steven! I'll try to clean out the code over the weekend so they're in 'better' condition for publishing.

  • #23693
    Profile photo of Steven Murawski
    Steven Murawski
    Participant

    Hey Andrew, I got your resource added to a branch on GitHub. I'll be taking a closer look and trying to get it merged into the main repo soon.

    https://github.com/PowerShellOrg/cNetworking/pull/2

  • #23695
    Profile photo of Andrew Pearce
    Andrew Pearce
    Participant

    Thanks Steven. I'd be keen on your feedback of the resource.

    I haven't had a chance to 'clean up' my other resources yet... 24 hours is not enough time per day!

    Edit: I went to update that just to add my email address to the manifest file but I'm guessing I can't commit to the branch you made?

You must be logged in to reply to this topic.