Support Forums

Search found 10021 matches

by jvierra
Thu Dec 01, 2016 1:08 pm
Forum: Windows PowerShell
Topic: Need to send an email when MessageCount is greater than $threshold
Replies: 8
Views: 56

Re: Need to send an email when MessageCount is greater than $threshold

I posted the solution. What is it not doing or what is the error.

DO you understand what Get-Queue does?

Play with this to get an idea.

$queue = Get-Queue -Server $server -filter {NextHopDomain -eq 'bjsonline.mail.onmicrosoft.com' }
$queue.MessageCount
by jvierra
Thu Dec 01, 2016 12:29 pm
Forum: Windows PowerShell
Topic: Need to send an email when MessageCount is greater than $threshold
Replies: 8
Views: 56

Re: Need to send an email when MessageCount is greater than $threshold

No. What the code does is test if any server meets the filter criteria. If it does then the queue threshold is exceeded. If the queue is not exceeded the results will be null. $null is false in PowerShell.
by jvierra
Thu Dec 01, 2016 12:08 pm
Forum: Windows PowerShell
Topic: Need to send an email when MessageCount is greater than $threshold
Replies: 8
Views: 56

Re: Need to send an email when MessageCount is greater than $threshold

This is a better way to state this:

Code: Select all

$found = Get-Queue -Server $server -filter {MessageCount -gt $threshold -and NextHopDomain -eq 'bjsonline.mail.onmicrosoft.com' }
if($found){
# code to execute
}
by jvierra
Thu Dec 01, 2016 12:04 pm
Forum: Windows PowerShell
Topic: Need to send an email when MessageCount is greater than $threshold
Replies: 8
Views: 56

Re: Need to send an email when MessageCount is greater than $threshold

You asked about the IF statement. I do not understand what the rest of you code is intending to do.

Maybe this is what you are trying to do???

$servers = get-queue -Server $server | ?{ $_.MessageCount -gt $threshold -and $_.NextHopDomain -eq 'bjsonline.mail.onmicrosoft.com' }
if($servers){
by jvierra
Wed Nov 30, 2016 1:01 pm
Forum: PowerShell GUIs
Topic: Web forms using PowerShell
Replies: 1
Views: 15

Re: Web forms using PowerShell

There is not tool I know of to create websites with PowerShell. You can generate HTML and use the "WebAdminstration" module but no tools for creating web sites.

PowerShell is not an application development tool. It is an administrative scripting tool.
by jvierra
Wed Nov 30, 2016 12:39 pm
Forum: PowerShell GUIs
Topic: Export All Output Windows Text to File
Replies: 3
Views: 23

Re: Export All Output Windows Text to File

Marcboi wrote:Can I have a powershell window open to execute my script after pressing my OK button then?


I don't see why not or what it has to do with output to a file.
by jvierra
Wed Nov 30, 2016 12:35 pm
Forum: PowerShell GUIs
Topic: Code example for controls
Replies: 4
Views: 21

Re: Code example for controls

A MenuStrip does not have a button.
A MenuButton is a custom control set.

The top panel is a good place to search for help.

Use MSDN Help section for help with MenuStrip and other Microsoft controls that have no "Spotlight" article..
by jvierra
Wed Nov 30, 2016 11:24 am
Forum: PowerShell GUIs
Topic: Code example for controls
Replies: 4
Views: 21

Re: Code example for controls

When you add a menu you can add items. Just type in the name. TO access the click event double click the item in the designer and it will create the event for that item.

Be sure to review all of the items in David's post as it will save you time later and help you to approach a design more easily.
by jvierra
Wed Nov 30, 2016 10:38 am
Forum: PowerShell GUIs
Topic: Button Start-Job image
Replies: 5
Views: 47

Re: Button Start-Job image

Use the "Button -StartJob" custom control. It has an animated button.

Go to advanced search