RPC server unavailable - win7

nemmi69

Well-known Member
Joined
Mar 15, 2012
Messages
938
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
I am running the following code to check if certain programs are running.

Code:
[COLOR=#242729][FONT=Consolas]##This Script is for checking status of 3 processes TestMgr.exe, iTestConsole.exe and tdefine.exe in all testBed machines[/FONT][/COLOR]
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">##Machine TestBed name and IP needs to be provided from a seperate text file TestBeds.txt. Should be put in same directory
#[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Output]#Output[/URL]  would go to a CSV file testBedProcessReport.csv in the same directory


#[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=function]#function[/URL]  assign is to assign status to various processes involved
function assign($process){

if($process -eq $null){return $creds}
elseif($process.count -eq $null){return "Running"}
else {return "cannot be determined"}

}

#[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=getting]#getting[/URL]  data from external sheet with test bed and IP details
$allTestBeds = Get-Content \\gal71810.fs1.util.jlrint.com\powertrain\PT\PT-8\PT-83\PT-833\Shared\TestbedTools\Gaydon\ASAPMaster\Testbeds.txt
[psobject[]]$testBedStatus = "" 
$all_process = ""
$creds = Get-Credential

#[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=looping]#looping[/URL]  all test bed details to check process status
foreach($testBed in $allTestBeds){

$temp = $testBed -split "="
$testBedName = $temp[0] + ""
$computerIP  = $temp[1]


$status = New-Object -TypeName psobject
Add-Member -InputObject $status -MemberType NoteProperty -Name TBName -Value $testBedName
Add-Member -InputObject $status -MemberType NoteProperty -Name TestMgr -Value "Running"
Add-Member -InputObject $status -MemberType NoteProperty -Name iTestConsole -Value "Running"
Add-Member -InputObject $status -MemberType NoteProperty -Name Tdefine -Value "Running"

#[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=getting]#getting[/URL]  all process details by connecting to WMI service
$all_process = Get-WmiObject -Class Win32_Process -ComputerName $computerIP -Credential $creds 

If($all_process -eq $null){
continue;
}

#[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Unique]#Unique[/URL]  is used in case same exe is running many instances
$TestMgr        = $all_process | where-object{$_.path -like "*TestMgr.exe*"} | select path -Unique
$status.TestMgr = assign($TestMgr)

$iTestConsole        = $all_process | where-object{$_.path -like "*iTestConsole.exe*"} | select path -Unique
$status.iTestConsole = assign($iTestConsole)

$tdefine     = $all_process | where-object{$_.path -like "*tdefine.exe*"} | select path -Unique
$status.tdefine = assign($tdefine)

$testBedStatus = $testBedStatus + $status

}
 </code>[COLOR=#242729][FONT=Consolas]$testBedStatus | out-file \\gal71810.fs1.util.jlrint.com\powertrain\PT\PT-8\PT-83\PT-833\Shared\TestbedTools\Gaydon\ASAPMaster\TestBedStatus.csv[/FONT][/COLOR]


The error is "The RPC server is unavailable. <exception from="" hresult:="" 0x800706ba="">

On another PC that is doing exactly the same job this works without fault.
I know the IP is OK as I can open file explorer and using the IP see the shared directories. Also the IP is pingable. Checked with nslookup that the IP returns the correct host name and the host name returns the correct IP.
I have checked the firewall and it is OK
I have checked services.msc and made sure that the RPC WMI services are running.
I have checked the registry values I have checked Internet connection and its protocols</exception>

Have about run out of ideas
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,214,551
Messages
6,120,156
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top