PrimalForm and Exchange Management Console

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
This topic is 14 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
bobczys01
Posts: 3
Last visit: Mon Oct 12, 2009 3:14 am

PrimalForm and Exchange Management Console

Post by bobczys01 »

Can PrimalForm be used to execute Exchange management Console cmdlets like get-contact? I have 32-bit EMC install on Win XP Pro and can succesfully run simple cmdlets like get-contact at the command prompt. If this is possible, where can I find documentation or an example of adding this functionality to PrimalForm? Thanks for the help.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

PrimalForm and Exchange Management Console

Post by davidc »

PrimalForms will automatically detect a snapin when you use the Add-PSSnapin command. As long as the snapin in registered and 32bits, PrimalForms should detect it.
Thank you,
David
David
SAPIEN Technologies, Inc.
User avatar
aka@mvps.org
Posts: 3
Last visit: Fri Dec 18, 2009 1:01 am

PrimalForm and Exchange Management Console

Post by aka@mvps.org »

If you haven't done this before, you'll want to do the snap-in loading David mentions within the OnApplicationLoad function in a form's script. There's a #TODO comment that specifically reminds you that you want to add the snap-ins there, but it's easy to overlook if you've already got a lot of functions in the script due to event handlers or custom code.
User avatar
bobczys01
Posts: 3
Last visit: Mon Oct 12, 2009 3:14 am

PrimalForm and Exchange Management Console

Post by bobczys01 »

Thank you. That was very helpful. I was able to run get-contact and fill a drop-down list with contact names. However, there is one peculiarity. As a result of calling get-contact a secondary window pops that looks like an empty progress bar. If I call get-contact twice I get two of these. The title says, "Completed". Have I missed something in adding the snap-in? Is there an assembly that should be added?
Here is all of the simple code that runs:
function OnApplicationLoad { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin return $true}
function OnApplicationExit { Remove-PSSnapIn Microsoft.Exchange.Management.PowerShell.Admin}
$handler_button1_Click={ $contactList = Get-Contact -sortBy displayName ForEach ($contact in $contactList) { $cbNames.Items.Add($contact.displayname) } $cbNames.SelectedIndex = 1}



User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

PrimalForm and Exchange Management Console

Post by davidc »

The progress bar is generated by the snapin and not by PrimalForms.You will have to contact the snapin vender in regards to the popup.
David
David
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

PrimalForm and Exchange Management Console

Post by Alexander Riedel »

It could be that this is created by the internal powershell host. I will check on that.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Xenophane
Posts: 29
Last visit: Wed Feb 03, 2021 3:59 am

PrimalForm and Exchange Management Console

Post by Xenophane »

I am seeing the Completed box as well, have mostly noticed it when I am using the Exchange mgmt tools
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

PrimalForm and Exchange Management Console

Post by Alexander Riedel »

I have verified that this dialog is not caused by anything we are doing. I would suggest posting in a Microsoft forum to determine what the cause of this dialog is and how it can be avoided.
We have little to no contact with the Exchange team,
but I will try to find someone from our end.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
bobczys01
Posts: 3
Last visit: Mon Oct 12, 2009 3:14 am

PrimalForm and Exchange Management Console

Post by bobczys01 »

Thank you for trying to find someone. In the meantime, is there a way to get a list of visible (and/or hidden) forms? Maybe I can get around the problem by trying to close the dialog in the code. Or should I post this question elsewhere?
User avatar
Xenophane
Posts: 29
Last visit: Wed Feb 03, 2021 3:59 am

PrimalForm and Exchange Management Console

Post by Xenophane »

I have just been testing this when I am filling a Gridview, and I see the the same "completed box" when I execute the script in PrimalForms or if I package it into an .Exe file using PrimalForms.But if I copy the script source code into PowerGUI, or execute it directly in the shell, I do not see the "Completed box"
This topic is 14 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.