# RPC Server is unavailable 

**URL:** <https://forums.powershell.org/t/rpc-server-is-unavailable/2582>\
**Category:** PowerShell Help\
**Created:** [May 18, 2014, 4:46pm UTC](https://forums.powershell.org/t/rpc-server-is-unavailable/2582 "2014-05-18T16:46:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasun-rajapakse](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kasun-rajapakse/32/742_2.png) [@kasun-rajapakse](https://forums.powershell.org/u/kasun-rajapakse)\
**Post date:** [May 18, 2014, 4:46pm UTC](https://forums.powershell.org/t/rpc-server-is-unavailable/2582/1 "2014-05-18T16:46:57Z")

</div>

Hi,

This is the script i run

`$KRErrorLogPreferance = “E:\Education\BIT\MCSA\Powershell\CBT Tool Making Code”`

`
function Get-SystemInfo{
<#
.SYNOPSIS
Quieries critical information from a single computer
.DESCRIPTION
Quiries OS and the Hardware information from a single computer. This Utilize
WMI Objects,so appropriate WMI port must be open and you must be admin on the remort machine
.PARAMETER ComputerName
The computer name to query, accept multiple values and pipeline input
.PARAMETER IPAddress
Enter the IP Address to query, pipeline is not accepted
.EXAMPLE
Get-SystemInfo.ps1 -ComputerName WHATEVER
This will query infromation from the computer WHATEVER
.EXAMPLE
Get-SystemInfo.ps1 -ComputerName WHATEVER | Format-Table *
This will display the information as a table
```
#&gt;

[CmdletBinding()]

Param(
[Parameter(Mandatory=$True,
           ValueFromPipeline=$True,
           ParameterSetName='computername',
           ValueFromPipelineByPropertyName=$True, 
           HelpMessage="Enter the computer name to qury WMI object")]
[Alias('hostname')]
[ValidateLength(4,15)]
[string[]]$ComputerName,

[Parameter(Mandatory=$True,
           HelpMessage="Enter the IP Address to query WMI Object",
           ParameterSetName='ip')]
[ValidatePattern('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')]
[string[]]$IPAddress,

[Parameter()]
[string]$ErrorLogFilePath =$KRErrorLogPreferance
)

BEGIN{
    if($PSBoundParameters.ContainsKey('ipaddress')){
        $ComputerName=$IPAddress
    }
}

PROCESS{
    
    foreach($computer in $ComputerName){
        
        Write-Verbose "Connecting via WMI $computer"

        $os=Get-WmiObject win32_OperatingSystem -ComputerName $computer
        $cs=Get-WmiObject win32_computerSystem -ComputerName $computer

        Write-Verbose "Finished with WMI building output"

        $props =@{'ComputerName'=$computer;
                  'OSVersion'= $os.version;
                  'OSBuild'=$os.BuildNumber;
                  'SPVersion'=$os.ServicePackMajorVersion;
                  'Model'=$cs.Model;
                  'Manufacture'=$cs.Manufacturer;
                  'RAM'=$cs.TotalPhysicalMemory / 1GB -as [int]
                  'Sockets'=$cs.NumberOfProcessors;
                  'Cores'=$cs.NumberOfLogicalProcessors
                  }

        $obj = New-Object -TypeName PSObject -Property $props

        Write-Verbose "Outputing to pipeline "

        Write-Output $obj

    }
}

END{}

```
}
`

`#Get-SystemInfo -ComputerName localhost
#‘kasunrajapakse’,‘localhost’,‘kasunrajapakse’ | Get-SystemInfo
#Import-Csv -Path ‘E:\Education\BIT\MCSA\PowerShell\CBT Tool Making Code\computers.csv’ | Get-SystemInfo
Get-SystemInfo -IPAddress 127.0.0.0.1 -Verbose`

When i run it using ipaddress parameter it gives me the following error

**Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)  
At line:57 char:17**

 
 **-** 

**```
        $os=Get-WmiObject win32_OperatingSystem -ComputerName $computer**

**```**

 -  

**```
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **

**```**

 
   **- CategoryInfo : InvalidOperation: (🙂 [Get-WmiObject], COMException**
   - **FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand**  
 

Please help me !!!

---

<div class="post-metadata">

**Author:** ![daniel-krebs](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/daniel-krebs/32/484_2.png) [@daniel-krebs](https://forums.powershell.org/u/daniel-krebs)\
**Post date:** [May 18, 2014, 5:31pm UTC](https://forums.powershell.org/t/rpc-server-is-unavailable/2582/2 "2014-05-18T17:31:53Z")

</div>

The IP address 127.0.0.0.1 you’ve provided is not valid. One .0 octet too much.

Try again with:  
Get-SystemInfo -IPAddress 127.0.0.1 -Verbose

Verify “localhost” address:  
ping -4 localhost

---

<div class="post-metadata">

**Author:** ![kasun-rajapakse](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kasun-rajapakse/32/742_2.png) [@kasun-rajapakse](https://forums.powershell.org/u/kasun-rajapakse)\
**Post date:** [May 18, 2014, 6:21pm UTC](https://forums.powershell.org/t/rpc-server-is-unavailable/2582/3 "2014-05-18T18:21:23Z")

</div>

oh i see it thanks for pointing it to me 🙂

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:52pm UTC](https://forums.powershell.org/t/rpc-server-is-unavailable/2582/4 "2024-05-16T20:52:02Z")

</div>


