Group:  English: General ยป microsoft.public.windows.powershell
Thread: why my script not working ?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

why my script not working ?
"IT Staff" <jkklim[ at ]hotmail.com> 13.07.2007 04:59:28
When i run my script in the cmd prompt, it gives the following error :

Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT:
0x80070
6BA)
At D:\PowerShell\scripts\kb.ps1:11 char:16
+ $checkkb = gwmi <<<< Win32_QuickFixEngineering -computer $computer |
where {
$_.hotfixid -eq $kb} | select-object hotfixid


============================================================

function CheckWMI ($computer,$kb)
{

$checkkb = gwmi Win32_QuickFixEngineering -computer $computer | where
{$_.hotfixid -eq $kb} | select-object hotfixid

if ($checkkb.hotfixid -eq $kb)

{ write-host -f green $computer "" $checkkb.hotfixid }

else

{ write-host -f red $computer " Not found."}

}

cls
$computernames = get-content "D:\POWERSHELL\SCRIPTS\COMPUTERS.txt"

foreach ($computer in $computernames)
{
$kb = "KB935839"
checkwmi($computer,$KB)
}



Re: why my script not working ?
Thomas Lee <tfl[ at ]psp.co.uk> 13.07.2007 05:12:57
In message <uOkYZqQxHHA.536[ at ]TK2MSFTNGP06.phx.gbl>, IT Staff
<jkklim[ at ]hotmail.com> writes
[Quoted Text]
>When i run my script in the cmd prompt, it gives the following error :
>
>Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT:
>0x80070
>6BA)
>At D:\PowerShell\scripts\kb.ps1:11 char:16
>+ $checkkb = gwmi <<<< Win32_QuickFixEngineering -computer $computer |
>where {
>$_.hotfixid -eq $kb} | select-object hotfixid

Hard to say without knowing more. Some things to look at include:


http://support.microsoft.com/kb/263607
http://msdn2.microsoft.com/en-us/library/aa389286.aspx
http://msdn2.microsoft.com/En-US/library/aa827355.aspx

HTH


Thomas
--
Thomas Lee
doctordns[ at ]gmail.com
MVP - Admin Frameworks and Security
Re: why my script not working ?
"IT Staff" <jkklim[ at ]hotmail.com> 13.07.2007 07:55:52
i thought i attached my scripts below ?


"Thomas Lee" <tfl[ at ]psp.co.uk> wrote in message
news:gWUwPiSZnwlGFAfW[ at ]mail.psp.co.uk...
[Quoted Text]
> In message <uOkYZqQxHHA.536[ at ]TK2MSFTNGP06.phx.gbl>, IT Staff
> <jkklim[ at ]hotmail.com> writes
>>When i run my script in the cmd prompt, it gives the following error :
>>
>>Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT:
>>0x80070
>>6BA)
>>At D:\PowerShell\scripts\kb.ps1:11 char:16
>>+ $checkkb = gwmi <<<< Win32_QuickFixEngineering -computer $computer |
>>where {
>>$_.hotfixid -eq $kb} | select-object hotfixid
>
> Hard to say without knowing more. Some things to look at include:
>
>
> http://support.microsoft.com/kb/263607
> http://msdn2.microsoft.com/en-us/library/aa389286.aspx
> http://msdn2.microsoft.com/En-US/library/aa827355.aspx
>
> HTH
>
>
> Thomas
> --
> Thomas Lee
> doctordns[ at ]gmail.com
> MVP - Admin Frameworks and Security


Re: why my script not working ?
Hal Rottenberg <halr9000[ at ]gmail.com> 13.07.2007 11:23:15
On Jul 13, 3:55 am, "IT Staff" <jkk...[ at ]hotmail.com> wrote:
[Quoted Text]
> i thought i attached my scripts below ?

> >>Get-WmiObject : The RPC server is unavailable. (Exception from

What he means is that the RPC error could be caused by almost anything
but it's a problem on the remote end, not a problem with your script.
Go ahead and try to use other RPC-related tools, or one of the many
WMI explorer tools or a vbscript, etc., they will probably all fail on
this same computer. However, it might work on a different computer,
or your local computer. If you want help with your powershell script
code, I'd run it against your local computer and see how that goes.
Otherwise I'd seek help in a more general Windows forum if you don't
know how to troubleshoot the RPC errors.

Re: why my script not working ?
Marco Shaw <marco.shaw[ at ]_NO_SPAM_gmail.com> 13.07.2007 12:08:54
IT Staff wrote:
[Quoted Text]
> When i run my script in the cmd prompt, it gives the following error :
>
> Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT:
> 0x80070
> 6BA)
> At D:\PowerShell\scripts\kb.ps1:11 char:16
> + $checkkb = gwmi <<<< Win32_QuickFixEngineering -computer $computer |
> where {
> $_.hotfixid -eq $kb} | select-object hotfixid

What exactly are you trying to query? Does it have a client side
firewall? Vista blocks RPC by default, for example.

Marco
RE: why my script not working ?
forestial 13.07.2007 13:14:07
I have seen that error code when the value of the -computer parameter is
incorrect (no computer with that name exists).

Since you have the computer name in a variable $computer, try a simple
ping $computer

and see if the name is resolved, machine exists, is reachable etc.

"IT Staff" wrote:

[Quoted Text]
> When i run my script in the cmd prompt, it gives the following error :
>
> Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT:
> 0x80070
> 6BA)
> At D:\PowerShell\scripts\kb.ps1:11 char:16
> + $checkkb = gwmi <<<< Win32_QuickFixEngineering -computer $computer |
> where {
> $_.hotfixid -eq $kb} | select-object hotfixid
>
>
> ============================================================
>
> function CheckWMI ($computer,$kb)
> {
>
> $checkkb = gwmi Win32_QuickFixEngineering -computer $computer | where
> {$_.hotfixid -eq $kb} | select-object hotfixid
>
> if ($checkkb.hotfixid -eq $kb)
>
> { write-host -f green $computer "" $checkkb.hotfixid }
>
> else
>
> { write-host -f red $computer " Not found."}
>
> }
>
> cls
> $computernames = get-content "D:\POWERSHELL\SCRIPTS\COMPUTERS.txt"
>
> foreach ($computer in $computernames)
> {
> $kb = "KB935839"
> checkwmi($computer,$KB)
> }
>
>
>
>
Re: why my script not working ?
Thomas Lee <tfl[ at ]psp.co.uk> 13.07.2007 19:42:25
In message <uRkXl2SxHHA.4476[ at ]TK2MSFTNGP06.phx.gbl>, IT Staff
<jkklim[ at ]hotmail.com> writes
[Quoted Text]
>i thought i attached my scripts below ?

You did - but they don't help much. We'd need to know waht machine you
are really looking at, and how it's setup.

I'd refer to the three articles I noted to see if they help. I suspect
the target system does not exist, the system has a firewall that blocks
access to WMI, the WMI servicde is not running, or you have invalid
credentials to that system.

Thomas

--
Thomas Lee
doctordns[ at ]gmail.com
MVP - Admin Frameworks and Security

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net