Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

String Question

$
0
0

Is it possible to list multiple system under a -identity parameter on one line, without using a txt file? I am trying to write a script with a set number of computer the will be check everytime the script is ran. So there will be no external file. Below is the script, but I just cant figure out the multiple system part

$Option = Read-Host 'which network loaners would you like to check? (skyzone or homezone)'

if ($Option -eq "skyzone") { ForEach-Object {Get-ADComputer -Identity {sys1,sys2,sys3} -Properties Name,Description,LastLogonDate | Select-Object Name,Description,LastLogonDate} }

Else{"Exiting Program do come again"}


Viewing all articles
Browse latest Browse all 6937

Trending Articles