none
RPC Server unavailable error when script is started via batch file

    Question

  • At the beginning some words about the setup:

    In a domain environement there is a powershell script on the server to clear eventlogs at the clients. The script is called in an batch file:# powershell.exe "D:\Scripts\Script.ps1 -AD -Clear" # the argument -AD tells the ps script to process all Computers in the ActiveDirectory, the -Clear argument tells the script to clear the eventlogs. The powershell scripts cycles through all computers in AD, tries to ping them and if computer is alive it determines the OS Version and then tries to clear the eventlog.

    At one single computer in the whole domain the script errors at the following line:

    $OSVersion = GWMI Win32_OperatingSystem -Comp $Computer

    With an Error RPC Server unavailable HResult: 0x800706BA

    When i launch the cmdlet in the powershell commandline it works without an error. The error only shows up with a single computer and only when the powershell script is startet from a batch.

    Regards, Thomas 

     

    Sunday, February 20, 2011 6:38 PM

Answers

  • Hi,

     

     

    Please enable the following firewall rules on the destined machine to check whether your code becomes to work.

     

    Remote Administration (RPC)

     

    Remote Administration (RPC-EPMAP)

     

     

    Thanks.

    Tuesday, February 22, 2011 8:03 AM