Hi,
Refer this script to ping servers on the same network.
Note: Run as logged in user system must be actively logged on otherwise it leads to a failed status
Refer the below link for the script:
https://scripts.comodo.com/frontend/web/topic/script-to-ping-servers-on-the-same-network
Thank you.