External Parameter (Powershell)

Started by ITR, May 05, 2015, 04:19:35 PM

Previous topic - Next topic

ITR

Hi,

is it possible to use the Exchange 2013 powershell commands?
The normal powershell commands are working, but the module/snapins are not imported into the normal powershell - is it possible?

I want to monitor an DAG and i need this commands from the Exchange powershell module:

for example:

Get-MailboxDatabaseCopyStatus | fl -Property Status

Thx,
Didi

Alex Kirhenshtein

You can try to create ps1 script like this:

add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
Get-MailboxDatabaseCopyStatus | fl -Property Status

ITR

#2
Hi Alex,

thx for the hint its working.

For all others:


Raise the timeout for Server AgentCommandTimeOut and on Agent ExecTimeout (PSSnapIn needs to load a few seconds) (defaults are: 2000 on agent and 4000 on server)

Server Configuration:

AgentCommandTimeOut = 20000

Agent Configuration (for example):

ExecTimeout = 20000
ExternalParameter = DAG2013Healthstatus.status:"C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" "C:\Scripts\Get-MailboxDatabaseCopyStatus.ps1"

Content of PS1

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
Get-MailboxDatabaseCopyStatus | fl -Property Status

Thx

Alex Kirhenshtein

I suggest you to change it from ExternalParameter to ExternalParameterProvider, this way data collection will work faster.
Detailed description: https://wiki.netxms.org/wiki/ExternalParametersProvider

ITR

OK i try this.

Is it possible to do a treshold with an OR connection - because i get:

Server 1: Status : Mounted
Server 2: Status : Healthy

Ive created 2 Tresholds not equal "Status : Mounted" and not equal "Status : Healthy" and clicked "process all tresholds" but it dont seem that this works

Thx

Victor Kirhenshtein

Hi,

you can use script for threshold checking.

Best regards,
Victor