Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

HP Full Audit

$
0
0

Hi,

I've been playing around with a script that audits HP equipment i've been amending the script to get details of what i want and i'm trying to get an audit of the mailboxes and size but it's coming up with the following

PS C:\SystemReport> Get-HPServerHealth -ComputerName emailserver -IncludeExchangeMailbox
WARNING: HP Server Health: emailserver: The term 'Get-Mailbox' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.

I was wondering what i was doing wrong here is the script sorry it's quite big.   

						function LoadExchangeTools {

if (!(Get-pssnapin | ? {$_.name -like 'Microsoft.Exchange*'})) {
		$Reg = Get-PSSnapin -Registered | ? {$_.name -like 'Microsoft.Exchange*'}
		IF ($Reg | ? {$_.name -like '*e2010'}){
			Add-PSSnapin Microsoft.Exchange.Management.PowerShell.e2010
			}
		ElseIf($Reg | ? {$_.name -like '*Admin'}){
			Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
		}
	}
Else{
		"Exchange modules were not detected"
	}
}

						                        #region HBA
                        if ($IncludeExchangeMailbox)
                        {
                              LoadExchangeTools 
                            Write-Verbose -Message ('Exchange Health: Runspace {0}: HP Mailbox information' -f 'emailserver')
                            $WMI_MailboxProps = @('DisplayName','TotalItemSize')
                            $wmi_Mailbox = @(Get-Mailbox -ResultSize Unlimited | Get-mailboxstatistics | `
                                       Select $WMI_MailboxProps)
                            $_MailboxHealth = @()
                            foreach ($Mailbox in $wmi_Mailbox)
                            {
                                $MailboxProp = @{
                                    'DisplayName' = $Mailbox.DisplayName
									'TotaltemSize' = $Mailbox.TotalItemSize
                                }
                                $_MailboxHealth += New-Object PSObject -Property $MailboxProp
                            }
                            $ResultProperty._MailboxHealth = $_MailboxHealth
                        }
                        #endregion HBA


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>