From: rnitro1 on
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
}
}

From: rnitro1 on


"rnitro1" wrote:

> 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
> }
> }
> I tried editing character 87 without any success
From: Al Dunbar on
"rnitro1" <rnitro1(a)discussions.microsoft.com> wrote in message
news:2AA6F98E-0DAA-4AFA-95D4-A0BA274BB02D(a)microsoft.com...
>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

>
>
> [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
> }
> }
>