To quickly obtain the devices using an IPv4Address in a scope reverse ping the scope in PowerShell (5.1)
‘#’ReverseLookup-Ipv4Address-By23Range.ps1’
$subnet = read-host -Prompt “What IP scope with /23 range? -leave off the last octet numbers – like this 10.228.30. “
for ($i=0; $i -le 511; $i++) {
$ip = $subnet + $i
Resolve-DnsName -name $ip -ea SilentlyContinue|select Server,Name -First 1
}
See the 511? That’s because /23 is 512 IPV4 Addresses (always minus 1)
To adjust for /24 just change the 511 to 255, /25 is 127, and so on :
Number of Addresses | Number of Bits | Prefix | Classful Notation | Mask |
---|---|---|---|---|
1 | 0 | /32 | 255.255.255.255 | |
2 | 1 | /31 | 255.255.255.254 | |
4 | 2 | /30 | 255.255.255.252 | |
8 | 3 | /29 | 255.255.255.248 | |
16 | 4 | /28 | 255.255.255.240 | |
32 | 5 | /27 | 255.255.255.224 | |
64 | 6 | /26 | 255.255.255.192 | |
128 | 7 | /25 | 255.255.255.128 | |
256 | 8 | /24 | 1 C | 255.255.255 |
512 | 9 | /23 | 2 C | 255.255.254 |
1 K | 10 | /22 | 4 C | 255.255.252 |
2 K | 11 | /21 | 8 C | 255.255.248 |
4 K | 12 | /20 | 16 C | 255.255.240 |
8 K | 13 | /19 | 32 C | 255.255.224 |
16 K | 14 | /18 | 64 C | 255.255.192 |
32 K | 15 | /17 | 128 C | 255.255.128 |
64 K | 16 | /16 | 1 B | 255.255 |
128 K | 17 | /15 | 2 B | 255.254 |
256 K | 18 | /14 | 4 B | 255.252 |
512 K | 19 | /13 | 8 B | 255.248 |
1 M | 20 | /12 | 16 B | 255.240 |
2 M | 21 | /11 | 32 B | 255.224 |
4 M | 22 | /10 | 64 B | 255.192 |
8 M | 23 | /9 | 128 B | 255.128 |
16 M | 24 | /8 | 1 A | 255 |
32 M | 25 | /7 | 2 A | 254 |
64 M | 26 | /6 | 4 A | 252 |
128 M | 27 | /5 | 8 A | 248 |
256 M | 28 | /4 | 16 A | 240 |
512 M | 29 | /3 | 32 A | 224 |
1024 M | 30 | /2 | 64 A | 192 |
Btw, if you are not using Gab.ai by now, you SHOULD. Gab.ai is FAR FASTER than even Copilot.Microsoft.com!!! I do tend to compare the results with each other to be sure I get accurate data, but man, oh MAN, is Gab.ai FAST, and accurate.
I recently asked Copilot the EventIDs to troubleshoot a PDC emulator after a reboot. Microsoft’s AI gave me PC answers, like sending me to Learn URLs, instead of the actual EventIDs, where Gab.ai gave me the exact answer (like 1058)!
Just a quick note about Copilot.Microsoft.com, though: It’s able to be set up internally in your corporation/business so that all interaction is secure and not replicated outside the network! VERY nice for specific questions with company sensitive data; No having to :adjust” the question to keep your confidential data secured when you use CoPilot. (But GAB.ai does let you keep everything secured to your own login, btw. And then you delete the conversation later if need ve. No prying eyes.)