Specified Cast is not Valid

BatchPatch Forums Home Forums BatchPatch Support Forum Specified Cast is not Valid

  • This topic has 3 replies, 2 voices, and was last updated 10 years ago by doug.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9122
    scotthaigh
    Participant

    Getting the following error when trying to perform remote operations on certain workstations. This is from the batchpatch log when issuing a “Get Host Name” operation:

    *********

    Get Host Name

    Specified cast is not valid.

    All Messages

    Wed-10:52:28> Get host name: Specified cast is not valid.

    Wed-10:52:27> Get host name: Attempting to retrieve host name…

    Wed-10:52:22> Get Information Exit Code: -2147467262

    *********

    I’ve verified the following on the machines:

    – I can make manual psexec connections and perform other remote management functions

    – Firewall is turned off

    – System clock is properly synced

    – DNS/NetBIOS name is properly mapped to the correct IP address

    Any Ideas?

    #10961
    doug
    Moderator

    Hi Scott –

    What version of BatchPatch are you using?

    What OS are the target computers?

    Do other “Get information” queries work in BatchPatch without the error?

    What happens if you run the following command under “Remote Command (logged output)”

    WMIC PATH Win32_ComputerSystem GET name

    Thanks,

    Doug

    #10967
    scotthaigh
    Participant

    Running batchpatch version 2014.10.2.12.39

    Clients are all running Win7 Sp1 with latest patches.

    Running Microsoft Security Essentials for anti-virus

    None of the get information queries are working, but as I said, I can make manual psexec connections.

    Out of roughly 25 machines, only 3 or 4 are having this problem. Tried rebooting the machine but same issue. Here’s the logged output from your WMIC command, which was preceeded by a Get Information/Get Host attempt.

    Fri-19:23:05> Remote Command: Exit Code: -2147467262

    Fri-19:22:43> Remote Command: Executing \JX8FGF1 WMIC PATH Win32_ComputerSystem GET name Fri-19:22:42> Remote Command: Establishing connection…

    Fri-19:22:42> Remote Command 3: Queued…

    Fri-19:21:44> Get host name: Specified cast is not valid.

    Fri-19:21:43> Get host name: Attempting to retrieve host name…

    #10968
    doug
    Moderator

    Scott – Thanks for testing.

    I understand that you can make manual PsExec connections. PsExec is not the source of the problem here. The issue is actually WMI on those target computers. The reason I had you run WMIC PATH Win32_ComputerSystem GET name is because I wanted to see what would happen when running a direct WMI query on those machines. When BatchPatch runs “Get host name” is uses WMI but it does it remotely (not using PsExec). The WMIC command, however, gets run locally on the target through the use of PsExec. The fact that it returns -2147467262 (the same error as the original “Get host name” action in BatchPatch) indicates that WMI is the source of the problem. -2147467262 translates to “No such interface” and explains why we then see “Specified cast is not valid” because the WMI query is returning empty, and then BatchPatch fails to cast the retrieved object to the host name string because the object is empty. If you were curious you could take that same WMIC command from above and run it in a command prompt manually on one of the problematic machines. You’ll see that it returns an error, indicating the WMI is the source of the problem.

    All that said, this is not a BatchPatch issue. It’s an issue with WMI. Normally I would recommend simply restarting the WMI service on the target computers. However, since you said a reboot didn’t fix the issue, then a service start certainly isn’t going to do it. I wonder if perhaps a Windows Update you installed (or some other type of update) caused WMI corruption on those targets. Your next step should be to look into repairing WMI. Take a look at the following links as a starting point:

    https://social.technet.microsoft.com/Forums/windows/en-US/8ed26d46-9994-4052-a307-5b071805aea8/wmi-corrupt-how-to-reinstallrepair

    http://technet.microsoft.com/en-us/library/ff404265.aspx

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.