Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Load the AD Module
- import-module activedirectory
- # Generate a list of computer names
- $computerlist=get-adcomputer -filter * | select name
- # Loop through each computer and get the registry key
- # Assembling the query was done to allow for easier management of the quotation marks
- # Invoke-expression was used to allow parsing of the quote marks
- foreach ($computername in $computerlist)
- {
- $computername.name
- $query1="reg query ""\\"
- $query2=$computername.name
- $query3="\HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer"""
- $query4=" /v svcVersion"
- $regquery=$query1+$query2+$query3+$query4
- $computer.name
- invoke-expression $regquery
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement