Advertisement
anonit

Get IE verson of remote machine

Aug 6th, 2015
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Load the AD Module
  2. import-module activedirectory
  3.  
  4. # Generate a list of computer names
  5. $computerlist=get-adcomputer -filter * | select name
  6.  
  7. # Loop through each computer and get the registry key
  8. # Assembling the query was done to allow for easier management of the quotation marks
  9. # Invoke-expression was used to allow parsing of the quote marks
  10.  
  11. foreach ($computername in $computerlist)
  12. {
  13.     $computername.name
  14.     $query1="reg query ""\\"
  15.     $query2=$computername.name
  16.     $query3="\HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer"""
  17.     $query4=" /v svcVersion"
  18.     $regquery=$query1+$query2+$query3+$query4
  19.     $computer.name
  20.     invoke-expression $regquery
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement