Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .Synopsis
- Update 3rd party software on Network computers
- .Description
- This script deploy's MSI & MSP Updates to computers in a list pulled from AD. Any systems that are offline at the time will be placed in $Skipped.
- .Notes
- NAME: Deploy3rdPartyUpdates.ps1
- AUTHOR: Hugh Smalley
- #>
- <#Needed for AD access. You need to have the Quest AD Powershell tools installed.#>
- Add-PSSnapin Quest.ActiveRoles.ADManagement
- <# You will get the following error if you run this script more than once in the same session:
- "Add-PSSnapin : Cannot add Windows PowerShell snap-in Quest.ActiveRoles.ADManagement because it is already ad
- ded. Verify the name of the snap-in and try again."
- #>
- #Pull Computers from AD
- $Computers = Get-QADComputer -searchroot 'ins-lua.com/Workstations/Deployment'
- <#Get Domain Admin Credential#>
- $Cred = Get-Credential
- <#Updates - List updates here. These will need to be setup in the deployments below. #>
- <#At this time Updates can only be deployed from a file share that accepts null sessions. aka shares that allow connections without user/pass#>
- $FlashAX = "\\Sever\Share\install_flash_player_10_active_x.msi"
- $JavaUpdate = "\\Server\Share\Oracle Java x86\jre1.6.0_24.msi"
- #List of Systems Skipped
- $Skipped = @()
- <# Deploy Updates To Systems.
- Notes:
- TODO: Remove Updater Startup Entries
- #>
- foreach($Computer in $Computers)
- {
- $ObjComputerName = New-Object PSObject
- $ObjComputerName = $computer.name
- $System = $ObjComputerName
- <# If the computer is not responding, record that we skipped it and continue. We can review this collection after the script completes. #>
- if(-not (Test-Connection -Quiet $System -Count 1))
- {
- $Skipped += $System
- }
- # Do Updates
- (Get-WMIObject -Class Win32_Product -ComputerName $System -List -Credential $Cred).Install($FlashUpdateAX,$null,$true)
- (Get-WMIObject -Class Win32_Product -ComputerName $System -List -Credential $Cred).Install($JavaUpdate,$null,$true)
- # (Get-WMIObject -Class Win32_Process -ComputerName $System -List -Credential $Cred).Create("cmd.exe /c filehere.exe /switches")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement