Just Edit the Scope, in this case 192.168.0.$
The Script Scanns the IP Addresses and Resolves the Hostnames if Possible.
Code: Select all
1..254 | ForEach-Object {Get-WmiObject Win32_PingStatus -Filter "Address='192.168.0.$_' and Timeout=200 and ResolveAddressNames='true' and StatusCode=0" | select ProtocolAddress*}