|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WSUS Aproved Updates - [WP]
Provides a status report for approved updates. Every update approved on your server is shown, with a list of the target groups for which it was approved. Within each group, counts are shown for how many computers have a specific status for that update: Installed, Needed, Failed, or Unknown. When I run this on the WSUS Server it gives me an error line 1 character: 87. Error: invalid character code: 800A0408 Source: Microsoft VBScript Compiling error I am not the scripting guy. Anybody can advise Please. Thank you [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null if (!$wsus) { $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); } "Server name: " +$wsus.Name; "Using secure connection: " + $wsus.IsConnectionSecureForRemoting; "Port number: " + $wsus.PortNumber; $updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope; $updateScope.UpdateApprovalActions = [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Install ` -bor [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Uninstall $wsus.GetUpdates($updateScope) | foreach { $update = $_ #$_ is a shorthand variable for the current item in a loop "--------------------------------------------------" "Update: " + $update.Title "Update Id: " + $update.Id.UpdateId "--------------------------------------------------" $wsus.GetComputerTargetGroups() | foreach { $group = $_ if ($update.GetUpdateApprovals($group).Count -ne 0) { #`t is equivalent to \t in C#/C++ "`t Computer Group: " + $group.Name "`t ComputerTargetGroupId: " + $group.Id "`t Approval action: " + $update.GetUpdateApprovals($group)[0].Action $summary = $update.GetSummaryForComputerTargetGroup($group) "`t Installed:" + ($Summary.InstalledCount + $summary.NotApplicableCount) $neededCount = ($summary.InstalledPendingRebootCount + $summary.NotInstalledCount) if ($neededCount -gt 0) { Write-Host ("`t Needed: $neededCount") -foregroundColor Yellow -backgroundColor black } else { "`t Needed: $neededCount" } if ($summary.FailedCount -gt 0) { Write-Host ("`t Failed: " + $summary.FailedCount) -foregroundColor Red -backgroundColor black } else { "`t Failed: " + $summary.FailedCount } "`t Unknown: " + $summary.UnknownCount "`t ------------------------------------------" } } "--------------------------------------------------" } Show quote
"WILDPACKET" wrote: This looks like PowerShell, not VBScript.> > I found this on WSUS Site under Script Centre this > Provides a status report for approved updates. Every update approved on your > server is shown, with a list of the target groups for which it was approved. > Within each group, counts are shown for how many computers have a specific > status for that update: Installed, Needed, Failed, or Unknown. > > > > When I run this on the WSUS Server it gives me an error > > line 1 > character: 87. > Error: invalid character > code: 800A0408 > Source: Microsoft VBScript Compiling error > > > I am not the scripting guy. > > Anybody can advise Please. > > Thank you > > > > > > [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null > if (!$wsus) { > $wsus = > [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); > } > > "Server name: " +$wsus.Name; > "Using secure connection: " + $wsus.IsConnectionSecureForRemoting; > "Port number: " + $wsus.PortNumber; > > $updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope; > $updateScope.UpdateApprovalActions = > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Install ` > -bor > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Uninstall > > $wsus.GetUpdates($updateScope) | foreach { > $update = $_ #$_ is a shorthand variable for the current item in a loop > > "--------------------------------------------------" > "Update: " + $update.Title > "Update Id: " + $update.Id.UpdateId > "--------------------------------------------------" > > $wsus.GetComputerTargetGroups() | foreach { > $group = $_ > if ($update.GetUpdateApprovals($group).Count -ne 0) > { > #`t is equivalent to \t in C#/C++ > "`t Computer Group: " + $group.Name > "`t ComputerTargetGroupId: " + $group.Id > "`t Approval action: " + $update.GetUpdateApprovals($group)[0].Action > > $summary = $update.GetSummaryForComputerTargetGroup($group) > > "`t Installed:" + ($Summary.InstalledCount + $summary.NotApplicableCount) > > $neededCount = ($summary.InstalledPendingRebootCount + > $summary.NotInstalledCount) > if ($neededCount -gt 0) > { > Write-Host ("`t Needed: $neededCount") -foregroundColor Yellow > -backgroundColor black > } else { > "`t Needed: $neededCount" > } > > if ($summary.FailedCount -gt 0) > { > Write-Host ("`t Failed: " + $summary.FailedCount) -foregroundColor Red > -backgroundColor black > } else { > "`t Failed: " + $summary.FailedCount > } > > "`t Unknown: " + $summary.UnknownCount > "`t ------------------------------------------" > } > } > "--------------------------------------------------" > } > -- urkec Thank you urkec for your response.
How do I excute this script? Show quote "urkec" wrote: > "WILDPACKET" wrote: > > > > > I found this on WSUS Site under Script Centre this > > Provides a status report for approved updates. Every update approved on your > > server is shown, with a list of the target groups for which it was approved. > > Within each group, counts are shown for how many computers have a specific > > status for that update: Installed, Needed, Failed, or Unknown. > > > > > > > > When I run this on the WSUS Server it gives me an error > > > > line 1 > > character: 87. > > Error: invalid character > > code: 800A0408 > > Source: Microsoft VBScript Compiling error > > > > > > I am not the scripting guy. > > > > Anybody can advise Please. > > > > Thank you > > > > > > > > > > > > [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null > > if (!$wsus) { > > $wsus = > > [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); > > } > > > > "Server name: " +$wsus.Name; > > "Using secure connection: " + $wsus.IsConnectionSecureForRemoting; > > "Port number: " + $wsus.PortNumber; > > > > $updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope; > > $updateScope.UpdateApprovalActions = > > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Install ` > > -bor > > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Uninstall > > > > $wsus.GetUpdates($updateScope) | foreach { > > $update = $_ #$_ is a shorthand variable for the current item in a loop > > > > "--------------------------------------------------" > > "Update: " + $update.Title > > "Update Id: " + $update.Id.UpdateId > > "--------------------------------------------------" > > > > $wsus.GetComputerTargetGroups() | foreach { > > $group = $_ > > if ($update.GetUpdateApprovals($group).Count -ne 0) > > { > > #`t is equivalent to \t in C#/C++ > > "`t Computer Group: " + $group.Name > > "`t ComputerTargetGroupId: " + $group.Id > > "`t Approval action: " + $update.GetUpdateApprovals($group)[0].Action > > > > $summary = $update.GetSummaryForComputerTargetGroup($group) > > > > "`t Installed:" + ($Summary.InstalledCount + $summary.NotApplicableCount) > > > > $neededCount = ($summary.InstalledPendingRebootCount + > > $summary.NotInstalledCount) > > if ($neededCount -gt 0) > > { > > Write-Host ("`t Needed: $neededCount") -foregroundColor Yellow > > -backgroundColor black > > } else { > > "`t Needed: $neededCount" > > } > > > > if ($summary.FailedCount -gt 0) > > { > > Write-Host ("`t Failed: " + $summary.FailedCount) -foregroundColor Red > > -backgroundColor black > > } else { > > "`t Failed: " + $summary.FailedCount > > } > > > > "`t Unknown: " + $summary.UnknownCount > > "`t ------------------------------------------" > > } > > } > > "--------------------------------------------------" > > } > > > > This looks like PowerShell, not VBScript. > > -- > urkec You will need to install powershell if it is not already installed. Then you
will need to rename the file containing the script from whatever.vbs to whatever.ps. And if that does not do the trick, then I'd suggest you refer back to the introductory material found at the Script Centre. /Al Show quote "WILDPACKET" <WILDPAC***@discussions.microsoft.com> wrote in message news:905534C9-F422-47B7-9CDE-199E71507474@microsoft.com... > > Thank you urkec for your response. > How do I excute this script? > > > > "urkec" wrote: > >> "WILDPACKET" wrote: >> >> > >> > I found this on WSUS Site under Script Centre this >> > Provides a status report for approved updates. Every update approved on >> > your >> > server is shown, with a list of the target groups for which it was >> > approved. >> > Within each group, counts are shown for how many computers have a >> > specific >> > status for that update: Installed, Needed, Failed, or Unknown. >> > >> > >> > >> > When I run this on the WSUS Server it gives me an error >> > >> > line 1 >> > character: 87. >> > Error: invalid character >> > code: 800A0408 >> > Source: Microsoft VBScript Compiling error >> > >> > >> > I am not the scripting guy. >> > >> > Anybody can advise Please. >> > >> > Thank you >> > >> > >> > >> > >> > >> > [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") >> > | out-null >> > if (!$wsus) { >> > $wsus = >> > [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); >> > } >> > >> > "Server name: " +$wsus.Name; >> > "Using secure connection: " + $wsus.IsConnectionSecureForRemoting; >> > "Port number: " + $wsus.PortNumber; >> > >> > $updateScope = new-object >> > Microsoft.UpdateServices.Administration.UpdateScope; >> > $updateScope.UpdateApprovalActions = >> > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Install >> > ` >> > -bor >> > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Uninstall >> > >> > $wsus.GetUpdates($updateScope) | foreach { >> > $update = $_ #$_ is a shorthand variable for the current item in a loop >> > >> > "--------------------------------------------------" >> > "Update: " + $update.Title >> > "Update Id: " + $update.Id.UpdateId >> > "--------------------------------------------------" >> > >> > $wsus.GetComputerTargetGroups() | foreach { >> > $group = $_ >> > if ($update.GetUpdateApprovals($group).Count -ne 0) >> > { >> > #`t is equivalent to \t in C#/C++ >> > "`t Computer Group: " + $group.Name >> > "`t ComputerTargetGroupId: " + $group.Id >> > "`t Approval action: " + $update.GetUpdateApprovals($group)[0].Action >> > >> > $summary = $update.GetSummaryForComputerTargetGroup($group) >> > >> > "`t Installed:" + ($Summary.InstalledCount + >> > $summary.NotApplicableCount) >> > >> > $neededCount = ($summary.InstalledPendingRebootCount + >> > $summary.NotInstalledCount) >> > if ($neededCount -gt 0) >> > { >> > Write-Host ("`t Needed: $neededCount") -foregroundColor Yellow >> > -backgroundColor black >> > } else { >> > "`t Needed: $neededCount" >> > } >> > >> > if ($summary.FailedCount -gt 0) >> > { >> > Write-Host ("`t Failed: " + $summary.FailedCount) -foregroundColor Red >> > -backgroundColor black >> > } else { >> > "`t Failed: " + $summary.FailedCount >> > } >> > >> > "`t Unknown: " + $summary.UnknownCount >> > "`t ------------------------------------------" >> > } >> > } >> > "--------------------------------------------------" >> > } >> > >> >> This looks like PowerShell, not VBScript. >> >> -- >> urkec Al Thanks for your response.
I installed the Powershell and renamed it to file.ps I go to DOS prompt and type powershell and enter It changes the prompt to PS C:\> and then I type the file.ps and enter and get this error ... The term 'file.ps' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. At line:1 char:18 + file.ps <<<< Advise Please. Show quote "Al Dunbar" wrote: > You will need to install powershell if it is not already installed. Then you > will need to rename the file containing the script from whatever.vbs to > whatever.ps. And if that does not do the trick, then I'd suggest you refer > back to the introductory material found at the Script Centre. > > /Al > > "WILDPACKET" <WILDPAC***@discussions.microsoft.com> wrote in message > news:905534C9-F422-47B7-9CDE-199E71507474@microsoft.com... > > > > Thank you urkec for your response. > > How do I excute this script? > > > > > > > > "urkec" wrote: > > > >> "WILDPACKET" wrote: > >> > >> > > >> > I found this on WSUS Site under Script Centre this > >> > Provides a status report for approved updates. Every update approved on > >> > your > >> > server is shown, with a list of the target groups for which it was > >> > approved. > >> > Within each group, counts are shown for how many computers have a > >> > specific > >> > status for that update: Installed, Needed, Failed, or Unknown. > >> > > >> > > >> > > >> > When I run this on the WSUS Server it gives me an error > >> > > >> > line 1 > >> > character: 87. > >> > Error: invalid character > >> > code: 800A0408 > >> > Source: Microsoft VBScript Compiling error > >> > > >> > > >> > I am not the scripting guy. > >> > > >> > Anybody can advise Please. > >> > > >> > Thank you > >> > > >> > > >> > > >> > > >> > > >> > [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") > >> > | out-null > >> > if (!$wsus) { > >> > $wsus = > >> > [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); > >> > } > >> > > >> > "Server name: " +$wsus.Name; > >> > "Using secure connection: " + $wsus.IsConnectionSecureForRemoting; > >> > "Port number: " + $wsus.PortNumber; > >> > > >> > $updateScope = new-object > >> > Microsoft.UpdateServices.Administration.UpdateScope; > >> > $updateScope.UpdateApprovalActions = > >> > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Install > >> > ` > >> > -bor > >> > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Uninstall > >> > > >> > $wsus.GetUpdates($updateScope) | foreach { > >> > $update = $_ #$_ is a shorthand variable for the current item in a loop > >> > > >> > "--------------------------------------------------" > >> > "Update: " + $update.Title > >> > "Update Id: " + $update.Id.UpdateId > >> > "--------------------------------------------------" > >> > > >> > $wsus.GetComputerTargetGroups() | foreach { > >> > $group = $_ > >> > if ($update.GetUpdateApprovals($group).Count -ne 0) > >> > { > >> > #`t is equivalent to \t in C#/C++ > >> > "`t Computer Group: " + $group.Name > >> > "`t ComputerTargetGroupId: " + $group.Id > >> > "`t Approval action: " + $update.GetUpdateApprovals($group)[0].Action > >> > > >> > $summary = $update.GetSummaryForComputerTargetGroup($group) > >> > > >> > "`t Installed:" + ($Summary.InstalledCount + > >> > $summary.NotApplicableCount) > >> > > >> > $neededCount = ($summary.InstalledPendingRebootCount + > >> > $summary.NotInstalledCount) > >> > if ($neededCount -gt 0) > >> > { > >> > Write-Host ("`t Needed: $neededCount") -foregroundColor Yellow > >> > -backgroundColor black > >> > } else { > >> > "`t Needed: $neededCount" > >> > } > >> > > >> > if ($summary.FailedCount -gt 0) > >> > { > >> > Write-Host ("`t Failed: " + $summary.FailedCount) -foregroundColor Red > >> > -backgroundColor black > >> > } else { > >> > "`t Failed: " + $summary.FailedCount > >> > } > >> > > >> > "`t Unknown: " + $summary.UnknownCount > >> > "`t ------------------------------------------" > >> > } > >> > } > >> > "--------------------------------------------------" > >> > } > >> > > >> > >> This looks like PowerShell, not VBScript. > >> > >> -- > >> urkec > > > Show quote
"WILDPACKET" <WILDPAC***@discussions.microsoft.com> wrote in message Best advice would be to read up on powershell and/or check out news:4ED8B4A7-DE80-4800-9CC7-4A81947ADD5C@microsoft.com... > > Al Thanks for your response. > > I installed the Powershell and renamed it to file.ps > I go to DOS prompt and type powershell and enter > > It changes the prompt to > > PS C:\> and then I type the file.ps and enter > and get this error ... > > The term 'file.ps' is not recognized as a cmdlet, function, operable > program, or script file. Verify the term and try again. > At line:1 char:18 > + file.ps <<<< > > Advise Please. microsoft.public.windows.powershell. Or you could try this command: powershell file.ps When you start powershell without a parameter, it expects you to type powershell commands interactively. /Al Show quote > > > > > > > > "Al Dunbar" wrote: > >> You will need to install powershell if it is not already installed. Then >> you >> will need to rename the file containing the script from whatever.vbs to >> whatever.ps. And if that does not do the trick, then I'd suggest you >> refer >> back to the introductory material found at the Script Centre. >> >> /Al >> >> "WILDPACKET" <WILDPAC***@discussions.microsoft.com> wrote in message >> news:905534C9-F422-47B7-9CDE-199E71507474@microsoft.com... >> > >> > Thank you urkec for your response. >> > How do I excute this script? >> > >> > >> > >> > "urkec" wrote: >> > >> >> "WILDPACKET" wrote: >> >> >> >> > >> >> > I found this on WSUS Site under Script Centre this >> >> > Provides a status report for approved updates. Every update approved >> >> > on >> >> > your >> >> > server is shown, with a list of the target groups for which it was >> >> > approved. >> >> > Within each group, counts are shown for how many computers have a >> >> > specific >> >> > status for that update: Installed, Needed, Failed, or Unknown. >> >> > >> >> > >> >> > >> >> > When I run this on the WSUS Server it gives me an error >> >> > >> >> > line 1 >> >> > character: 87. >> >> > Error: invalid character >> >> > code: 800A0408 >> >> > Source: Microsoft VBScript Compiling error >> >> > >> >> > >> >> > I am not the scripting guy. >> >> > >> >> > Anybody can advise Please. >> >> > >> >> > Thank you >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") >> >> > | out-null >> >> > if (!$wsus) { >> >> > $wsus = >> >> > [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); >> >> > } >> >> > >> >> > "Server name: " +$wsus.Name; >> >> > "Using secure connection: " + $wsus.IsConnectionSecureForRemoting; >> >> > "Port number: " + $wsus.PortNumber; >> >> > >> >> > $updateScope = new-object >> >> > Microsoft.UpdateServices.Administration.UpdateScope; >> >> > $updateScope.UpdateApprovalActions = >> >> > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Install >> >> > ` >> >> > -bor >> >> > [Microsoft.UpdateServices.Administration.UpdateApprovalActions]::Uninstall >> >> > >> >> > $wsus.GetUpdates($updateScope) | foreach { >> >> > $update = $_ #$_ is a shorthand variable for the current item in a >> >> > loop >> >> > >> >> > "--------------------------------------------------" >> >> > "Update: " + $update.Title >> >> > "Update Id: " + $update.Id.UpdateId >> >> > "--------------------------------------------------" >> >> > >> >> > $wsus.GetComputerTargetGroups() | foreach { >> >> > $group = $_ >> >> > if ($update.GetUpdateApprovals($group).Count -ne 0) >> >> > { >> >> > #`t is equivalent to \t in C#/C++ >> >> > "`t Computer Group: " + $group.Name >> >> > "`t ComputerTargetGroupId: " + $group.Id >> >> > "`t Approval action: " + >> >> > $update.GetUpdateApprovals($group)[0].Action >> >> > >> >> > $summary = $update.GetSummaryForComputerTargetGroup($group) >> >> > >> >> > "`t Installed:" + ($Summary.InstalledCount + >> >> > $summary.NotApplicableCount) >> >> > >> >> > $neededCount = ($summary.InstalledPendingRebootCount + >> >> > $summary.NotInstalledCount) >> >> > if ($neededCount -gt 0) >> >> > { >> >> > Write-Host ("`t Needed: $neededCount") -foregroundColor Yellow >> >> > -backgroundColor black >> >> > } else { >> >> > "`t Needed: $neededCount" >> >> > } >> >> > >> >> > if ($summary.FailedCount -gt 0) >> >> > { >> >> > Write-Host ("`t Failed: " + $summary.FailedCount) -foregroundColor >> >> > Red >> >> > -backgroundColor black >> >> > } else { >> >> > "`t Failed: " + $summary.FailedCount >> >> > } >> >> > >> >> > "`t Unknown: " + $summary.UnknownCount >> >> > "`t ------------------------------------------" >> >> > } >> >> > } >> >> > "--------------------------------------------------" >> >> > } >> >> > >> >> >> >> This looks like PowerShell, not VBScript. >> >> >> >> -- >> >> urkec >> >> >> |
|||||||||||||||||||||||