After the GPO installer checks whether the installation was successful

Source: Internet
Author: User
Tags tightvnc

Recently, several programs have been installed with GPOs, how to determine whether the installation is successful?


There's a simple script, like I'm judging if TightVNC is installed on all Win7 systems.


$a =get-adcomputer -filter{operatingsystem -like  "*7*"} -properties operatingsystem  | select name, operatingsystemforeach ($b  in  $a) {if (test-connection - computername  $b. Name -count 1 -quiet) {$b. nameinvoke-command -computername $ b.name {if  ([system.intptr]::size -eq 4)  {  "32-bit" get-itemproperty hklm:\ software\microsoft\windows\currentversion\uninstall\* | where-object{$_.displayname -eq  " TightVNC "} | select-object displayname, displayversion, publisher, installdate    } else {  "64-bit"  get-itemproperty hklm:\software\microsoft\windows \currentversion\uninstall\*,hklm:\software\wow6432node\microsoft\windows\currentversion\uninstall\* |   Where-Object{$_.displayname -eq  "TightVNC"} | select-object displayname,  displayversion, publisher, installdate }}}} 


Note the point:

Do not use WMI when querying installed programs; If I use Get-wmiobject-class win32_product, I can get the same information, but at a speed dozens of times times slower than the registry query;


When querying the registry, differentiate between 32-bit and 64-bit systems, because we can install 32-bit programs on 64-bit systems


This article is from the "Mapo Tofu" blog, please be sure to keep this source http://beanxyz.blog.51cto.com/5570417/1677123

After the GPO installer checks whether the installation was successful

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.