none
Get network location for server 2008r2 RRS feed

  • Question

  • I created a monitor for client servers so i know when they are showing on a public network. Works Great on 2012 and newer. Is there a way to query the network category on server 2008r2? the one that works on 2012 is Get-NetConnectionProfile

    The end goal is i need to know what the network location is because that determines what firewall settings are applied. public, private, work or domain

    • Moved by Bill_Stewart Wednesday, November 29, 2017 6:34 PM No, you can't do that
    Tuesday, October 10, 2017 3:24 PM

All replies

  • Hi SGTWTF22,

    If you run:

    Get-NetConnectionProfile | Get-Member
    
    
       TypeName: Microsoft.Management.Infrastructure.CimInstance#root/StandardCimv2/MSFT_Net
    ConnectionProfile
    It shows the above TypeName. You can see that it is a CimInstance. Using that information, you can run the below command.

    Get-CimInstance -Namespace 'root/StandardCimv2' -ClassName 'MSFT_NetConnectionProfile'

    OR

    Get-WmiObject -Namespace 'root/StandardCimv2' -ClassName 'MSFT_NetConnectionProfile'

    I don't have a 2008R2 server in my test environment to test, hopefully it works though. 



    Thanks, Tim. | Please remember to mark the replies as answers if they help. |

    Friday, October 13, 2017 6:47 AM
  • Get-NetConnectionProfile is not available on W2K8.  Always reference the docs when in doubt: https://technet.microsoft.com/en-us/library/jj899566(v=wps.620).aspx



    \_(ツ)_/

    Friday, October 13, 2017 7:03 AM
  • Thanks jrv. As answered here, MSFT_NetConnectionProfile class doesn't exist in Server 2008R2.

    Thanks, Tim. | Please remember to mark the replies as answers if they help. |

    Friday, October 13, 2017 7:09 AM