Sunteți pe pagina 1din 2

In these exercises do not run the commands to see if they work.

Your task is to figure


out if you think they would work or not. You may read the help files for any of these
commands to learn more about their parameters. You may run underlined commands and
pipe their output to Get-Member, if needed.
For your information, Get-ADComputer filter will retrieve all computer objects form the
domain. These objects have a Name property, which contains the computers names. You
do not need to run Get-ADComputer, nor do you need to read the help for Get-ADComputer.
You now know everything you need to know about that command.
Some exercises refer to Computers.txt. You can assume that this text file contains one
computer name per line, with no header row.
Some exercises refer to Computers.csv. You can assume that this CSV file contains one
computer name per line, and has a header row containing ComputerName as its only
column.

1. Will the following command work to display a list of services running on all
computers in the domain? Why or why not?
Get-ADComputer Filter * | Get-Service Name *
Yes it will list the list of services running

2. Will the following command work to display a list of services running on all
computers in the domain? Why or why not?
Get-ADComputer Filter * |
Select-Object Properties @{n='ComputerName';e={$_.Name}} |
Get-Service Name *

No it shoes more than required like properties etc .


3. Will the following command work to display the indicated WMI class from
all computers in the domain? Why or why not?
Get-ADComputer Filter * |
Select*Object Properties @{n='ComputerName';e={$_.Name}} |
Get-WmiObject Class Win32_BIOS

No it will show error because the command is not correct error (select*object)
4. Will the following command work to display the indicated WMI class from
all computers in Computers.txt? Why or why not?
Get-WmiObject Class Win32_BIOS ComputerName (Get-Content
Computers.txt)
No we are not getting all computers only the computer of class win32Bios

5. Will the following command work to display a list of all processes from all
computers in the domain? Why or why not?
Get-Process Name * -ComputerName (Get-ADComputer Filter
* |
Select-Object Expand Name)
Yes it will show all processes because nothing is passed with the asterick which means
everthing

6. Will the following command work to display a list of all Security event log
entries from all computers in Computers.csv? Why or why not?
Import-CSV Computers.CSV | Get-EventLog LogName Security
yes, it will import every computer name but with log name security

S-ar putea să vă placă și