Using xNetworking on Server 2008 R2

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.

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

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 for the PowerShell related entries.


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

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!

Hey Andrew,

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

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

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.

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?