- 1 year ago
How can I determine 'Network Discovery' status, (enabled|disabled), of a remote computer
Comment
1 / 1
To determine the 'Network Discovery' status (enabled or disabled) of a remote computer, you can use PowerShell with the Get-NetFirewallProfile
cmdlet. Here's an example:
powershell$computerName = "<RemoteComputerName>"
$networkProfile = Get-WmiObject -Class Win32_NetworkProfile -ComputerName $computerName |
Where-Object { $_.Name -eq "Domain" }
$networkDiscoveryStatus = if ($networkProfile) {
if ($networkProfile.EnableNetworkDiscovery) {
"Enabled"
} else {
"Disabled"
}
} else {
"Unknown"
}
Write-Output "Network Discovery Status on $computerName: $networkDiscoveryStatus"
Replace <RemoteComputerName>
with the actual name or IP address of the remote computer you want to query. This script uses the Get-WmiObject
cmdlet to retrieve the Win32_NetworkProfile
information for the "Domain" network profile on the remote computer. It then checks the EnableNetworkDiscovery
property to determine whether network discovery is enabled or disabled.
You can run this script on your local machine and specify the remote computer name in the $computerName
variable. The script will output the 'Network Discovery' status for the remote computer.