locked
Exch2k7 - PS script running with error 0x800706BA RRS feed

  • Question

  • Hi,

    I´m connected to our Exch2k7 server and trying to run the script downloaded for check database sizes, but it returns an error like 'RPC server unavailable'. My server is W2k3 64x without Windows Firewall or AV Firewall.

    Below is the command and error.

    .

    [PS] C:\temp>.\Get-MailboxDatabaseStats.ps1
    
    Security Warning
    Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your
    computer. Do you want to run C:\temp\Get-MailboxDatabaseStats.ps1?
    [D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): r
    Exception calling "Open" with "1" argument(s): "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)"
    At C:\temp\Get-MailboxDatabaseStats.ps1:86 char:12
    +         $Clu.Open <<<< ($server.Name)
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : ComMethodTargetInvocation
    
    You cannot call a method on a null-valued expression.
    At C:\temp\Get-MailboxDatabaseStats.ps1:87 char:41
    +         $groupOwner = $Clu.ResourceGroups.Item <<<< ($server.Name).OwnerNode.Name
        + CategoryInfo          : InvalidOperation: (Item:String) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    
    Get-WmiObject : The type initializer for 'System.Management.MTAHelper' threw an exception.
    At C:\temp\Get-MailboxDatabaseStats.ps1:99 char:36
    +         $databaseSize_GB = (Get-WmiObject <<<<  cim_datafile -ComputerName $databaseName.server `
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], TypeInitializationException
        + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
    
    
    
    MailboxDatabase   : MAILSERVER\First Storage Group\Mailbox Database
    MailboxCount      : 13
    DatabaseSize_GB   :
    LogFileSize_MB    : 0,00
    AvgMailboxSize_MB : 0,00
    
    Get-WmiObject : The type initializer for 'System.Management.MTAHelper' threw an exception.
    At C:\temp\Get-MailboxDatabaseStats.ps1:99 char:36
    +         $databaseSize_GB = (Get-WmiObject <<<<  cim_datafile -ComputerName $databaseName.server `
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], TypeInitializationException
        + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
    
    MailboxDatabase   : MAILSERVER\STGITUPEVA\MBXITUPEVA
    MailboxCount      : 23
    DatabaseSize_GB   :
    LogFileSize_MB    : 0,00
    AvgMailboxSize_MB : 0,00
    
    Get-WmiObject : The type initializer for 'System.Management.MTAHelper' threw an exception.
    At C:\temp\Get-MailboxDatabaseStats.ps1:99 char:36
    +         $databaseSize_GB = (Get-WmiObject <<<<  cim_datafile -ComputerName $databaseName.server `
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], TypeInitializationException
        + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
    
    MailboxDatabase   : MAILSERVER\STGCURITIBA\MBXCURITIBA
    MailboxCount      : 16
    DatabaseSize_GB   :
    LogFileSize_MB    : 0,00
    AvgMailboxSize_MB : 0,00
    
    Get-WmiObject : The type initializer for 'System.Management.MTAHelper' threw an exception.
    At C:\temp\Get-MailboxDatabaseStats.ps1:99 char:36
    +         $databaseSize_GB = (Get-WmiObject <<<<  cim_datafile -ComputerName $databaseName.server `
        + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], TypeInitializationException
        + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
    
    MailboxDatabase   : MAILSERVER\STGMATRIZ\MBXMATRIZ
    MailboxCount      : 112
    DatabaseSize_GB   :
    LogFileSize_MB    : 0,00
    AvgMailboxSize_MB : 0,00

    >>> The script: Get mailbox sizes (http://gallery.technet.microsoft.com/scriptcenter/5a92dc56-0e95-48a5-a5a2-50eeb467d35c)


    tks, Renato P




    • Edited by jr3151006 Saturday, August 18, 2012 6:05 PM update info
    Saturday, August 18, 2012 4:10 PM

Answers

  • On Tue, 21 Aug 2012 14:08:10 +0000, jr3151006 wrote:
     
    >
    >
    >Rich,
    >
    >you was right, I post a wrong link to script, the correct is:
    >
    >http://gallery.technet.microsoft.com/scriptcenter/Get-mailbox-database-size-ac8609b9
     
    This may help:
    http://blogs.msdn.com/b/alejacma/archive/2010/10/20/get-wmiobject-the-type-initializer-for-system-management-mtahelper-threw-an-exception.aspx
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    • Marked as answer by jr3151006 Wednesday, August 22, 2012 6:22 PM
    Tuesday, August 21, 2012 7:51 PM

All replies

  • On Sat, 18 Aug 2012 16:10:36 +0000, jr3151006 wrote:
     
    >I´m connected to our Exch2k7 server and trying to run the script downloaded for check database sizes, but it returns an error like 'RPC server unavailable'. My server is W2k3 64x without Windows Firewall or AV Firewall.
    >
    >Below is the command and error.
     
    [ snip ]
     
    >>>> The script: Get mailbox sizes (http://gallery.technet.microsoft.com/scriptcenter/5a92dc56-0e95-48a5-a5a2-50eeb467d35c)
     
    The script at that URL only has 17 lines. The errors are onlines 86
    and 99. Obviously you're running a script quite different to the one
    at that URL (the entire script is below):
     
    #get all the servers
    get-mailboxserver MailServer* |
     
    #get all the mail boxes
    Get-Mailbox -ResultSize Unlimited |
     
    #get mail box stat
    Get-MailboxStatistics |
     
    #select ones that are over 500MB
    Where {$_.TotalItemSize -gt 500MB} |
     
    #Select objects, create a convert to MB, create a convert to GB
    Select-Object DisplayName, ItemCount, TotalItemSize,
    TotalDeletedItemSize, @{label="Total Size
    (MB)";expression={$_.TotalItemSize.Value.ToMB()}}, @{label="Total Size
    (GB)";expression={$_.TotalItemSize.Value.ToGB()}}, StorageLimitStatus,
    Database
     
    #Select File to export to...
    | Export-Csv All_users_mailbox_size.csv
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Saturday, August 18, 2012 9:06 PM
  • Hi

    Did you follow what Rich said?

    I research the error message “the RPC server is unavailable. (Exception from HRESULT:0x800706BA). And Found it is caused by IM/GP crash.

    So in order to resolve this error message, exit out of GP and Integration Manager.  Then make sure there are no are no Dynamics.exe process still running in the Task Manager under the Processes tab.  Restart IM and GP then run the integration. 

    If the integration still hangs, I would like you to do a repair on IM and GP.
    1. By going to Start | Control Panel | Add or Remove Programs (Programs and Features)
    2. Right click on Integration Manager for Microsoft Dynamics and click change
    3. Click Repair
    4. Click Next and allow it to process
    5. Do the same for Microsoft Dynamics GP 2010

    Hope it helps

    Cheers


    Zi Feng

    TechNet Community Support

    Tuesday, August 21, 2012 6:47 AM
  • Rich,

    you was right, I post a wrong link to script, the correct is:

    http://gallery.technet.microsoft.com/scriptcenter/Get-mailbox-database-size-ac8609b9


    tks, Renato P

    Tuesday, August 21, 2012 2:08 PM
  • Zi,

    what you means 'IM/GP'???

    We dont have installed the ' Integration Manager for Microsoft Dynamics'.



    tks, Renato P

    Tuesday, August 21, 2012 2:17 PM
  • On Tue, 21 Aug 2012 14:08:10 +0000, jr3151006 wrote:
     
    >
    >
    >Rich,
    >
    >you was right, I post a wrong link to script, the correct is:
    >
    >http://gallery.technet.microsoft.com/scriptcenter/Get-mailbox-database-size-ac8609b9
     
    This may help:
    http://blogs.msdn.com/b/alejacma/archive/2010/10/20/get-wmiobject-the-type-initializer-for-system-management-mtahelper-threw-an-exception.aspx
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    • Marked as answer by jr3151006 Wednesday, August 22, 2012 6:22 PM
    Tuesday, August 21, 2012 7:51 PM
  • Hi Rich,

    probably that issue is related with .Net for that server but we should debug the PS session to confirm. Since that server will be replaced, right now doesn´t matter the error.

    Even so, tks lot!

    tks, Renato P

    Wednesday, August 22, 2012 6:21 PM