Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - WSUS List Computers that Need to Reboot

Reply
 
Old 11-28-2008   #1 (permalink)
rnitro1


 
 

WSUS List Computers that Need to Reboot

I receive an Error invalid character, Line 1 Char: 87 Code 800A0408 when
running the following Vbscript from microsoft. Does anyone know which
character is invalad?


[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null

if (!$wsus) {
$wsus =
[Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
}

$computerScope = new-object
Microsoft.UpdateServices.Administration.ComputerTargetScope;
$computerScope.IncludedInstallationStates =
[Microsoft.UpdateServices.Administration.UpdateInstallationStates]::InstalledPendingReboot;

$updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope;
$updateScope.IncludedInstallationStates =
[Microsoft.UpdateServices.Administration.UpdateInstallationStates]::InstalledPendingReboot;

$computers = $wsus.GetComputerTargets($computerScope);

$computers | foreach-object {
$_.FullDomainName | write-host;

# Show which updates are causing the reboot required for the
computer. Remove the next 5 lines to only generate a list of computers.
$updatesForReboot =
$_.GetUpdateInstallationInfoPerUpdate($updateScope);
$updatesForReboot | foreach-object {
$neededUpdate = $wsus.GetUpdate($_.UpdateId);
" "+$neededUpdate.Title | write-host;
# Remove previous lines to only show computers that need
updates
}
}


My System SpecsSystem Spec
Old 11-29-2008   #2 (permalink)
Al Dunbar


 
 

Re: WSUS List Computers that Need to Reboot

"rnitro1" <rnitro1@xxxxxx> wrote in message
news:2AA6F98E-0DAA-4AFA-95D4-A0BA274BB02D@xxxxxx
Quote:

>I receive an Error invalid character, Line 1 Char: 87 Code 800A0408 when
> running the following Vbscript from microsoft. Does anyone know which
> character is invalad?
The "|" is the invalid character in your vbscript, but more troubling is the
fact that this code is not vbscript at all, but appears to be powershell.
Try renaming the script file from *.vbs to *.ps1 and see if it works then.

/Al
Quote:

>
>
> [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
> | out-null
>
> if (!$wsus) {
> $wsus =
> [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
> }
>
> $computerScope = new-object
> Microsoft.UpdateServices.Administration.ComputerTargetScope;
> $computerScope.IncludedInstallationStates =
> [Microsoft.UpdateServices.Administration.UpdateInstallationStates]::InstalledPendingReboot;
>
> $updateScope = new-object
> Microsoft.UpdateServices.Administration.UpdateScope;
> $updateScope.IncludedInstallationStates =
> [Microsoft.UpdateServices.Administration.UpdateInstallationStates]::InstalledPendingReboot;
>
> $computers = $wsus.GetComputerTargets($computerScope);
>
> $computers | foreach-object {
> $_.FullDomainName | write-host;
>
> # Show which updates are causing the reboot required for
> the
> computer. Remove the next 5 lines to only generate a list of computers.
> $updatesForReboot =
> $_.GetUpdateInstallationInfoPerUpdate($updateScope);
> $updatesForReboot | foreach-object {
> $neededUpdate = $wsus.GetUpdate($_.UpdateId);
> " "+$neededUpdate.Title | write-host;
> # Remove previous lines to only show computers that need
> updates
> }
> }
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Finding members of RDP groups of a list of computers VB Script
Search text file and list computers which belong under same headin VB Script
retrieve all workgroup computers list PowerShell
List Computers on the domain and the last user that is logged on this. VB Script
Re: IT'S HERE - WSUS SP1 Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46