Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Find a computer in Active Directory with just the IP address (PowerShell)

$
0
0

I was asked to find a computer in the Active Directory based solely on its IP address, and DNS was only giving me ip-<blah)>.reverse.example.com. I managed to get this working in PowerShell (replacing 0.0.0.0 with the IP address I was looking for):

import-module activedirectory
get-adcomputer -filter*-properties ipv4address | where {$_.ipv4address -eq'0.0.0.0'}

What I don't understand is why the following didn't work:

get-adcomputer -filter {ipv4address -eq '0.0.0.0'}
Did I type my filter correctly? Does this work for anyone else?


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>