Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

get-adcomputer question

$
0
0

 

im trying to allow the ability to type partial names into the read-host prompt... example to type in "hsc123" but get all computers with the name hsc12301, hsc12302, hsc12303, etc. I am a newbie when it comes to scripting. basically I need the ability to have wild card input with the variable. all help appreciated.

   current script;

$computername=read-host'What computername do you need?'

try

{

get-adcomputer

 

 

"$computername"-propertiesipv4address

}

catch

{

write-warning

 

 

"Computer not found / IP not found"

}

 


Viewing all articles
Browse latest Browse all 10624

Trending Articles