PowerShell GUI prompt for IP address to search for AD computers
Posted on 2016-10-03
I am really new to PowerShell but learning. What I am wanting is a powershell script that when launched will create a GUI interface and prompt for a single IP address or allow the use of a wild card to search a range of IPs (ie. 10.0.0.*), then will use the IP address information to search AD for the machine(s) with that IP address.
The command I am using in powershell command line is as follows:
get-adcomputer -filter * -properties ipv4address | where ipv4address -like "111.222.333.*" | select name, ipv4address, distinguishedname | Out-GridView
This command works in powershell but when I try to script it, it just sits there doing nothing. It doesn't error out, it just doesn't do anything at all.
Quite often I get notified about a machine needing some kind of attention and the only information I am given is an IP address and sometimes I'll get a username nothing else. So I have to type in the command and run it to find where the machine lives so I can do what needs to be done. I'd like to script it so that I can launch it, enter in the IP or range of IPs and then get as much details from that search as I can in as short amount of time as possible. And if there is a better command to use any suggestions are most welcome.
Thanks in advance,