Set-PSWUSettings
Set
PSWUSettings
Save PSWUSettings.
Use Set-PSWUSettings save PSWindowsUpdate module settings to XML file.
Set-PSWUSettings
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Properties
Alternative report message propertie.s
string
System.String
SaveAsSystem
Invoke-WUJob to save credential as system user
string
System.String
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SmtpCredential
Save smtp credential to Credential Manager.
PSCredential
System.Management.Automation.PSCredential
SmtpEnableSsl
Save enable ssl to PSWUSettings file.
bool
System.Boolean
False
SmtpFrom
Save smtp sernder to PSWUSettings file.
string
System.String
SmtpPort
Save smtp port to PSWUSettings file.
int
System.Int32
25
SmtpServer
Save smtp server to PSWUSettings file.
string
System.String
SmtpSubject
Save alternative message subject to PSWUSettings file.
string
System.String
SmtpTo
Save smtp recipient to PSWUSettings file.
string
System.String
Style
Alternative report message format style.
string
System.String
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SmtpServer
Save smtp server to PSWUSettings file.
string
System.String
SmtpPort
Save smtp port to PSWUSettings file.
int
System.Int32
25
SmtpEnableSsl
Save enable ssl to PSWUSettings file.
bool
System.Boolean
False
SmtpCredential
Save smtp credential to Credential Manager.
PSCredential
System.Management.Automation.PSCredential
SmtpTo
Save smtp recipient to PSWUSettings file.
string
System.String
SmtpFrom
Save smtp sernder to PSWUSettings file.
string
System.String
SmtpSubject
Save alternative message subject to PSWUSettings file.
string
System.String
Properties
Alternative report message propertie.s
string
System.String
Style
Alternative report message format style.
string
System.String
SaveAsSystem
Invoke-WUJob to save credential as system user
string
System.String
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
---------- EXAMPLE 1 ----------
Set Office 365 as smtp server for PSWindowsUpdate module.
Set-PSWUSettings -SmtpServer smtp.office365.com -SmtpPort 587 -SmtpEnableSsl $true -SmtpSubject "PSWindowsUpdate Report" -SmtpTo mgajda@psmvp.pl -SmtpFrom mgajda@psmvp.pl -SmtpCredential (Get-Credential mgajda@psmvp.pl)
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WindowsUpdate
Get
WindowsUpdate
Get list of available updates meeting the criteria.
Use Get-WindowsUpdate (aka Get-WUList) cmdlet to get list of available or installed updates meeting specific criteria.
Use Download-WindowsUpdate alias to get list of updates and download it. Equivalent Get-WindowsUpdate -Download.
Use Install-WindowsUpdate (aka Get-WUInstall) alias to get list of updates and install it. Equivalent Get-WindowsUpdate -Install.
Use Hide-WindowsUpdate alias to get list of updates and hide it. Equivalent Get-WindowsUpdate -Hide.
Use Show-WindowsUpdate (aka UnHide-WindowsUpdate) alias to get list of updates and unhide it. Equivalent Get-WindowsUpdate -Hide:$false.
There are two types of filtering update: Pre search criteria, Post search criteria.
- Pre search works on server side, like example: (IsInstalled = 0 and IsHidden = 0 and CategoryIds contains '0fa1201d-4330-4fa8-8ae9-b877473b6441' )
- Post search work on client side after get the pre-filtered list of updates, like example $KBArticleID -match $Update.KBArticleIDs
Status info list:\r\n[A|R]DIMHUB\r\nA-IsAccetped\r\nR-IsRejected\r\n D-IsDownloaded\r\n F-DownloadFailed\r\n ?-IsInvoked\r\n I-IsInstalled\r\n F-InstallFailed\r\n ?-IsInvoked\r\n R-RebootRequired\r\n M-IsMandatory\r\n H-IsHidden\r\n U-IsUninstallable\r\n B-IsBeta
Get-WindowsUpdate
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
RootCategories
Post search criteria. Finds updates that contain a specified root category name 'Critical Updates', 'Definition Updates', 'Drivers', 'Feature Packs', 'Security Updates', 'Service Packs', 'Tools', 'Update Rollups', 'Updates', 'Upgrades', 'Microsoft'.
string[]
System.String[]
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ServiceID
Use specific Service Manager if it's available.
Examples Of ServiceID: \r\n \r\n -- Windows Update 9482f4b4-e343-43b6-b170-9a65bc822c77 \r\n -- Microsoft Update 7971f918-a847-4430-9279-4a52d1efe18d \r\n -- Windows Store 117cab2d-82b1-4b5a-a08c-4d62dbee7782 \r\n -- Windows Server Update Service 3da21691-e39d-4da6-8a4b-b43877bcb1b7
string
System.String
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Get-WindowsUpdate
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
RootCategories
Post search criteria. Finds updates that contain a specified root category name 'Critical Updates', 'Definition Updates', 'Drivers', 'Feature Packs', 'Security Updates', 'Service Packs', 'Tools', 'Update Rollups', 'Updates', 'Upgrades', 'Microsoft'.
string[]
System.String[]
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
WindowsUpdate
Use Microsoft Update Service Manager - '7971f918-a847-4430-9279-4a52d1efe18d'
SwitchParameter
System.Management.Automation.SwitchParameter
False
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Get-WindowsUpdate
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MicrosoftUpdate
Use Windows Update Service Manager - '9482f4b4-e343-43b6-b170-9a65bc822c77'
SwitchParameter
System.Management.Automation.SwitchParameter
False
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
RootCategories
Post search criteria. Finds updates that contain a specified root category name 'Critical Updates', 'Definition Updates', 'Drivers', 'Feature Packs', 'Security Updates', 'Service Packs', 'Tools', 'Update Rollups', 'Updates', 'Upgrades', 'Microsoft'.
string[]
System.String[]
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
ServiceID
Use specific Service Manager if it's available.
Examples Of ServiceID: \r\n \r\n -- Windows Update 9482f4b4-e343-43b6-b170-9a65bc822c77 \r\n -- Microsoft Update 7971f918-a847-4430-9279-4a52d1efe18d \r\n -- Windows Store 117cab2d-82b1-4b5a-a08c-4d62dbee7782 \r\n -- Windows Server Update Service 3da21691-e39d-4da6-8a4b-b43877bcb1b7
string
System.String
WindowsUpdate
Use Microsoft Update Service Manager - '7971f918-a847-4430-9279-4a52d1efe18d'
SwitchParameter
System.Management.Automation.SwitchParameter
False
MicrosoftUpdate
Use Windows Update Service Manager - '9482f4b4-e343-43b6-b170-9a65bc822c77'
SwitchParameter
System.Management.Automation.SwitchParameter
False
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
RootCategories
Post search criteria. Finds updates that contain a specified root category name 'Critical Updates', 'Definition Updates', 'Drivers', 'Feature Packs', 'Security Updates', 'Service Packs', 'Tools', 'Update Rollups', 'Updates', 'Upgrades', 'Microsoft'.
string[]
System.String[]
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
This is an alias of the IgnoreUserInput parameter.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
PSWindowsUpdate.WindowsUpdate
OutputType for WindowsUpdate objects.
---------- EXAMPLE 1 ----------
Get windows updates available from default service manager.
Get-WindowsUpdate -Verbose
VERBOSE: MG-PC: Connecting to Windows Server Update Service server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[4] Updates in post search criteria
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ------- KB890830 44MB Narzędzie Windows do usuwania złośliwego oprogramowania dla systemów Window...
MG-PC ------- KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
MG-PC ------- KB4034662 21MB 2017-08 Aktualizacja zabezpieczeń Adobe Flash Player w Windows 10 Version 1...
MG-PC ------- KB4035631 11MB 2017-08 Aktualizacja Windows 10 Version 1607 dla systemów opartych na archi...
---------- EXAMPLE 2 ----------
Get all installed drivers that are available at Windows Update. Additionaly show pre search criteria.
Get-WindowsUpdate -WindowsUpdate -UpdateType Driver -IsInstalled -ShowPreSearchCriteria -Verbose
PreSearchCriteria: IsInstalled = 0 and Type = 'Driver' and IsHidden = 0
VERBOSE: MG-PC: Connecting to Windows Update server.Please wait...
VERBOSE: Found[1] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MGAJDALAP3 -DI---- 3MB Intel - Other hardware - Intel(R) Watchdog Timer Driver (Intel(R) WDT)
---------- EXAMPLE 3 ----------
Get all available update on remote machine MG-PC, that contains in Title this two words 'Aktualizacja' and 'Windows 10' (as regular expression).
Get-WindowsUpdate -ComputerName MG-PC -MicrosoftUpdate -Title "Aktualizacja.*Windows 10" -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[14] Updates in pre search criteria
VERBOSE: Found[5] Updates in post search criteria
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ------- KB3150513 2MB 2017-06 Aktualizacja Windows 10 Version 1607 dla systemów opartych na archi...
MG-PC ------- KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
MG-PC ------- KB4034662 21MB 2017-08 Aktualizacja zabezpieczeń Adobe Flash Player w Windows 10 Version 1...
MG-PC ------- KB4035631 11MB 2017-08 Aktualizacja Windows 10 Version 1607 dla systemów opartych na archi...
MG-PC ------- KB4033637 4MB Aktualizacja systemu Windows 10 Version 1607 dla komputerów z procesorami x...
---------- EXAMPLE 4 ----------
Hide update with KBArticleID: KB4034658.
Get-WindowsUpdate -KBArticleID KB4034658 -Hide -Verbose
or use alias
Hide-WindowsUpdate -KBArticleID KB4034658 -Verbose
VERBOSE: MG-PC: Connecting to Windows Server Update Service server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
Confirm
Are you sure you want to perform this action?
Performing the operation "Hide 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla systemów opartych na architekturze x64 (KB4034658)[1GB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ---H-- KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
---------- EXAMPLE 5 ----------
Unhide update with KBArticleID: KB4034658.
Get-WindowsUpdate -KBArticleID KB4034658 -WithHidden -Hide:$false -Verbose
or use alias
Show-WindowsUpdate -KBArticleID KB4034658 -Verbose
VERBOSE: MG-PC: Connecting to Windows Server Update Service server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
Confirm
Are you sure you want to perform this action?
Performing the operation "Show 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla systemów opartych na architekturze x64 (KB4034658)[1GB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ------ KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
---------- EXAMPLE 6 ----------
Schedule job at 6:00 PM to install update with UpdateId='ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber=200. Update will be automaticaly accepted and after all serwer will be automaticaly restarted if needed.
Get-WindowsUpdate -MicrosoftUpdate -UpdateID ddb74579-7a1f-4d1f-80c8-e8647055314e -RevisionNumber 200 -ScheduleJob (Get-Date -Hour 18 -Minute 0 -Second 0) -Install -AcceptAll -AutoReboot -Verbose
or use alias
Install-WindowsUpdate -MicrosoftUpdate -UpdateID ddb74579-7a1f-4d1f-80c8-e8647055314e -RevisionNumber 200 -ScheduleJob (Get-Date -Hour 18 -Minute 0 -Second 0) -AcceptAll -AutoReboot -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[1] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
VERBOSE: Choosed pre Search Criteria: (UpdateID = 'ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber = 200)
X ComputerName Result KB Size Title
- ------------ ------ -- ---- -----
1 MG-PC Accepted KB4023307 13MB Microsoft Silverlight(KB4023307)
VERBOSE: Accepted[1] Updates ready to Download
VERBOSE: Invoke-WUJob: MG-PC(31.08.2017 18:00:00):
VERBOSE: powershell.exe -Command "Get-WindowsUpdate -Criteria \"(UpdateID = 'ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber = 200)\" -AcceptAll -AutoReboot -Download -Install -MicrosoftUpdate -Verbose *>&1 | Out-File $Env:TEMP\PSWindowsUpdate.log"
---------- EXAMPLE 7 ----------
Install updates on remote computer. After all send a report from the installation process.
Install-WindowsUpdate -ComputerName MG-PC -MicrosoftUpdate -AcceptAll -AutoReboot -SendReport -PSWUSettings @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";Port=25} -Verbose
or use global PSWUSettings
@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";Port=25} | Export-Clixml -Path 'C:\Program Files\WindowsPowerShell\Modules\PSWindowsUpdate\PSWUSettings.xml'
Install-WindowsUpdate -ComputerName MG-PC -MicrosoftUpdate -AcceptAll -AutoReboot -SendReport -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[4] Updates in post search criteria
Confirm
Are you sure you want to perform this action?
Performing the operation "Microsoft Silverlight (KB4023307)[13MB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "2017-06 Aktualizacja Windows 10 Version 1607 dla systemów opartych na architekturze x64 (KB3150513)[2MB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "Aktualizacja pakietu językowego usługi Microsoft Dynamics 365 2.1[47MB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): L
X ComputerName Result KB Size Title
- ------------ ------ -- ---- -----
1 MG-PC Accepted KB4023307 13MB Microsoft Silverlight (KB4023307)
1 MG-PC Accepted KB3150513 2MB 2017-06 Aktualizacja Windows 10 Version 1607 dla systemów opartych na arc...
1 MG-PC Rejected KB4013759 47MB Aktualizacja pakietu językowego usługi Microsoft Dynamics 365 2.1
1 MG-PC Rejected KB3186568 67MB Program Microsoft .NET Framework 4.7 w syst. Windows 10 Version 1607 i Wi...
VERBOSE: Accepted [2]
Updates ready to Download
VERBOSE: Invoke-WUJob: MG-PC (Now):
VERBOSE: powershell.exe -Command "Get-WindowsUpdate -Criteria \"(UpdateID = 'ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber = 200) or (UpdateID = '151c4402-513c-4f39-8da1-f84d0956b5e3' and RevisionNumber = 200)\" -AcceptAll -Download -Install -AutoReboot -MicrosoftUpdate -SendReport -ProofOfLife -Verbose *>&1 | Out-File $Env:TEMP\PSWindowsUpdate.log"
---------- EXAMPLE 8 ----------
Schedule Job to install all available updates and automatically reboot system if needed. Also send report after installation (but before reboot if needed) and send second instalation history report after reboot.
Set-PSWUSettings -SmtpServer smtp.office365.com -SmtpPort 587 -SmtpEnableSsl $true -SmtpSubject "PSWindowsUpdate Report" -SmtpTo mgajda@psmvp.pl -SmtpFrom mgajda@psmvp.pl -SmtpCredential (Get-Credential mgajda@psmvp.pl)
Install-WindowsUpdate -MicrosoftUpdate -SendReport -SendHistory -AcceptAll -AutoReboot -ScheduleJob (Get-Date -Hour 18 -Minute 30 -Second 0) -ComputerName MG-PC -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[4] Updates in post search criteria
X ComputerName Result KB Size Title
- ------------ ------ -- ---- -----
1 MG-PC Accepted KB3038936 5MB Aktualizacja systemu Windows 8.1 dla komputerów z procesorami x64(KB3038...
1 MG-PC Accepted KB3186606 4MB Pakiety językowe programu Microsoft.NET Framework 4.7 w syst. Windows 8....
1 MG-PC Accepted KB4035038 53MB Sierpień 2017: wersja zapozn. pak.zb.aktual.jakości dla pr. .NET Frame...
1 MG-PC Accepted KB2267602 309MB Aktualizacja definicji dla: Windows Defender — KB2267602 (Definicja 1.251...
VERBOSE: Accepted[4] Updates ready to Download
VERBOSE: Invoke-WUJob: MG-PC (02.09.2017 08:30:00):
VERBOSE: powershell.exe -Command "Get-WindowsUpdate -Criteria \"(UpdateID = 'e69c9679-7ce8-489a-a21c-62fb920be67a' and RevisionNumber = 201) or(UpdateID = 'de44604d-ec38-4a7f-ac63-28b3edfdb382' and RevisionNumber = 207) or(UpdateID = '9cf1d8c9-a7c3-4603-90e8-f22131ff6d7e' and RevisionNumber = 201) or(UpdateID = 'b51935f9-0e40-4624-9c26-b29bff92dcf9' and RevisionNumber = 200)\" -AcceptAll -Install -AutoReboot -MicrosoftUpdate -SendReport -SendHistory -Verbose *>&1 | Out-File $Env:TEMP\PSWindowsUpdate.log"
VERBOSE: Send report
Author Blog
https://commandlinegeeks.wordpress.com/
Remove-WindowsUpdate
Remove
WindowsUpdate
Uninstall update.
Use Remove-WindowsUpdate to uninstall update.
Remove-WindowsUpdate
KBArticleID
KBArticleID that will be uninstalled.
string
System.String
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleJob
Specify schedule time job.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
WUSAMode
Wse wusa.exe instead of WU Api.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Remove-WindowsUpdate
UpdateID
Update ID that will be uninstalled.
string
System.String
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleJob
Specify schedule time job.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
WUSAMode
Wse wusa.exe instead of WU Api.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
ScheduleJob
Specify schedule time job.
DateTime
System.DateTime
01.01.0001 00:00:00
KBArticleID
KBArticleID that will be uninstalled.
string
System.String
HotFixID
KBArticleID that will be uninstalled.
This is an alias of the KBArticleID parameter.
string
System.String
UpdateID
Update ID that will be uninstalled.
string
System.String
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
WUSAMode
Wse wusa.exe instead of WU Api.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
---------- EXAMPLE 1 ----------
Try to uninstall update with specific KBArticleID = KB958830.
Get-WUUninstall -KBArticleID KB958830
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WindowsUpdate_v2
Get
WindowsUpdate_v2
Get list of available updates meeting the criteria.
Use Get-WindowsUpdate (aka Get-WUList) cmdlet to get list of available or installed updates meeting specific criteria.
Use Download-WindowsUpdate alias to get list of updates and download it. Equivalent Get-WindowsUpdate -Download.
Use Install-WindowsUpdate (aka Get-WUInstall) alias to get list of updates and install it. Equivalent Get-WindowsUpdate -Install.
Use Hide-WindowsUpdate alias to get list of updates and hide it. Equivalent Get-WindowsUpdate -Hide.
Use Show-WindowsUpdate (aka UnHide-WindowsUpdate) alias to get list of updates and unhide it. Equivalent Get-WindowsUpdate -Hide:$false.
There are two types of filtering update: Pre search criteria, Post search criteria.
- Pre search works on server side, like example: (IsInstalled = 0 and IsHidden = 0 and CategoryIds contains '0fa1201d-4330-4fa8-8ae9-b877473b6441' )
- Post search work on client side after get the pre-filtered list of updates, like example $KBArticleID -match $Update.KBArticleIDs
Status info list:\r\n[A|R]DIMHUB\r\nA-IsAccetped\r\nR-IsRejected\r\n D-IsDownloaded\r\n F-DownloadFailed\r\n ?-IsInvoked\r\n I-IsInstalled\r\n F-InstallFailed\r\n ?-IsInvoked\r\n R-RebootRequired\r\n M-IsMandatory\r\n H-IsHidden\r\n U-IsUninstallable\r\n B-IsBeta
Get-WindowsUpdate_v2
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ServiceID
Use specific Service Manager if it's available.
Examples Of ServiceID: \r\n \r\n -- Windows Update 9482f4b4-e343-43b6-b170-9a65bc822c77 \r\n -- Microsoft Update 7971f918-a847-4430-9279-4a52d1efe18d \r\n -- Windows Store 117cab2d-82b1-4b5a-a08c-4d62dbee7782 \r\n -- Windows Server Update Service 3da21691-e39d-4da6-8a4b-b43877bcb1b7
string
System.String
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Get-WindowsUpdate_v2
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
WindowsUpdate
Use Microsoft Update Service Manager - '7971f918-a847-4430-9279-4a52d1efe18d'
SwitchParameter
System.Management.Automation.SwitchParameter
False
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Get-WindowsUpdate_v2
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MicrosoftUpdate
Use Windows Update Service Manager - '9482f4b4-e343-43b6-b170-9a65bc822c77'
SwitchParameter
System.Management.Automation.SwitchParameter
False
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file (more preferred) in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendHistory
Send install history (Get-WUHistory) report after successful update installation or system startup.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleJob
Specify time when job will start.
DateTime
System.DateTime
01.01.0001 00:00:00
AcceptAll
Do not ask confirmation for updates. Download or Install all available updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
RecurseCycle
Specify number of cycles for check updates after successful update installation or system startup. First run is always main cycle (-RecurseCycle 1 or none). Second (-RecurseCycle 2) and n (-RecurseCycle n) cycle are recursive.
int
System.Int32
0
Hide
Get list of updates and hide/unhide approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Download
Get list of updates and download approved updates, but do not install it.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceDownload
Forces the download of updates that are already installed or that cannot be installed. Works only with -Download.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Install
Get list of updates and install approved updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ForceInstall
A forced installation is an installation in which an update is installed even if the metadata indicates that the update is already installed. Before you use ForceInstall to force an installation, determine whether the update is installed and available. If an update is not installed, a forced installation fails. Works only with -Install.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreReboot
Do not ask for reboot if it needed, but do not reboot automaticaly.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleReboot
Specify time when system will be rebooted.
DateTime
System.DateTime
01.01.0001 00:00:00
ServiceID
Use specific Service Manager if it's available.
Examples Of ServiceID: \r\n \r\n -- Windows Update 9482f4b4-e343-43b6-b170-9a65bc822c77 \r\n -- Microsoft Update 7971f918-a847-4430-9279-4a52d1efe18d \r\n -- Windows Store 117cab2d-82b1-4b5a-a08c-4d62dbee7782 \r\n -- Windows Server Update Service 3da21691-e39d-4da6-8a4b-b43877bcb1b7
string
System.String
WindowsUpdate
Use Microsoft Update Service Manager - '7971f918-a847-4430-9279-4a52d1efe18d'
SwitchParameter
System.Management.Automation.SwitchParameter
False
MicrosoftUpdate
Use Windows Update Service Manager - '9482f4b4-e343-43b6-b170-9a65bc822c77'
SwitchParameter
System.Management.Automation.SwitchParameter
False
Criteria
Pre search criteria - native for WUAPI. Set own string that specifies the search criteria. https://docs.microsoft.com/pl-pl/windows/desktop/api/wuapi/nf-wuapi-iupdatesearcher-search
string
System.String
UpdateType
Pre search criteria - native for WUAPI. Finds updates with a specific type, such as 'Driver' and 'Software'. Default value contains all updates.
string
System.String
DeploymentAction
Pre search criteria - native for WUAPI. Finds updates that are deployed for a specific action, such as an installation or uninstallation that the administrator of a server specifies. "DeploymentAction='Installation'" finds updates that are deployed for installation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
"DeploymentAction='Uninstallation'" finds updates that are deployed for uninstallation on a destination computer. "DeploymentAction='Uninstallation'" depends on the other query criteria.
If this criterion is not explicitly specified, each group of criteria that is joined to an AND operator implies "DeploymentAction='Installation'".
string
System.String
IsAssigned
Pre search criteria - native for WUAPI. Finds updates that are intended for deployment by Automatic Updates. "IsAssigned=1" finds updates that are intended for deployment by Automatic Updates, which depends on the other query criteria.At most, one assigned Windows-based driver update is returned for each local device on a destination computer.
"IsAssigned=0" finds updates that are not intended to be deployed by Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsPresent
Pre search criteria - native for WUAPI. When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer.If the update is valid for one or more products, the update is considered present if it is installed for one or more of the products.
"IsPresent=0" finds updates that are not installed for any product on a destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
BrowseOnly
Pre search criteria - native for WUAPI. "BrowseOnly=1" finds updates that are considered optional. "BrowseOnly=0" finds updates that are not considered optional.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnWebSites
Pre search criteria - native for WUAPI. Finds updates where the AutoSelectOnWebSites property has the specified value.
"AutoSelectOnWebSites=1" finds updates that are flagged to be automatically selected by Windows Update.
"AutoSelectOnWebSites=0" finds updates that are not flagged for Automatic Updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
UpdateID
Pre search criteria - native for WUAPI. Finds updates with a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
NotUpdateID
Pre search criteria - native for WUAPI. Finds updates without a specific UUID (or sets of UUIDs), such as '12345678-9abc-def0-1234-56789abcdef0'.
string[]
System.String[]
RevisionNumber
Pre search criteria - native for WUAPI. Finds updates with a specific RevisionNumber, such as '100'. This criterion must be combined with the UpdateID param.
int
System.Int32
0
CategoryIDs
Pre search criteria - native for WUAPI. Finds updates that belong to a specified category (or sets of UUIDs), such as '0fa1201d-4330-4fa8-8ae9-b877473b6441'.
string[]
System.String[]
IsInstalled
Pre search criteria - native for WUAPI. Finds updates that are installed on the destination computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IsHidden
Pre search criteria - native for WUAPI. Finds updates that are marked as hidden on the destination computer. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
WithHidden
Pre search criteria - native for WUAPI. Finds updates that are both hidden and not on the destination computer. Overwrite IsHidden param. Default search criteria is only not hidden upadates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ShowPreSearchCriteria
Show choosen search criteria. Only works for pre search criteria.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Category
Post search criteria. Finds updates that contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
KBArticleID
Post search criteria. Finds updates that contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
Title
Post search criteria. Finds updates that match part of title (case sensitive), such as '.NET Framework 4'.
string
System.String
Severity
Post search criteria. Finds updates that match part of severity, such as 'Important', 'Critical', 'Moderate', etc...
string[]
System.String[]
NotCategory
Post search criteria. Finds updates that not contain a specified category name (or sets of categories name), such as 'Updates', 'Security Updates', 'Critical Updates', etc...
string[]
System.String[]
NotKBArticleID
Post search criteria. Finds updates that not contain a KBArticleID (or sets of KBArticleIDs), such as 'KB982861'.
string[]
System.String[]
NotTitle
Post search criteria. Finds updates that not match part of title (case sensitive).
string
System.String
NotSeverity
Post search criteria. Finds updates that not match part of severity.
string[]
System.String[]
IgnoreUserInput
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Post search criteria. Finds updates that the installation or uninstallation of an update can't prompt for user input.
This is an alias of the IgnoreUserInput parameter.
SwitchParameter
System.Management.Automation.SwitchParameter
False
IgnoreRebootRequired
Post search criteria. Finds updates that specifies the restart behavior that not occurs when you install or uninstall the update.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoSelectOnly
Install only the updates that have status AutoSelectOnWebsites on true.
SwitchParameter
System.Management.Automation.SwitchParameter
False
MaxSize
Post search criteria. Finds updates that have MaxDownloadSize less or equal. Size is in Bytes.
long
System.Int64
0
MinSize
Post search criteria. Finds updates that have MaxDownloadSize greater or equal. Size is in Bytes.
long
System.Int64
0
Debuger
Debuger return original exceptions. For additional debug information use $DebugPreference = "Continue"
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection. Interactive remote connection works only for checking updates. For download or install cmdlet creates an Invoke-WUJob task.
PSWindowsUpdate.WindowsUpdate
OutputType for WindowsUpdate objects.
---------- EXAMPLE 1 ----------
Get windows updates available from default service manager.
Get-WindowsUpdate -Verbose
VERBOSE: MG-PC: Connecting to Windows Server Update Service server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[4] Updates in post search criteria
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ------- KB890830 44MB Narzędzie Windows do usuwania złośliwego oprogramowania dla systemów Window...
MG-PC ------- KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
MG-PC ------- KB4034662 21MB 2017-08 Aktualizacja zabezpieczeń Adobe Flash Player w Windows 10 Version 1...
MG-PC ------- KB4035631 11MB 2017-08 Aktualizacja Windows 10 Version 1607 dla systemów opartych na archi...
---------- EXAMPLE 2 ----------
Get all installed drivers that are available at Windows Update. Additionaly show pre search criteria.
Get-WindowsUpdate -WindowsUpdate -UpdateType Driver -IsInstalled -ShowPreSearchCriteria -Verbose
PreSearchCriteria: IsInstalled = 0 and Type = 'Driver' and IsHidden = 0
VERBOSE: MG-PC: Connecting to Windows Update server.Please wait...
VERBOSE: Found[1] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MGAJDALAP3 -DI---- 3MB Intel - Other hardware - Intel(R) Watchdog Timer Driver (Intel(R) WDT)
---------- EXAMPLE 3 ----------
Get all available update on remote machine MG-PC, that contains in Title this two words 'Aktualizacja' and 'Windows 10' (as regular expression).
Get-WindowsUpdate -ComputerName MG-PC -MicrosoftUpdate -Title "Aktualizacja.*Windows 10" -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[14] Updates in pre search criteria
VERBOSE: Found[5] Updates in post search criteria
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ------- KB3150513 2MB 2017-06 Aktualizacja Windows 10 Version 1607 dla systemów opartych na archi...
MG-PC ------- KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
MG-PC ------- KB4034662 21MB 2017-08 Aktualizacja zabezpieczeń Adobe Flash Player w Windows 10 Version 1...
MG-PC ------- KB4035631 11MB 2017-08 Aktualizacja Windows 10 Version 1607 dla systemów opartych na archi...
MG-PC ------- KB4033637 4MB Aktualizacja systemu Windows 10 Version 1607 dla komputerów z procesorami x...
---------- EXAMPLE 4 ----------
Hide update with KBArticleID: KB4034658.
Get-WindowsUpdate -KBArticleID KB4034658 -Hide -Verbose
or use alias
Hide-WindowsUpdate -KBArticleID KB4034658 -Verbose
VERBOSE: MG-PC: Connecting to Windows Server Update Service server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
Confirm
Are you sure you want to perform this action?
Performing the operation "Hide 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla systemów opartych na architekturze x64 (KB4034658)[1GB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ---H-- KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
---------- EXAMPLE 5 ----------
Unhide update with KBArticleID: KB4034658.
Get-WindowsUpdate -KBArticleID KB4034658 -WithHidden -Hide:$false -Verbose
or use alias
Show-WindowsUpdate -KBArticleID KB4034658 -Verbose
VERBOSE: MG-PC: Connecting to Windows Server Update Service server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
Confirm
Are you sure you want to perform this action?
Performing the operation "Show 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla systemów opartych na architekturze x64 (KB4034658)[1GB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ComputerName Status KB Size Title
------------ ------ -- ---- -----
MG-PC ------ KB4034658 1GB 2017-08 Aktualizacja zbiorcza dla systemu Windows 10 Version 1607 dla syste...
---------- EXAMPLE 6 ----------
Schedule job at 6:00 PM to install update with UpdateId='ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber=200. Update will be automaticaly accepted and after all serwer will be automaticaly restarted if needed.
Get-WindowsUpdate -MicrosoftUpdate -UpdateID ddb74579-7a1f-4d1f-80c8-e8647055314e -RevisionNumber 200 -ScheduleJob (Get-Date -Hour 18 -Minute 0 -Second 0) -Install -AcceptAll -AutoReboot -Verbose
or use alias
Install-WindowsUpdate -MicrosoftUpdate -UpdateID ddb74579-7a1f-4d1f-80c8-e8647055314e -RevisionNumber 200 -ScheduleJob (Get-Date -Hour 18 -Minute 0 -Second 0) -AcceptAll -AutoReboot -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[1] Updates in pre search criteria
VERBOSE: Found[1] Updates in post search criteria
VERBOSE: Choosed pre Search Criteria: (UpdateID = 'ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber = 200)
X ComputerName Result KB Size Title
- ------------ ------ -- ---- -----
1 MG-PC Accepted KB4023307 13MB Microsoft Silverlight(KB4023307)
VERBOSE: Accepted[1] Updates ready to Download
VERBOSE: Invoke-WUJob: MG-PC(31.08.2017 18:00:00):
VERBOSE: powershell.exe -Command "Get-WindowsUpdate -Criteria \"(UpdateID = 'ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber = 200)\" -AcceptAll -AutoReboot -Download -Install -MicrosoftUpdate -Verbose *>&1 | Out-File $Env:TEMP\PSWindowsUpdate.log"
---------- EXAMPLE 7 ----------
Install updates on remote computer. After all send a report from the installation process.
Install-WindowsUpdate -ComputerName MG-PC -MicrosoftUpdate -AcceptAll -AutoReboot -SendReport -PSWUSettings @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";Port=25} -Verbose
or use global PSWUSettings
@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";Port=25} | Export-Clixml -Path 'C:\Program Files\WindowsPowerShell\Modules\PSWindowsUpdate\PSWUSettings.xml'
Install-WindowsUpdate -ComputerName MG-PC -MicrosoftUpdate -AcceptAll -AutoReboot -SendReport -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[4] Updates in post search criteria
Confirm
Are you sure you want to perform this action?
Performing the operation "Microsoft Silverlight (KB4023307)[13MB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "2017-06 Aktualizacja Windows 10 Version 1607 dla systemów opartych na architekturze x64 (KB3150513)[2MB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "Aktualizacja pakietu językowego usługi Microsoft Dynamics 365 2.1[47MB]" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): L
X ComputerName Result KB Size Title
- ------------ ------ -- ---- -----
1 MG-PC Accepted KB4023307 13MB Microsoft Silverlight (KB4023307)
1 MG-PC Accepted KB3150513 2MB 2017-06 Aktualizacja Windows 10 Version 1607 dla systemów opartych na arc...
1 MG-PC Rejected KB4013759 47MB Aktualizacja pakietu językowego usługi Microsoft Dynamics 365 2.1
1 MG-PC Rejected KB3186568 67MB Program Microsoft .NET Framework 4.7 w syst. Windows 10 Version 1607 i Wi...
VERBOSE: Accepted [2]
Updates ready to Download
VERBOSE: Invoke-WUJob: MG-PC (Now):
VERBOSE: powershell.exe -Command "Get-WindowsUpdate -Criteria \"(UpdateID = 'ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber = 200) or (UpdateID = '151c4402-513c-4f39-8da1-f84d0956b5e3' and RevisionNumber = 200)\" -AcceptAll -Download -Install -AutoReboot -MicrosoftUpdate -SendReport -ProofOfLife -Verbose *>&1 | Out-File $Env:TEMP\PSWindowsUpdate.log"
---------- EXAMPLE 8 ----------
Schedule Job to install all available updates and automatically reboot system if needed. Also send report after installation (but before reboot if needed) and send second instalation history report after reboot.
@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";Port=25} | Export-Clixml -Path 'C:\Program Files\WindowsPowerShell\Modules\PSWindowsUpdate\PSWUSettings.xml'
Install-WindowsUpdate -MicrosoftUpdate -SendReport -SendHistory -AcceptAll -AutoReboot -ScheduleJob (Get-Date -Hour 18 -Minute 30 -Second 0) -ComputerName MG-PC -Verbose
VERBOSE: MG-PC: Connecting to Microsoft Update server. Please wait...
VERBOSE: Found[4] Updates in pre search criteria
VERBOSE: Found[4] Updates in post search criteria
X ComputerName Result KB Size Title
- ------------ ------ -- ---- -----
1 MG-PC Accepted KB3038936 5MB Aktualizacja systemu Windows 8.1 dla komputerów z procesorami x64(KB3038...
1 MG-PC Accepted KB3186606 4MB Pakiety językowe programu Microsoft.NET Framework 4.7 w syst. Windows 8....
1 MG-PC Accepted KB4035038 53MB Sierpień 2017: wersja zapozn. pak.zb.aktual.jakości dla pr. .NET Frame...
1 MG-PC Accepted KB2267602 309MB Aktualizacja definicji dla: Windows Defender — KB2267602 (Definicja 1.251...
VERBOSE: Accepted[4] Updates ready to Download
VERBOSE: Invoke-WUJob: MG-PC (02.09.2017 08:30:00):
VERBOSE: powershell.exe -Command "Get-WindowsUpdate -Criteria \"(UpdateID = 'e69c9679-7ce8-489a-a21c-62fb920be67a' and RevisionNumber = 201) or(UpdateID = 'de44604d-ec38-4a7f-ac63-28b3edfdb382' and RevisionNumber = 207) or(UpdateID = '9cf1d8c9-a7c3-4603-90e8-f22131ff6d7e' and RevisionNumber = 201) or(UpdateID = 'b51935f9-0e40-4624-9c26-b29bff92dcf9' and RevisionNumber = 200)\" -AcceptAll -Install -AutoReboot -MicrosoftUpdate -SendReport -SendHistory -Verbose *>&1 | Out-File $Env:TEMP\PSWindowsUpdate.log"
VERBOSE: Send report
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUApiVersion
Get
WUApiVersion
Get Windows Update Agent version.
Use Get-WUAPIVersion cmdlet to get Windows Update Agent version.
Get-WUApiVersion
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.AgentInfo
OutputType for AgentInfo objects.
---------- EXAMPLE 1 ----------
Get Windows Update Agent version.
Get-WUAPIVersion
ComputerName PSWindowsUpdate ApiVersion WuapiDllVersion
------------ --------------- ---------- ---------------
MG-PC 2.0 8.0 10.0.14393.1670
Author Blog
https://commandlinegeeks.wordpress.com/
Reset-WUComponents
Reset
WUComponents
Reset Windows Update components.
Use Reset-WUComponents cmdlet to reset all Windows Update components to default.
Reset-WUComponents
---------- EXAMPLE 1 ----------
Reset Windows Update components to default.
Reset-WUComponents -Verbose
Step 1: Stop Windows Update services
VERBOSE: Background Intelligent Transfer Service(BITS)
VERBOSE: Windows Update(wuauserv)
VERBOSE: Application Identity(appidsvc)
VERBOSE: Cryptographic Services(cryptsvc)
Step 2: Delete the qmgr*.dat files
Step 3: Backup softare distribution folders
VERBOSE: Renaming Software Distribution folder to C:\WINDOWS\SoftwareDistribution.bak5
VERBOSE: Renaming CatRoot folder to C:\WINDOWS\System32\Catroot2.bak1
Step 4: Remove old Windows Update logs
VERBOSE: Deleting the C:\WINDOWS\WindowsUpdate.log files.
Step 5: Reset Windows Update services
VERBOSE: Reset BITS service
VERBOSE: Reset Windows Update service
Step 6: Reregister dll's
VERBOSE: regsvr32.exe / s atl.dll
VERBOSE: regsvr32.exe / s urlmon.dll
VERBOSE: regsvr32.exe / s mshtml.dll
VERBOSE: regsvr32.exe / s shdocvw.dll
VERBOSE: regsvr32.exe / s browseui.dll
VERBOSE: regsvr32.exe / s jscript.dll
VERBOSE: regsvr32.exe / s vbscript.dll
VERBOSE: regsvr32.exe / s scrrun.dll
VERBOSE: regsvr32.exe / s msxml.dll
VERBOSE: regsvr32.exe / s msxml3.dll
VERBOSE: regsvr32.exe / s msxml6.dll
VERBOSE: regsvr32.exe / s actxprxy.dll
VERBOSE: regsvr32.exe / s softpub.dll
VERBOSE: regsvr32.exe / s wintrust.dll
VERBOSE: regsvr32.exe / s dssenh.dll
VERBOSE: regsvr32.exe / s rsaenh.dll
VERBOSE: regsvr32.exe / s gpkcsp.dll
VERBOSE: regsvr32.exe / s sccbase.dll
VERBOSE: regsvr32.exe / s slbcsp.dll
VERBOSE: regsvr32.exe / s cryptdlg.dll
VERBOSE: regsvr32.exe / s oleaut32.dll
VERBOSE: regsvr32.exe / s ole32.dll
VERBOSE: regsvr32.exe / s shell32.dll
VERBOSE: regsvr32.exe / s initpki.dll
VERBOSE: regsvr32.exe / s wuapi.dll
VERBOSE: regsvr32.exe / s wuaueng.dll
VERBOSE: regsvr32.exe / s wuaueng1.dll
VERBOSE: regsvr32.exe / s wucltui.dll
VERBOSE: regsvr32.exe / s wups.dll
VERBOSE: regsvr32.exe / s wups2.dll
VERBOSE: regsvr32.exe / s wuweb.dll
VERBOSE: regsvr32.exe / s qmgr.dll
VERBOSE: regsvr32.exe / s qmgrprxy.dll
VERBOSE: regsvr32.exe / s wucltux.dll
VERBOSE: regsvr32.exe / s muweb.dll
VERBOSE: regsvr32.exe / s wuwebv.dll
Step 7: Reset WinSock
VERBOSE: netsh winsock reset
Step 8: Reset Proxy
VERBOSE: netsh winhttp reset proxy
Step 9: Start Windows Update services
VERBOSE: Cryptographic Services (cryptsvc)
VERBOSE: Application Identity (appidsvc)
VERBOSE: Windows Update (wuauserv)
VERBOSE: Background Intelligent Transfer Service (BITS)
Step 10: Start Windows Update services
VERBOSE: wuauclt /resetauthorization /detectnow
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUHistory
Get
WUHistory
Get list of updates history.
Use function Get-WUHistory to get list of installed updates on specific machine.
Get-WUHistory
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Last
Last X history entry.
int
System.Int32
0
MaxDate
Filter results by date.
DateTime
System.DateTime
01.01.0001 00:00:00
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: Export-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: Export-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
MaxDate
Filter results by date.
DateTime
System.DateTime
01.01.0001 00:00:00
Last
Last X history entry.
int
System.Int32
0
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.History
OutputType for History objects.
---------- EXAMPLE 1 ----------
Get Windows Update history.
Get-WUHistory
ComputerName Operationname Date KB Title
------------ ------------- ---- -- -----
MG-PC Installation 30.08.2017 12:03:53 KB2267602 Definition Update for Windows Defender - KB2267602(Defini...
MG-PC Installation 29.08.2017 11:49:50 KB3186568 Microsoft .NET Framework 4.7 for Windows 10 Version 1607 a...
MG-PC Installation 29.08.2017 11:30:37 KB4035631 2017-08 Update for Windows Server 2016 for x64-based Syste...
MG-PC Installation 29.08.2017 11:21:12 KB890830 Windows Malicious Software Removal Tool for Windows 8, 8.1...
MG-PC Installation 29.08.2017 07:53:36 KB2267602 Definition Update for Windows Defender - KB2267602 (Defini...
MG-PC Installation 27.08.2017 07:53:39 KB2267602 Definition Update for Windows Defender - KB2267602 (Defini...
MG-PC Installation 25.08.2017 07:54:38 KB2267602 Definition Update for Windows Defender - KB2267602 (Defini...
MG-PC Installation 23.08.2017 13:01:26 KB2267602 Definition Update for Windows Defender - KB2267602 (Defini...
MG-PC Installation 23.08.2017 12:45:45 KB4023307 Security Update for Microsoft Silverlight (KB4023307)
MG-PC Installation 23.08.2017 07:53:56 KB2267602 Definition Update for Windows Defender - KB2267602 (Defini...
---------- EXAMPLE 2 ----------
Get Windows Update Agent history for last 24h.
Get-WUHistory -MaxDate (Get-Date).AddDays(-1)
ComputerName Operationname Date KB Title
------------ ------------- ---- -- -----
MG-PC Installation 30.08.2017 12:03:53 KB2267602 Definition Update for Windows Defender - KB2267602(Defini...
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUInstallerStatus
Get
WUInstallerStatus
Get Windows Update Installer status.
Use Get-WUInstallerStatus cmdlet to show Windows Update Installer status.
Get-WUInstallerStatus
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Return true/false only.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
Silent
Return true/false only.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWindowsUpdate.InstallerStatus
OutputType for InstallerStatus objects.
---------- EXAMPLE 1 ----------
Check if Windows Update Installer is busy.
Get-WUInstallerStatus
ComputerName IsBusy
------------ ------
MG-PC False
---------- EXAMPLE 2 ----------
Check if Windows Update Installer is busy in silent mode. Return only True (isBusy) or False (isFree).
Get-WUInstallerStatus -Silent
False
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUJob
Get
WUJob
Get invoked WUJob.
Use Get-WUJob cmdlet to get invoked WUJob in Task Scheduler.
Get-WUJob
ClearExpired
Clear expired WUJob.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
TaskName
Specify custom name for Task Scheduler job. Default is 'PSWindowsUpdate'.
string
System.String
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
TaskName
Specify custom name for Task Scheduler job. Default is 'PSWindowsUpdate'.
string
System.String
ClearExpired
Clear expired WUJob.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.WUJob
OutputType for WUJob.
---------- EXAMPLE 1 ----------
Get invoked WUJob on remote machine.
Get-WUJob -ComputerName MG-PC
Author Blog
https://commandlinegeeks.wordpress.com/
Invoke-WUJob
Invoke
WUJob
Invoke WUJobs by Task Schduler.
Use Invoke-WUJobs cmdlet to invoke PSWindowsUpdate actions remotly. It Based on TaskScheduler because CreateUpdateDownloader() and CreateUpdateInstaller() methods can't be called from a remote computer - E_ACCESSDENIED.
Note: Because we do not have the ability to interact, is recommended use -AcceptAll for Install-WindowsUpdate.
Invoke-WUJob
TriggerDate
Specify Time trigger for Task Scheduler job.
DateTime
System.DateTime
01.01.0001 00:00:00
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
EndBoundary
Specify EndBoundary for Task Scheduler trigger.
DateTime
System.DateTime
01.01.0001 00:00:00
Force
Force update old Task Scheduler Job if it's available.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hidden
Specify if task must be hidden. Default is true.
SwitchParameter
System.Management.Automation.SwitchParameter
True
Script
Specify PowerShell script that you what to run. Default is {ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log}
string
System.String
ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log
TaskName
Specify custom name for Task Scheduler job. Default is 'PSWindowsUpdate'.
string
System.String
PSWindowsUpdate
Invoke-WUJob
TriggerAtStart
Specify system startup trigger for Task Scheduler job.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
EndBoundary
Specify EndBoundary for Task Scheduler trigger.
DateTime
System.DateTime
01.01.0001 00:00:00
Force
Force update old Task Scheduler Job if it's available.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hidden
Specify if task must be hidden. Default is true.
SwitchParameter
System.Management.Automation.SwitchParameter
True
Script
Specify PowerShell script that you what to run. Default is {ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log}
string
System.String
ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log
TaskName
Specify custom name for Task Scheduler job. Default is 'PSWindowsUpdate'.
string
System.String
PSWindowsUpdate
Invoke-WUJob
RunNow
Run Task Scheduler job immediately.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
EndBoundary
Specify EndBoundary for Task Scheduler trigger.
DateTime
System.DateTime
01.01.0001 00:00:00
Force
Force update old Task Scheduler Job if it's available.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Hidden
Specify if task must be hidden. Default is true.
SwitchParameter
System.Management.Automation.SwitchParameter
True
Script
Specify PowerShell script that you what to run. Default is {ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log}
string
System.String
ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log
TaskName
Specify custom name for Task Scheduler job. Default is 'PSWindowsUpdate'.
string
System.String
PSWindowsUpdate
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
TaskName
Specify custom name for Task Scheduler job. Default is 'PSWindowsUpdate'.
string
System.String
PSWindowsUpdate
Hidden
Specify if task must be hidden. Default is true.
SwitchParameter
System.Management.Automation.SwitchParameter
True
EndBoundary
Specify EndBoundary for Task Scheduler trigger.
DateTime
System.DateTime
01.01.0001 00:00:00
TriggerDate
Specify Time trigger for Task Scheduler job.
DateTime
System.DateTime
01.01.0001 00:00:00
TriggerAtStart
Specify system startup trigger for Task Scheduler job.
SwitchParameter
System.Management.Automation.SwitchParameter
False
RunNow
Run Task Scheduler job immediately.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Script
Specify PowerShell script that you what to run. Default is {ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log}
string
System.String
ipmo PSWindowsUpdate; Get-WindowsUpdate -AcceptAll -Install | Out-File $Env:TEMP\PSWindowsUpdate.log
Force
Force update old Task Scheduler Job if it's available.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
---------- EXAMPLE 1 ----------
Invoke Install-WindowsUpdate on remote machine today at 6:00 PM.
Invoke-WUJob -ComputerName MG-PC -Script "ipmo PSWindowsUpdate; Install-WindowsUpdate -AcceptAll | Out-File C:\PSWindowsUpdate.log" -TriggerDate (Get-Date -Hour 18 -Minute 0 -Second 0)
Confirm
Are you sure you want to perform this action?
Performing the operation "Invoke WU job: powershell.exe -Command "ipmo PSWindowsUpdate; Install-WindowsUpdate -AcceptAll | Out-File C:\PSWindowsUpdate.log"" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WULastResults
Get
WULastResults
Get Windows Update results.
Use Get-WULastResults cmdlet to get Windows Update LastSearchSuccessDate and LastInstallationSuccessDate.
Get-WULastResults
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.LastResults
OutputType for LastResult objects.
---------- EXAMPLE 1 ----------
Get last Windows Update results.
Get-WULastResults
ComputerName LastSearchSuccessDate LastInstallationSuccessDate
------------ --------------------- ---------------------------
MG-PC 30.08.2017 14:02:11 03.07.2017 07:35:27
Author Blog
https://commandlinegeeks.wordpress.com/
Update-WUModule
Update
WUModule
Update PSWindowsUpdate module.
Use Use Update-WUModule cmdlet to remote update PSWindowsUpdate module.
Update-WUModule
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Local
Update from current module.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Update-WUModule
Online
Update from PSGallery.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Online
Update from PSGallery.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Local
Update from current module.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
---------- EXAMPLE 1 ----------
Update PSWindowsUpdate module from PSGallery
Update-WUModule -ComputerName MG-PC -Online
---------- EXAMPLE 2 ----------
Update PSWindowsUpdate module from current serwer. Require SMB connection to destination machine.
Update-WUModule -ComputerName MG-PC -Local
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUOfflineMSU
Get
WUOfflineMSU
Get offline MSU package.
Use Get-WUOfflineMSU cmdlet to download MSU package from Microsoft Update Catalog website.
Get-WUOfflineMSU
Destination
Destination for downloaded files.
string
System.String
KBArticleID
Finds updates that contain a KBArticleID.
string
System.String
AcceptAll
Do not ask confirmation for download updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
KBArticleID
Finds updates that contain a KBArticleID.
string
System.String
Destination
Destination for downloaded files.
string
System.String
AcceptAll
Do not ask confirmation for download updates.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String
Finds updates that contain a KBArticleID.
---------- EXAMPLE 1 ----------
Download package for KB4551762.
PS> Get-WUOfflineMSU -KBArticleID 4551762 -Destination C:\Temp
Confirm
Are you sure you want to perform this action?
Performing the operation "(20.04.2020 14:27:17) 2020-03 Cumulative Update for Windows Server, version 1909 for
x64-based Systems (KB4551762)[354.4 MB]" on target "DESKTOP-GCQBCBS".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): N
Confirm
Are you sure you want to perform this action?
Performing the operation "(20.04.2020 14:27:19) 2020-03 Cumulative Update for Windows 10 Version 1909 for x64-based
Systems(KB4551762) [354.4 MB]" on target "DESKTOP-GCQBCBS".
[Y] Yes[A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "(20.04.2020 14:27:23) 2020-03 Cumulative Update for Windows 10 Version 1903 for x64-based
Systems(KB4551762) [354.4 MB]" on target "DESKTOP-GCQBCBS".
[Y] Yes[A]Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): L
X Result Title LastUpdated Size
- ------ ----- ----------- ----
1 Rejected 2020-03 Cumulative Update for Windows Server, version 1909 for x64-based Systems (... 3/12/2020 354.4 MB
1 Accepted 2020-03 Cumulative Update for Windows 10 Version 1909 for x64-based Systems (KB455... 3/12/2020 354.4 MB
1 Rejected 2020-03 Cumulative Update for Windows 10 Version 1903 for x64-based Systems (KB455... 3/12/2020 354.4 MB
1 Rejected 2020-03 Cumulative Update for Windows 10 Version 1909 for x86-based Systems (KB455... 3/12/2020 191.7 MB
1 Rejected 2020-03 Cumulative Update for Windows 10 Version 1903 for x86-based Systems (KB455... 3/12/2020 191.7 MB
1 Rejected 2020-03 Cumulative Update for Windows 10 Version 1909 for ARM64-based Systems (KB4... 3/12/2020 396.1 MB
1 Rejected 2020-03 Cumulative Update for Windows Server, version 1903 for x64-based Systems (... 3/12/2020 354.4 MB
1 Rejected 2020-03 Cumulative Update for Windows 10 Version 1903 for ARM64-based Systems (KB4... 3/12/2020 396.1 MB
2 Downloaded 2020-03 Cumulative Update for Windows 10 Version 1909 for x64-based Systems (KB455... 3/12/2020 354.4 MB
PS> Get-ChildItem C:\Temp
Directory: C:\Temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 12.03.2020 07:03 371656774 windows10.0-kb4551762-x64_dacef156c781f2018d94d5a5286076610ba97279.msu
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WURebootStatus
Get
WURebootStatus
Get Windows Update reboot status.
Use Get-WURebootStatus cmdlet to check if reboot is needed.
Get-WURebootStatus
AutoReboot
Do not ask for reboot if it needed, but do it now.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Return true/false only.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Get-WURebootStatus
ScheduleReboot
Specify schedule time for reboot.
DateTime
System.DateTime
01.01.0001 00:00:00
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Return true/false only.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Get-WURebootStatus
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Return true/false only.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Get-WURebootStatus
CancelReboot
Cancel scheduled reboot.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Return true/false only.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
Silent
Return true/false only.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoReboot
Do not ask for reboot if it needed, but do it now.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleReboot
Specify schedule time for reboot.
DateTime
System.DateTime
01.01.0001 00:00:00
CancelReboot
Cancel scheduled reboot.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.Management.Automation.SwitchParameter
Return true/false only.
PSWindowsUpdate.RebootStatus
OutputType for RebootStatus objects.
---------- EXAMPLE 1 ----------
Check if restart is necessary. If yes, ask to do this or don't.
Get-WURebootStatus
Reboot is required. Do it now ? [Y/N] (default is 'N')
ComputerName RebootRequired RebootScheduled
------------ -------------- ---------------
MG-PC True
---------- EXAMPLE 2 ----------
Check if restart is necessary. If yes, then shedule it.
Get-WURebootStatus -ScheduleReboot (Get-Date -Hour 18 -Minute 0 -Second 0)
ComputerName RebootRequired RebootScheduled
------------ -------------- ---------------
MG-PC True 31.08.2017 18:00:00
Author Blog
https://commandlinegeeks.wordpress.com/
Enable-WURemoting
Enable
WURemoting
Enable firewall rules for PSWindowsUpdate remoting.
Use Enable-WURemoting cmdlet to enable nessesery firewall rules for PSWindowsUpdate remoting.
Enable-WURemoting
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
LocalAccountTokenFilterPolicy
Set LocalAccountTokenFilterPolicy registry entry to builds an elevated token on the target remote computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
WinRMPublic
Enable WinRM Public access from all subnets. Default access is only enabled from local subnet. Required for workgroup computers.
SwitchParameter
System.Management.Automation.SwitchParameter
False
LocalAccountTokenFilterPolicy
Set LocalAccountTokenFilterPolicy registry entry to builds an elevated token on the target remote computer.
SwitchParameter
System.Management.Automation.SwitchParameter
False
WinRMPublic
Enable WinRM Public access from all subnets. Default access is only enabled from local subnet. Required for workgroup computers.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
---------- EXAMPLE 1 ----------
Enable firewall rules for PSWindowsUpdate remoting.
Enable-WURemoting -Verbose
Author Blog
https://commandlinegeeks.wordpress.com/
Add-WUServiceManager
Add
WUServiceManager
Register a new Windows Update API Service Manager.
Use Add-WUServiceManager cmdlet to register new Windows Update Service Manager.
It's combination old 'Add-WUServiceManager' and 'Add-WUOfflineSync' functions to register online and offline ServiceManager
Add-WUServiceManager
ServiceID
An identifier for the service to be registered.
Examples Of ServiceID: \r\n \r\n -- Windows Update 9482f4b4-e343-43b6-b170-9a65bc822c77 \r\n -- Microsoft Update 7971f918-a847-4430-9279-4a52d1efe18d \r\n -- Windows Store 117cab2d-82b1-4b5a-a08c-4d62dbee7782 \r\n -- Windows Server Update Service 3da21691-e39d-4da6-8a4b-b43877bcb1b7
string
System.String
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Don't return output.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Add-WUServiceManager
MicrosoftUpdate
Register Microsoft Update Service Manager - '7971f918-a847-4430-9279-4a52d1efe18d'
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Don't return output.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Add-WUServiceManager
ServiceID
An identifier for the service to be registered.
Examples Of ServiceID: \r\n \r\n -- Windows Update 9482f4b4-e343-43b6-b170-9a65bc822c77 \r\n -- Microsoft Update 7971f918-a847-4430-9279-4a52d1efe18d \r\n -- Windows Store 117cab2d-82b1-4b5a-a08c-4d62dbee7782 \r\n -- Windows Server Update Service 3da21691-e39d-4da6-8a4b-b43877bcb1b7
string
System.String
AddServiceFlag
A combination of AddServiceFlag values: \r\n0x1 - asfAllowPendingRegistration \r\n0x2 - asfAllowOnlineRegistration \r\n0x4 - asfRegisterServiceWithAU
int
System.Int32
2
AuthorizationCabPath
The path of the Microsoft signed local cabinet file (.cab) that has the information that is required for a service registration. If empty, the update agent searches for the authorization cabinet file (.cab) during service registration when a network connection is available.
string
System.String
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Silent
Don't return output.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Add-WUServiceManager
ScanFileLocation
Path to Windows Update offline scan file (wsusscan.cab or wsusscn2.cab).
string
System.String
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ServiceName
Name under which it will be registered Windows Update offline service. Default name is 'Offline Sync Service'.
string
System.String
Offline Sync Service
Silent
Don't return output.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
ServiceID
An identifier for the service to be registered.
Examples Of ServiceID: \r\n \r\n -- Windows Update 9482f4b4-e343-43b6-b170-9a65bc822c77 \r\n -- Microsoft Update 7971f918-a847-4430-9279-4a52d1efe18d \r\n -- Windows Store 117cab2d-82b1-4b5a-a08c-4d62dbee7782 \r\n -- Windows Server Update Service 3da21691-e39d-4da6-8a4b-b43877bcb1b7
string
System.String
AddServiceFlag
A combination of AddServiceFlag values: \r\n0x1 - asfAllowPendingRegistration \r\n0x2 - asfAllowOnlineRegistration \r\n0x4 - asfRegisterServiceWithAU
int
System.Int32
2
AuthorizationCabPath
The path of the Microsoft signed local cabinet file (.cab) that has the information that is required for a service registration. If empty, the update agent searches for the authorization cabinet file (.cab) during service registration when a network connection is available.
string
System.String
MicrosoftUpdate
Register Microsoft Update Service Manager - '7971f918-a847-4430-9279-4a52d1efe18d'
SwitchParameter
System.Management.Automation.SwitchParameter
False
ServiceName
Name under which it will be registered Windows Update offline service. Default name is 'Offline Sync Service'.
string
System.String
Offline Sync Service
ScanFileLocation
Path to Windows Update offline scan file (wsusscan.cab or wsusscn2.cab).
string
System.String
Silent
Don't return output.
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.ServiceManager
OutputType for ServiceManager objects.
---------- EXAMPLE 1 ----------
Try register Microsoft Update Service by custom ServiceID.
Add-WUServiceManager -ServiceID "7971f918-a847-4430-9279-4a52d1efe18d"
Confirm
Are you sure you want to perform this action?
Performing the operation "Register Windows Update Service Manager: 7971f918-a847-4430-9279-4a52d1efe18d" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ServiceID IsManaged IsDefault Name
--------- --------- --------- ----
7971f918-a847-4430-9279-4a52d1efe18d False False Microsoft Update
---------- EXAMPLE 2 ----------
Try register Microsoft Update service as Service Manager.
Add-WUServiceManager -MicrosoftUpdate
Confirm
Are you sure you want to perform this action?
Performing the operation "Register Windows Update Service Manager: 7971f918-a847-4430-9279-4a52d1efe18d" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ServiceID IsManaged IsDefault Name
--------- --------- --------- ----
7971f918-a847-4430-9279-4a52d1efe18d False False Microsoft Update
---------- EXAMPLE 3 ----------
Try register Offline Sync Service from file C:\wsusscn2.cab.
Add-WUServiceManager -ScanFileLocation C:\wsusscn2.cab
Confirm
Are you sure you want to perform this action?
Performing the operation "Register Offline Windows Update Service Manager: C:\wsusscn2.cab" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ServiceID IsManaged IsDefault Name
--------- --------- --------- ----
7e1364ef-e30e-4f4e-9c66-84194eebcbbe False False Offline Sync Service
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUServiceManager
Get
WUServiceManager
Get Service Manager configuration.
Use Get-WUServiceManager cmdlet to get available configuration of update services.
Get-WUServiceManager
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ServiceID
Get specific Service Manager if it's available.
string
System.String
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
ServiceID
Get specific Service Manager if it's available.
string
System.String
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.ServiceManager
OutputType for ServiceManager objects.
---------- EXAMPLE 1 ----------
Check currently available Windows Update Services on machine.
Get-WUServiceManager
ServiceID IsManaged IsDefault Name
--------- --------- --------- ----
9482f4b4-e343-43b6-b170-9a65bc822c77 False False Windows Update
7971f918-a847-4430-9279-4a52d1efe18d False False Microsoft Update
3da21691-e39d-4da6-8a4b-b43877bcb1b7 True True Windows Server Update Service
13df3d8f-78d7-4eb8-bb9c-2a101870d350 False False Offline Sync Service2
a8f3b5e6-fb1f-4814-a047-2257d39c2460 False False Offline Sync Service
Author Blog
https://commandlinegeeks.wordpress.com/
Remove-WUServiceManager
Remove
WUServiceManager
Remove windows update service manager.
Use Remove-WUServiceManager cmdlet to unregister Windows Update Service Manager.
Remove-WUServiceManager
ServiceID
Specify ServiceID of Service Manager that you want to remove.
string
System.String
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleJob
Specify schedule time job.
DateTime
System.DateTime
01.01.0001 00:00:00
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
ScheduleJob
Specify schedule time job.
DateTime
System.DateTime
01.01.0001 00:00:00
ServiceID
Specify ServiceID of Service Manager that you want to remove.
string
System.String
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
---------- EXAMPLE 1 ----------
Try unregister Microsoft Update Service.
Remove-WUServiceManager -ServiceID "7971f918-a847-4430-9279-4a52d1efe18d"
Confirm
Are you sure you want to perform this action?
Performing the operation "Unregister Windows Update Service Manager: 7971f918-a847-4430-9279-4a52d1efe18d" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUSettings
Get
WUSettings
Get Windows Update Client settings.
Use Get-WUSettings cmdlet to get current configuration of Windows Update Client.
Get-WUSettings
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.WUSettings
OutputType for WUSettings objects.
---------- EXAMPLE 1 ----------
Get current Windows Update Client configuration.
Get-WUSettings
ComputerName : MG-PC
AcceptTrustedPublisherCerts : 0
WUServer : https://wsus.commandlinegeeks.com
WUStatusServer : https://wsus.commandlinegeeks.com
DetectionFrequencyEnabled : 1
DetectionFrequency : 2
NoAutoRebootWithLoggedOnUsers : 1
RebootRelaunchTimeoutEnabled : 1
RebootRelaunchTimeout : 240
IncludeRecommendedUpdates : 0
NoAutoUpdate : 0
AUOptions : 2 - Notify before download
ScheduledInstallDay : 0 - Every Day
ScheduledInstallTime : 4
UseWUServer : 1
Author Blog
https://commandlinegeeks.wordpress.com/
Set-WUSettings
Set
WUSettings
Set Windows Update Client settings.
Use Set-WUSettings cmdlet to Set configuration of Windows Update Client.
Set-WUSettings
AcceptTrustedPublisherCerts
Enabled - The WSUS server distributes available signed non-Microsoft updates.
Disabled - The WSUS server does not distribute available signed non-Microsoft updates.
Supported on: At least Windows Server 2003 operating systems or Windows XP Professional with SP1, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
ActiveHoursEnd
If you enable this policy, the PC will not automatically restart after updates during active hours. The PC will attempt to restart outside of active hours.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
ActiveHoursMaxRange
Enable this policy to specify the maximum number of hours from the start time that users can set their active hours. The max active hours range can be set between 8 and 18 hours.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
ActiveHoursStart
If you enable this policy, the PC will not automatically restart after updates during active hours. The PC will attempt to restart outside of active hours.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
AllowAutoWindowsUpdateDownloadOverMeteredNetwork
Enabling this policy will automatically download updates, even over metered data connections (charges may apply).
Supported on: At least Windows 10 Server, Windows 10 or Windows 10 RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
AlwaysAutoRebootAtScheduledTime
If you enable this policy, a restart timer will always begin immediately after Windows Update installs important updates, instead of first notifying users on the login screen for at least two days..
Supported on: At least Windows Server 2012, Windows 8 or Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
AlwaysAutoRebootAtScheduledTimeMinutes
The restart timer can be configured to start with any value from 15 to 180 minutes. When the timer runs out, the restart will proceed even if the PC has signed-in users.
Supported on: At least Windows Server 2012, Windows 8 or Windows RT
int
System.Int32
0
AUPowerManagement
Specifies whether the Windows Update will use the Windows Power Management features to automatically wake up the system from sleep, if there are updates scheduled for installation.
Supported on: Windows Server 2008, Windows 7, Windows Vista, and Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoInstallMinorUpdates
Silently install minor updates.
Supported on: At least Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 through Windows 8.1 or Windows Server 2012 R2 with most current service pack. Not supported on Windows 10 and above.
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoRestartNotificationSchedule
Specifies the type of notification used when notifying the user about a scheduled restart to install updates.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
int
System.Int32
0
AutoRestartRequiredNotificationDismissal
Enable this policy to specify the method by which the auto-restart required notification is dismissed. When a restart is required to install updates, the auto-restart required notification is displayed. By default, the notification is automatically dismissed after 25 seconds.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
string
System.String
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeferFeatureUpdatesPeriodInDays
Enable this policy to specify when to receive Feature Updates.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
DeferQualityUpdatesPeriodInDays
Enable this policy to specify when to receive quality updates.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
DeferUpdatePeriod
Allows IT Admins to specify update delays for up to four weeks. Supported values are 0-4, which refers to the number of weeks to defer updates.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
DeferUpgrade
You can also choose to delay updates for up to one month. If you do not delay updates, your PC will remain up to date with security updates as they become available.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeferUpgradePeriod
Allows IT Admins to specify additional upgrade delays for up to 8 months. Supported values are 0-8, which refers to the number of months to defer upgrades.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
DetectionFrequency
Time between detection cycles. Time in hours (1–22).
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
int
System.Int32
0
DetectionFrequencyEnabled
Enable/Disable detection frequency.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
DisableWindowsUpdateAccess
Disables/Enables access to Windows Update.
Supported on: At least Windows Server 2003 operating systems, Windows XP Professional Service Pack 1, or Windows 2000 Service Pack 3
SwitchParameter
System.Management.Automation.SwitchParameter
False
DisableWUfBSafeguards
This policy setting specifies that a Windows Update for Business device should skip safeguards.
Supported on: At least Windows Server, Windows 10 Version 1903
SwitchParameter
System.Management.Automation.SwitchParameter
False
ElevateNonAdmins
This policy setting allows you to control whether non-administrative users will receive update notifications based on the "Configure Automatic Updates" policy setting.
Supported on: At least Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 through Windows 8.1 or Windows Server 2012 R2 with most current service pack. Not supported on Windows 10 and above..
SwitchParameter
System.Management.Automation.SwitchParameter
False
EnableFeaturedSoftware
This policy setting allows you to control whether users see detailed enhanced notification messages about featured software from the Microsoft Update service.
Supported on: Windows Server 2008, Windows 7, and Windows Vista
SwitchParameter
System.Management.Automation.SwitchParameter
False
IncludeRecommendedUpdates
Enable/Disable recommended updates.
Supported on: At least Windows Vista through Windows 8.1 or Windows Server 2012 R2 with most current service pack. Not supported on Windows 10 and above.
SwitchParameter
System.Management.Automation.SwitchParameter
False
ManagePreviewBuilds
Enable this policy to manage which updates you receive prior to the update being released to the world.
0 Disable Preview builds.
1 Disable Preview builds once the next release is public.
2 Enable Preview builds.
3 (Default) Preview builds is left to user selection.
Supported on: At least Windows Server, Windows 10 Version 1709
int
System.Int32
0
NoAUShutdownOption
This policy setting allows you to manage whether the 'Install Updates and Shut Down' option is displayed in the Shut Down Windows dialog box.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows XP SP2
SwitchParameter
System.Management.Automation.SwitchParameter
False
NoAutoRebootWithLoggedOnUsers
Logged-on user can decide whether to restart the client computer.
Supported on: Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3
SwitchParameter
System.Management.Automation.SwitchParameter
False
NoAutoUpdate
Enable/Disable Automatic Updates.
Supported on: Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 Option 7 only supported on servers of at least Windows Server 2016 edition
SwitchParameter
System.Management.Automation.SwitchParameter
False
NotificationLevel
Notify mode: "Not configured", "Disabled", "Notify before download", "Notify before installation", "Scheduled installation", "Users configure"
Supported on: Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 Option 7 only supported on servers of at least Windows Server 2016 edition
string
System.String
PauseDeferrals
Allows IT Admins to pause updates and upgrades for up to 5 weeks.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
ProductVersion
ProductVersion allow to control maximum version of Feature updates. For example "Windows 11" or "11" or "Windows 10".
Supported on: At least Windows 10 Server or Windows 10
string
System.String
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
RebootRelaunchTimeout
Time between prompts for a scheduled restart. Time in minutes (1–1440).
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
int
System.Int32
0
RebootRelaunchTimeoutEnabled
Specifies the amount of time for Automatic Updates to wait before prompting again with a scheduled restart.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
SwitchParameter
System.Management.Automation.SwitchParameter
False
RebootWarningTimeout
Length, in minutes, of the restart warning countdown after updates have been installed that have a deadline or scheduled updates. Time in minutes (1–30).
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
int
System.Int32
0
RebootWarningTimeoutEnabled
Enable/Disable RebootWarningTimeout.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
SwitchParameter
System.Management.Automation.SwitchParameter
False
RescheduleWaitTime
Specifies the amount of time for Automatic Updates to wait, following system startup, before proceeding with a scheduled installation that was missed previously.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
int
System.Int32
0
RescheduleWaitTimeEnabled
Specifies the amount of time for Automatic Updates to wait, following system startup, before proceeding with a scheduled installation that was missed previously.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduledInstallDay
Scheduled day of install: "Every day", "Every Sunday", "Every Monday", "Every Tuesday", "Every Wednesday", "Every Thursday", ""Every Friday", "EverySaturday". Only valid if NotificationLevel (AUOptions) = "Scheduled installation"
Starting with Windows 8 and Windows Server 2012, ScheduledInstallationDay are not supported and will return unreliable values.If you try to modify these properties, the operation will appear to succeed but will have no effect.
string
System.String
ScheduledInstallTime
Scheduled time of install in 24-hour format(0–23).
Starting with Windows 8 and Windows Server 2012, ScheduledInstallTime are not supported and will return unreliable values.If you try to modify these properties, the operation will appear to succeed but will have no effect.
int
System.Int32
0
ScheduleImminentRestartWarning
Enable this policy to control when notifications are displayed to warn users about a scheduled restart for the update installation deadline. 15 Minutes (Default), 30 Minutes or 60 Minutes.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
int
System.Int32
0
ScheduleRestartWarning
Enable this policy to control when notifications are displayed to warn users about a scheduled restart for the update installation deadline. 2 Hours, 4 Hours (Default), 8 Hours, 12 Hours, 24 Hours.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
int
System.Int32
0
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetActiveHours
If you enable this policy, the PC will not automatically restart after updates during active hours. The PC will attempt to restart outside of active hours.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetActiveHoursMaxRange
Enable this policy to specify the maximum number of hours from the start time that users can set their active hours. The max active hours range can be set between 8 and 18 hours.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetAutoRestartNotificationConfig
Specifies the type of notification used when notifying the user about a scheduled restart to install updates.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetAutoRestartNotificationDisable
This policy setting allows you to control whether users receive notifications for auto restarts for update installations including reminder and warning notifications.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetAutoRestartRequiredNotificationDismissal
Enable this policy to specify the method by which the auto-restart required notification is dismissed. When a restart is required to install updates, the auto-restart required notification is displayed. By default, the notification is automatically dismissed after 25 seconds.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetDisablePauseUXAccess
This setting allows to remove access to "Pause updates" feature. Once enabled user access to pause updates is removed.
Supported on: At least Windows Server, Windows 10 Version 1809
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetDisableUXWUAccess
This setting allows you to remove access to scan Windows Update. If you enable this setting, Windows Update scan access is removed.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetEDURestart
Enabling this policy for EDU devices that remain on Carts overnight will skip power checks to ensure update reboots will happen at the scheduled install time.
Supported on: At least Windows 10 Server, Windows 10 or Windows 10 RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForDriverUpdates
Configure this policy to specify whether to receive Windows Driver Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForFeatureUpdates
Configure this policy to specify whether to receive Windows Feature Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForOtherUpdates
Configure this policy to specify whether to receive Other Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForQualityUpdates
Configure this policy to specify whether to receive Windows Quality Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetRestartWarningSchd
Enable this policy to control when notifications are displayed to warn users about a scheduled restart for the update installation deadline.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetUpdateNotificationLevel
This policy allows you to define what Windows Update notifications users see. This policy doesn't control how and when updates are downloaded and installed.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
TargetGroup
Name of the computer group to which the computer belongs.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
string
System.String
TargetGroupEnabled
Use/Do not use client-side targeting.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
TargetReleaseVersion
Enable settings for control maximum version of Feature updates.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
TargetReleaseVersionInfo
TargetReleaseVersionInfo allow to control maximum version of Feature updates. For example "22H2".
Supported on: At least Windows 10 Server or Windows 10
string
System.String
UpdateNotificationLevel
This policy allows you to define what Windows Update notifications users see. This policy doesn't control how and when updates are downloaded and installed.
Supported on: At least Windows 10 Server or Windows 10
string
System.String
UseUpdateClassPolicySource
When this policy is enabled, devices will receive Windows updates for the classes listed from the specified update source: either Windows Update or Windows Server Update Service.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
UseWUServer
The computer gets its updates from a WSUS server or from Microsoft Update.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
WUServer
HTTP(S) URL of the WSUS server that is used by Automatic Updates and API callers (by default).
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
string
System.String
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
AcceptTrustedPublisherCerts
Enabled - The WSUS server distributes available signed non-Microsoft updates.
Disabled - The WSUS server does not distribute available signed non-Microsoft updates.
Supported on: At least Windows Server 2003 operating systems or Windows XP Professional with SP1, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
DisableWindowsUpdateAccess
Disables/Enables access to Windows Update.
Supported on: At least Windows Server 2003 operating systems, Windows XP Professional Service Pack 1, or Windows 2000 Service Pack 3
SwitchParameter
System.Management.Automation.SwitchParameter
False
ElevateNonAdmins
This policy setting allows you to control whether non-administrative users will receive update notifications based on the "Configure Automatic Updates" policy setting.
Supported on: At least Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 through Windows 8.1 or Windows Server 2012 R2 with most current service pack. Not supported on Windows 10 and above..
SwitchParameter
System.Management.Automation.SwitchParameter
False
TargetGroup
Name of the computer group to which the computer belongs.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
string
System.String
TargetGroupEnabled
Use/Do not use client-side targeting.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
WUServer
HTTP(S) URL of the WSUS server that is used by Automatic Updates and API callers (by default).
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
string
System.String
NotificationLevel
Notify mode: "Not configured", "Disabled", "Notify before download", "Notify before installation", "Scheduled installation", "Users configure"
Supported on: Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 Option 7 only supported on servers of at least Windows Server 2016 edition
string
System.String
AUOptions
Notify mode: "Not configured", "Disabled", "Notify before download", "Notify before installation", "Scheduled installation", "Users configure"
Supported on: Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 Option 7 only supported on servers of at least Windows Server 2016 edition
This is an alias of the NotificationLevel parameter.
string
System.String
AutoInstallMinorUpdates
Silently install minor updates.
Supported on: At least Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 through Windows 8.1 or Windows Server 2012 R2 with most current service pack. Not supported on Windows 10 and above.
SwitchParameter
System.Management.Automation.SwitchParameter
False
DetectionFrequency
Time between detection cycles. Time in hours (1–22).
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
int
System.Int32
0
DetectionFrequencyEnabled
Enable/Disable detection frequency.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
IncludeRecommendedUpdates
Enable/Disable recommended updates.
Supported on: At least Windows Vista through Windows 8.1 or Windows Server 2012 R2 with most current service pack. Not supported on Windows 10 and above.
SwitchParameter
System.Management.Automation.SwitchParameter
False
NoAutoRebootWithLoggedOnUsers
Logged-on user can decide whether to restart the client computer.
Supported on: Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3
SwitchParameter
System.Management.Automation.SwitchParameter
False
NoAutoUpdate
Enable/Disable Automatic Updates.
Supported on: Windows XP Professional Service Pack 1 or At least Windows 2000 Service Pack 3 Option 7 only supported on servers of at least Windows Server 2016 edition
SwitchParameter
System.Management.Automation.SwitchParameter
False
RebootRelaunchTimeout
Time between prompts for a scheduled restart. Time in minutes (1–1440).
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
int
System.Int32
0
RebootRelaunchTimeoutEnabled
Specifies the amount of time for Automatic Updates to wait before prompting again with a scheduled restart.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
SwitchParameter
System.Management.Automation.SwitchParameter
False
RebootWarningTimeout
Length, in minutes, of the restart warning countdown after updates have been installed that have a deadline or scheduled updates. Time in minutes (1–30).
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
int
System.Int32
0
RebootWarningTimeoutEnabled
Enable/Disable RebootWarningTimeout.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduledInstallDay
Scheduled day of install: "Every day", "Every Sunday", "Every Monday", "Every Tuesday", "Every Wednesday", "Every Thursday", ""Every Friday", "EverySaturday". Only valid if NotificationLevel (AUOptions) = "Scheduled installation"
Starting with Windows 8 and Windows Server 2012, ScheduledInstallationDay are not supported and will return unreliable values.If you try to modify these properties, the operation will appear to succeed but will have no effect.
string
System.String
ScheduledInstallTime
Scheduled time of install in 24-hour format(0–23).
Starting with Windows 8 and Windows Server 2012, ScheduledInstallTime are not supported and will return unreliable values.If you try to modify these properties, the operation will appear to succeed but will have no effect.
int
System.Int32
0
UseWUServer
The computer gets its updates from a WSUS server or from Microsoft Update.
Supported on: At least Windows XP Professional Service Pack 1 or Windows 2000 Service Pack 3, excluding Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
TargetReleaseVersion
Enable settings for control maximum version of Feature updates.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
TargetReleaseVersionInfo
TargetReleaseVersionInfo allow to control maximum version of Feature updates. For example "22H2".
Supported on: At least Windows 10 Server or Windows 10
string
System.String
ProductVersion
ProductVersion allow to control maximum version of Feature updates. For example "Windows 11" or "11" or "Windows 10".
Supported on: At least Windows 10 Server or Windows 10
string
System.String
DeferFeatureUpdatesPeriodInDays
Enable this policy to specify when to receive Feature Updates.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
DeferQualityUpdatesPeriodInDays
Enable this policy to specify when to receive quality updates.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
DisableWUfBSafeguards
This policy setting specifies that a Windows Update for Business device should skip safeguards.
Supported on: At least Windows Server, Windows 10 Version 1903
SwitchParameter
System.Management.Automation.SwitchParameter
False
ManagePreviewBuilds
Enable this policy to manage which updates you receive prior to the update being released to the world.
0 Disable Preview builds.
1 Disable Preview builds once the next release is public.
2 Enable Preview builds.
3 (Default) Preview builds is left to user selection.
Supported on: At least Windows Server, Windows 10 Version 1709
int
System.Int32
0
AllowAutoWindowsUpdateDownloadOverMeteredNetwork
Enabling this policy will automatically download updates, even over metered data connections (charges may apply).
Supported on: At least Windows 10 Server, Windows 10 or Windows 10 RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
AlwaysAutoRebootAtScheduledTime
If you enable this policy, a restart timer will always begin immediately after Windows Update installs important updates, instead of first notifying users on the login screen for at least two days..
Supported on: At least Windows Server 2012, Windows 8 or Windows RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
AlwaysAutoRebootAtScheduledTimeMinutes
The restart timer can be configured to start with any value from 15 to 180 minutes. When the timer runs out, the restart will proceed even if the PC has signed-in users.
Supported on: At least Windows Server 2012, Windows 8 or Windows RT
int
System.Int32
0
SetAutoRestartNotificationConfig
Specifies the type of notification used when notifying the user about a scheduled restart to install updates.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoRestartNotificationSchedule
Specifies the type of notification used when notifying the user about a scheduled restart to install updates.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
int
System.Int32
0
SetAutoRestartRequiredNotificationDismissal
Enable this policy to specify the method by which the auto-restart required notification is dismissed. When a restart is required to install updates, the auto-restart required notification is displayed. By default, the notification is automatically dismissed after 25 seconds.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
AutoRestartRequiredNotificationDismissal
Enable this policy to specify the method by which the auto-restart required notification is dismissed. When a restart is required to install updates, the auto-restart required notification is displayed. By default, the notification is automatically dismissed after 25 seconds.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
string
System.String
SetRestartWarningSchd
Enable this policy to control when notifications are displayed to warn users about a scheduled restart for the update installation deadline.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
ScheduleRestartWarning
Enable this policy to control when notifications are displayed to warn users about a scheduled restart for the update installation deadline. 2 Hours, 4 Hours (Default), 8 Hours, 12 Hours, 24 Hours.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
int
System.Int32
0
ScheduleImminentRestartWarning
Enable this policy to control when notifications are displayed to warn users about a scheduled restart for the update installation deadline. 15 Minutes (Default), 30 Minutes or 60 Minutes.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
int
System.Int32
0
DeferUpgrade
You can also choose to delay updates for up to one month. If you do not delay updates, your PC will remain up to date with security updates as they become available.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
DeferUpgradePeriod
Allows IT Admins to specify additional upgrade delays for up to 8 months. Supported values are 0-8, which refers to the number of months to defer upgrades.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
DeferUpdatePeriod
Allows IT Admins to specify update delays for up to four weeks. Supported values are 0-4, which refers to the number of weeks to defer updates.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
PauseDeferrals
Allows IT Admins to pause updates and upgrades for up to 5 weeks.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetUpdateNotificationLevel
This policy allows you to define what Windows Update notifications users see. This policy doesn't control how and when updates are downloaded and installed.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
UpdateNotificationLevel
This policy allows you to define what Windows Update notifications users see. This policy doesn't control how and when updates are downloaded and installed.
Supported on: At least Windows 10 Server or Windows 10
string
System.String
NoAUShutdownOption
This policy setting allows you to manage whether the 'Install Updates and Shut Down' option is displayed in the Shut Down Windows dialog box.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows XP SP2
SwitchParameter
System.Management.Automation.SwitchParameter
False
AUPowerManagement
Specifies whether the Windows Update will use the Windows Power Management features to automatically wake up the system from sleep, if there are updates scheduled for installation.
Supported on: Windows Server 2008, Windows 7, Windows Vista, and Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetDisablePauseUXAccess
This setting allows to remove access to "Pause updates" feature. Once enabled user access to pause updates is removed.
Supported on: At least Windows Server, Windows 10 Version 1809
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetDisableUXWUAccess
This setting allows you to remove access to scan Windows Update. If you enable this setting, Windows Update scan access is removed.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
RescheduleWaitTimeEnabled
Specifies the amount of time for Automatic Updates to wait, following system startup, before proceeding with a scheduled installation that was missed previously.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
SwitchParameter
System.Management.Automation.SwitchParameter
False
RescheduleWaitTime
Specifies the amount of time for Automatic Updates to wait, following system startup, before proceeding with a scheduled installation that was missed previously.
Supported on: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2003, Windows XP SP2, Windows XP SP1 , Windows 2000 SP4, Windows 2000 SP3
int
System.Int32
0
SetActiveHoursMaxRange
Enable this policy to specify the maximum number of hours from the start time that users can set their active hours. The max active hours range can be set between 8 and 18 hours.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
ActiveHoursMaxRange
Enable this policy to specify the maximum number of hours from the start time that users can set their active hours. The max active hours range can be set between 8 and 18 hours.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
UseUpdateClassPolicySource
When this policy is enabled, devices will receive Windows updates for the classes listed from the specified update source: either Windows Update or Windows Server Update Service.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForFeatureUpdates
Configure this policy to specify whether to receive Windows Feature Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForQualityUpdates
Configure this policy to specify whether to receive Windows Quality Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForDriverUpdates
Configure this policy to specify whether to receive Windows Driver Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetPolicyDrivenUpdateSourceForOtherUpdates
Configure this policy to specify whether to receive Other Updates from Windows Update endpoint, managed by Windows Update for Business policies, or through your configured Windows Server Update Service (WSUS) server.
Supported on: At least Windows Server 2022, or Windows 10 Version 2004
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetActiveHours
If you enable this policy, the PC will not automatically restart after updates during active hours. The PC will attempt to restart outside of active hours.
Supported on: At least Windows 10 Server or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
ActiveHoursStart
If you enable this policy, the PC will not automatically restart after updates during active hours. The PC will attempt to restart outside of active hours.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
ActiveHoursEnd
If you enable this policy, the PC will not automatically restart after updates during active hours. The PC will attempt to restart outside of active hours.
Supported on: At least Windows 10 Server or Windows 10
int
System.Int32
0
SetAutoRestartNotificationDisable
This policy setting allows you to control whether users receive notifications for auto restarts for update installations including reminder and warning notifications.
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
SwitchParameter
System.Management.Automation.SwitchParameter
False
EnableFeaturedSoftware
This policy setting allows you to control whether users see detailed enhanced notification messages about featured software from the Microsoft Update service.
Supported on: Windows Server 2008, Windows 7, and Windows Vista
SwitchParameter
System.Management.Automation.SwitchParameter
False
SetEDURestart
Enabling this policy for EDU devices that remain on Carts overnight will skip power checks to ensure update reboots will happen at the scheduled install time.
Supported on: At least Windows 10 Server, Windows 10 or Windows 10 RT
SwitchParameter
System.Management.Automation.SwitchParameter
False
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
System.String[]
Specify one or more computer names for remote connection.
PSWindowsUpdate.WUSettings
OutputType for WUSettings objects.
---------- EXAMPLE 1 ----------
Enable IncludeRecommendedUpdates attributes.
Set-WUSettings -IncludeRecommendedUpdates
Confirm
Are you sure you want to perform this action?
Performing the operation "Set Windows Update settings" on target "MG-PC".
[Y] Yes[A] Yes to All [N] No[L] No to All [S] Suspend[?] Help (default is "Y"): Y
ComputerName IncludeRecommendedUpdates
------------ -------------------------
MG-PC True
Author Blog
https://commandlinegeeks.wordpress.com/
Get-WUTest
Get
WUTest
Test cmdlet.
Use Get-WUTest cmdlet to test.
Get-WUTest
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
TestParam
Test parameter.
string
System.String
ComputerName
Specify one or more computer names for remote connection.
string[]
System.String[]
Credential
Specify alternative credential.
PSCredential
System.Management.Automation.PSCredential
SendReport
Send report email to specific recipients.
Requires the parameter -PSWUSettings or declare the PSWUSettings.xml file in ModuleBase path.
SwitchParameter
System.Management.Automation.SwitchParameter
False
PSWUSettings
Required parameter for -SendReport.
Passes the parameters (as hashtable) necessary to send the report: \r\n@{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25];[Subject="Alternative Subject"];[Properties="Alternative object properties"];[Style="Table|List"]}
Send parameters can also be saved to a PSWUSettings.xml file in ModuleBase path: \r\nExport-Clixml @{SmtpServer="your.smtp.server";From="sender@email.address";To="recipient@email.address";[Port=25]}"
Hashtable
System.Collections.Hashtable
Debuger
Debuger return original exceptions.
SwitchParameter
System.Management.Automation.SwitchParameter
False
TestParam
Test parameter.
string
System.String
System.String[]
Specify one or more computer names for remote connection.
---------- EXAMPLE 1 ----------
Test.
Get-WUTest
Author Blog
https://commandlinegeeks.wordpress.com/