Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $output_location = "C:\Users\Administrator\Desktop\Output2.txt"
  2.  
  3. $query = "SELECT ProcessId, Name FROM Win32_Process"
  4. $process = [wmisearcher]$query
  5. $time = Measure-Command {$process.Get() > $output_location}
  6. $time >> $output_location
  7.  
  8. $query = "SELECT * FROM Win32_Process"
  9. $process = [wmisearcher]$query
  10. $processes = $process.Get()
  11. foreach ($p in $processes.name) {
  12. $time = Measure-Command {(Get-WmiObject -Class win32_process |Where-Object {$_.name -eq 'powershell.exe'}).getowner().user } >> $output_location }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement