locked
Detect if the PC is on my homegroup? RRS feed

  • Question

  • Hi all!

    This is a follow up to my latest question : https://social.technet.microsoft.com/Forums/windowsserver/en-US/d6b744aa-1629-4a61-93f4-a791fc7180c4/detect-if-my-laptop-is-on-my-home-wifi?forum=winserverpowershell&prof=required 

    This worked well when the PowerShell script was run only on my laptop. But now I want to run the same script on my laptop and my desktop. My laptop is connected via WIFI and my desktop is connected via Ethernet. At home, both belong to my homegroup.

    The script should make sure it is run from a PC that's on my home network, before executing further actions.

    So now the script should not check if it is connected to my home WIFI access point, as the desktop isn't connected by WIFI. 

    So I am wondering if the script can check if the current PC is connected to my homegroup? Do homegroup have names? How to detect if a PC is connected to a homegroup?

    I have thought of an alternative solution : the script would try to ping the router's local IP address, would that be better?

    Thanks

    -G

    Thursday, October 5, 2017 11:58 AM

All replies