You are using the -ComputerName parameter, aren't you?

This is what I do:

                              $error.Clear()
                              $results = Invoke-Command -ConnectionUri 
$winRMuri -ScriptBlock {
                                             Param( $timestamp )

                                             $hash = @{}
                                             $hash.LogName      = 'System'
                                             $hash.StartTime    = $timestamp
                                             $hash.ID           = 6009
                                             $hash.ProviderName = 'EventLog'

                                             $error.Clear()
                                             Get-WinEvent -FilterHashTable 
$hash -ErrorAction SilentlyContinue
                                             if( $error.Count -gt 0 )
                                             {
                                                            $e = $error[ 0 ]
                                                            Write-Host   
$e.ToString()
                                                            Write-Output 
$e.ToString()
                                                            throw $e
                                             }
                              } -ArgumentList $timeStamp -Credential 
$vmCredential -ErrorAction SilentlyContinue
                              if( !$? )
                              .....

You'll need to do something similar.

From: [email protected] [mailto:[email protected]] On 
Behalf Of Webster
Sent: Tuesday, March 1, 2016 12:31 PM
To: [email protected]
Subject: [powershell] Question on using Get-EventLog for WMI errors

Server 2008 R2 still on V2. Needing to query 389 servers for WMI error 10. I 
can see the error in the Application event log:

[cid:[email protected]]

When I use Get-EventLog, this is what I get for that specific event:

1371838 Mar 01 05:57  0           WinMgmt                3221231089 The 
description for Event ID '-1073736207' in Source 'WinMgmt' cannot be found.  
The local computer may not have the necessary registry information or message 
DLL files to display the message, or you may not have permission to access 
them.  The following information is part of the event:

I am logged in as the local admin on the server so it should not be a 
permissions issue. Is this just a known issue with Get-EventLog or is there 
something else I should doing or using?

Every WinMgmt event retrieved using Get-EventLog returns the same basic message 
"the description for the event cannot be found". Kind of useless info for 
finding the real error. Also, why in the Application event log is the Event ID 
10 but the cmdlet returns 3221231089?

Thanks


Carl Webster
Citrix Technology Professional
http://www.CarlWebster.com<http://t.sidekickopen01.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJN7t5XYgdV8QRW2zWLDn4XrdjzW7fK3rs56dwxZf67wwsR02?t=http%3A%2F%2Fwww.carlwebster.com%2F&si=6012126861197312&pi=4311b7b1-332d-4242-8585-36954b184dc7>
The Accidental Citrix Admin


================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1


================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1

Reply via email to