Classwork 5 Objects
Classwork 5 Objects
Classwork 5 Objects
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 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