We help IT Professionals succeed at work.

Powershell query

leadtheway
leadtheway asked
on
113 Views
1 Endorsement
Last Modified: 2017-03-23
Trying to run a script that will query a txt file before running the query and action against each.  I have one that does if i manually put the server name but i would like to just do a text file due to the amount of machines.

$ComputerName = @('server2012', 'vista64esxi', 'server2008')
foreach ($Computer in $ComputerName) {
    if ($Status = Get-Service -ComputerName $Computer -Name RemoteRegistry -EA SilentlyContinue |

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2014
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION