proxb / poshpaig Goto Github PK
View Code? Open in Web Editor NEWPowerShell UI used for auditing and installing updates from WSUS to local and remote systems
License: MIT License
PowerShell UI used for auditing and installing updates from WSUS to local and remote systems
License: MIT License
When you run the Services Check, the report that's created is appended to the the bottom of any previous checks that have been run, so as there's no date/time stamp it's not clear which lines are from which run.
Clearing down the log before the new check is run would be ideal, or an option under Action > Reports > Clear Services Check Report would be a work around.
I have many failover cluster instances that should not be displayed during the LDAP search because they are not real servers and I only want to update real servers. ;)
In AD, these objects are created with the description "Failover cluster virtual network name account".
I have changed "$uiHash.LoadADButton.Add_Click" to hide these objects.
#LoadADButton Events
$uiHash.LoadADButton.Add_Click({
$domain = Open-DomainDialog
$uiHash.StatusTextBox.Foreground = "Black"
$uiHash.StatusTextBox.Text = "Querying Active Directory for Computers..."
$Searcher = [adsisearcher]""
$Searcher.SearchRoot= [adsi]"LDAP://$domain"
$Searcher.Filter = ("(&(objectCategory=computer)(OperatingSystem=server))")
$Searcher.PropertiesToLoad.Add('name') | Out-Null
$Searcher.PropertiesToLoad.Add('description') | Out-Null
Write-Verbose "Checking for exempt list"
If (Test-Path Exempt.txt) {
Write-Verbose "Collecting systems from exempt list"
[string[]]$exempt = Get-Content Exempt.txt
}
$Results = $Searcher.FindAll()
foreach ($result in $Results) {
IF ($result.Properties.Item('description') -eq 'Failover cluster virtual network name account'){
continue
}
[string]$computer = $result.Properties.name
If ($Exempt -notcontains $computer -AND -NOT $ComputerCache.contains($Computer)) {
[void]$ComputerCache.Add($Computer)
$clientObservable.Add((
New-Object PSObject -Property @{
Computer = $computer
Audited = 0 -as [int]
Installed = 0 -as [int]
InstallErrors = 0 -as [int]
Services = 0 -as [int]
Notes = $Null
}
))
} Else {
Write-Verbose "Excluding $computer"
}
}
$uiHash.ProgressBar.Maximum = $uiHash.Listview.ItemsSource.count
$Global:clients = $clientObservable | Select -Expand Computer
Show-DebugState
})
PoshPAIG randomly started giving inaccurate audit results.
It will detect that there are, for example, 5 updates and it installs those updates just fine but says only 1 has installed.
After reboot it says there are no more updates but I will go on the machine and there will be installed but pending reboot.
Hello,
I really like this project and would like to use it for some servers I am responsible for. The servers I am working on are disconnected, with no Internet or WSUS in play. Is there anyway I could use this program to point to a CIFS share for instance containing the updates to be installed on the servers in my environment? Do this from a central location with the reporting features would make this awesome for me instead of just using some basic scripts.
Thank you
Issue:
I believe there is a problem installing Windows Updates with POSHPAIG when update(s) are "Exclusive". This means MS has flagged the update so it must be installed separately from other updates (Including other "Exclusive" updates). I believe "InstallationBehavior" and/or "InstallationImpact" can be used from a logic perspective, but I currently don't have the skills to correct the code at present. Reviewing the POSHPAIG code I am not seeing anything to indicate it takes this into account (Get-PendingUpdates.ps1 or Install-Patches.ps1). Hope this information is helpful and will follow-up if I/we can figure it out.
Situation:
I noticed an issue with the software where a "Patch Audit" (GUI) would report an update needed but multiple attempts to "Install Updates" would report success but never install it. Would have to then manually connect to the problem OS and manually install it. This is prevalent but not limited to the Monthly Rollup updates. The current trend is, if the update is "Exclusive" then its a problem. If it isn't then POSHPAIG installs fine without issue.
Resources:
InstallationBehavior:
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/aa354303(v=vs.85)
InstallationImpact:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wsusar/b4630c5e-a336-40e1-a338-88739a8f2e2a
Solarwainds discussion about "Exclusive" updates:
https://thwack.solarwinds.com/product-forums/patch-manager/f/forum/40679/what-is-an-exclusive-update
MS Update error result if exclusive:
0x80240019 WU_E_EXCLUSIVE_INSTALL_CONFLICT An exclusive update cannot be installed with other updates at the same time.
https://docs.microsoft.com/en-us/windows/deployment/update/windows-update-error-reference
Ausnahme beim Festlegen von "RunspacePool": "Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt."
In D:\PoshPAIG_2_1_5\PoshPAIG_2_1_5\Start-PoshPAIG.ps1:457 Zeichen:17
$powershell.RunspacePool = $runspaceHash.runspacepool
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the Install Patches function is not working.
When selected, it returns back a "Completed/Successful" msg immediately. But no patches are applied.
Also, no errors are given.
Sometimes the options will not work or save properly. Need to either lose the XML file and save to registry or fix the issue with the XML file.
When I attempt to update and save options I get the following error
Cannot index into a null array.
At C:\ps_scripts\PoshPAIG_2_1_5\Options.ps1:82 char:9
$Optionshash['MaxRebootJobs'] = $MaxRebootJobs_txtbx.Text
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidOperation: (:) [], RuntimeException
FullyQualifiedErrorId : NullArray
It has the same error for the following lines also
At C:\ps_scripts\PoshPAIG_2_1_5\Options.ps1:89 char:9
$Optionshash['MaxJobs'] = $MaxJobs_txtBx.TextAt C:\ps_scripts\PoshPAIG_2_1_5\Options.ps1:96 char:9
$Optionshash['ReportPath'] = $ReportPath_txtbx.TextAt C:\ps_scripts\PoshPAIG_2_1_5\Start-PoshPAIG.ps1:66 char:9
$Global:maxConcurrentJobs = $Optionshash['MaxJobs']At C:\ps_scripts\PoshPAIG_2_1_5\Start-PoshPAIG.ps1:67 char:9
$Global:MaxRebootJobs = $Optionshash['MaxRebootJobs']At C:\ps_scripts\PoshPAIG_2_1_5\Start-PoshPAIG.ps1:68 char:13
If ($Optionshash['ReportPath']) {
Attempting to open the Options menu again brings up the following
At C:\ps_scripts\PoshPAIG_2_1_5\Options.ps1:66 char:5
$MaxRebootJobs_txtbx.Text = $Optionshash['MaxRebootJobs']At C:\ps_scripts\PoshPAIG_2_1_5\Options.ps1:67 char:5
$MaxJobs_txtBx.Text = $Optionshash['MaxJobs']At C:\ps_scripts\PoshPAIG_2_1_5\Options.ps1:68 char:5
$ReportPath_txtbx.Text = $Optionshash['ReportPath']
and the options.xml shows as
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Nil />
</Objs>
When selecting 'Computer List Report' and running 'Generate Report', no output is generated and the status bar at the bottom just says 'Report Saved To '
I have noticed that when updating with PoshPAIG the 'Updates were installed' that you can see in "wuapp" in remote servers doesn't update.
this date is stored in LastSuccessTime under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install
May I suggest you to add these three lines in installPatches function?
$updateregistry='reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install" /t REG_SZ /v LastSuccessTime /d "{0:yyyy-MM-dd HH:mm:ss}" /f' -f (get-date)
out-file ".\registrywindowsupdate.bat" -input $updateregistry -enc ascii
.\psexec.exe -accepteula -s -i \$Computername -c "$pwd\registrywindowsupdate.bat"
Hi! Is there any way that I could set this with individual/different credentials? We have a bunch of servers that don't follow AD logic for several reasons, and it would be great if I could just handle them this way. But I'd need to be able to save the credentials...Would this be possible?
When creating a Host List report, the file is created but contains no data even though the list view shows the data.
Giving this tool a trial run on some servers I received error: 0x80072EE2
.
Running get-item 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate'
on the affected servers I found the WUServer
and WUStatusServer
were pointing to the wrong machine.
It would be good to add functionality to Get/Set this value for selected servers.
First of all: Thanks for the great script, just started using it and i already love it!
After Installing the Server 2016 SSU using PoshPAIG the following CU was not Downloaded instantly.
I had to reboot the System in order to get the Servers to download the following update wich was the CU. When viewing the Windows Update Interface on the machine it still showed the SSU to install but when chekcing the eventlog i get the event telling me that the update was installed successfully.
Is it possible to get an USOclient StartScan and StartDownload button?
This would probably prevent me from needing to restart the server more than actually required...
Hi,
We are using this script to patch our servers, but we found the issues when setting concurrent sessions as "2000" and running the script to install, script is showing patches installed and status as completed.
But when we check on random destination servers, the patches are not installed.
when we try to capture the installed patches report, it's failed, the csv files generated doesn't contains patch installation status.
Can you please help....
Hi, I downloaded PoshPAIG and copied psExec.exe in the folder. When I try to lauch audit patch with domain admins right i receive the following erro: "error with audit".
Hi,
I found this very useful tool few days ago. I tested it and it seem something is not working properly... but I don't know if this issue is caused by incompatibility, setting, etc.
1- I'm using a Windows 10 (1809) LTSC computer with PowerShell 5.1
2- I added 4 servers to the computer list (Yes, the PS tool is running, opening fine)
3- I launch the option "Audit Patches" and the tool is working fine to retrieve the information. I told me the number of missing patch waiting to be installed !
4- I launch the option "Install Patches"... and it's where nothing happen... just nothing on the targets servers. I'm waiting many minutes and nothing happen :(
The targets servers are using Windows Server 2012 R2 with PowerShell 5.1 also.
Does we need to set somethig to "authorize the installation of updates... like PS Remoting... not sure because I'm able to grab (audit) the amount for missing patches ?
I was searching for a "better guide" than the webpage instructions, but I didn't found..
When attempting to add a computer/server nothing happens. An error doesn't occur and there aren't any informational popups or anything appearing as an error in the Powershell console. I am running as administrator.
Hello -
1st I love this tool, and use it often.
When I am running a process [say 'Audit Patches'], I would like to run it as a job - which would allow me to run something else [say 'Check Pending Reboot' ] - in the tool description Boe mention that he tool out the PSJobs layer -
Looking at putting a job feature at the UI layer.
Would love to assist with this where i can -
Thanks,
Peter
Certain services (i.e. .NET) start and stop at will, and some only start when a user logs in (i.e Hardware Detection). These show up in the non-running services report, but they can be excluded by amending the WMI query to include AND Exitcode !=0
.
Amended WMI query is
Query = "Select __Server,Name,DisplayName,State,StartMode,ExitCode,Status FROM Win32_Service WHERE StartMode='Auto' AND State!='Running' AND Exitcode !=0"
Example :
Portuguese (Brazil) Language Pack - Windows 7 Service Pack 1 for x64-based Systems
Orig code:
$temp.Title = ($update.Title -split('('))[0]
$temp.KB = (($update.title -split('('))[1] -split(')'))[0]
This fixes it (note the change in order; have to extract the KB string to filter it from the title):
$temp.KB = $update.title.Split('(')[-1].Trim().Replace("KB","").Replace(")", "")
$temp.Title = ($update.Title.Replace("(KB"+$temp.KB+")", ""))
For semantics purposes, I also remove the "KB" from the kb# string, as it's already in a column titled that.
Im not able to Audit any servers i add in, Get below error on everyone
servername ERROR ERROR ERROR Exception calling "CreateInstance" with "1" argument(s): "Creating an instance of the COM component with CLSID {4CB43D7F-7EEE-4906-8698-60DA1C38F2FE} from the IClassFactory failed due to the following error: 800706ba The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)."
Another output from a server i trying to run Audit on
WARNING: Exception calling "CreateInstance" with "1" argument(s): "Retrieving the COM class factory for remote component with CLSID
{4CB43D7F-7EEE-4906-8698-60DA1C38F2FE} from machine servername failed due to the following error: 800706ba servername."
Running the PAIG on a Windows 2016, trying to Audit mixed targets, Win2012 R2, Win 2008 R2, Win2016 and its same error on all
Hi,
When i try to install patches i am getting this error
WARNING: Exception calling "Search" with "1" argument(s): "Exception from HRESULT: 0x80072EE6"
Hi Guys,
Any way to have this remove the .vbs file form the C:\ on the target machine?
Shaun
Would it be possible that once the updates have installed it automatically checks to see if a reboot is required?
Currently from ive seen it installs updates and says completed but in actual fact they aren't really completed unless the reboot is performed. and for that to be seen you have to run another check.
It would be handy that if updates are installed it then checks for reboot, if not reboot needed it marks as completed if reboot is needed it marks as pending reboot?
Server 2019
Running the latest scripts with the Fixes with Administrator equivalence.
csv and vbs is created on the on the root of C:.
csv had the patch needed and WSUS has the patch.
I do notice though in the csv lists my server, the title, the KB, then instead in the column where Download and notes it shows a comma with a negative sign and a number instead of NA NA like my other non Server 2019 systems.
Getting "Unable to determine Result Code"
What am I doing wrong?
Is it a Server 2019 issue?
Thank you.
Hello guys, I know this is an old post but has anyone found the solution to the problem? cause I'm facing the same issue.
Thanks
Originally posted by @pompy1107 in #13 (comment)
Hi,
When I attempt to audit patches on PC running Windows10 1703 I got following error message:
WARNING: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I'm running PoshPAIG script as domain admin. I tried to audit patches on workstations with UAC enabled and with UAC disabled - both gives same error result. When I attempted to audit patches by running PoshPAIG directly on workstation with Windows10 1703, error message was different: "WARNING: Exception from HRESULT: 0x80244022"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.