PrimalForm and Exchange Management Console
PrimalForm and Exchange Management Console
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.
PrimalForm and Exchange Management Console
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
Thank you,
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- aka@mvps.org
- Posts: 3
- Last visit: Fri Dec 18, 2009 1:01 am
PrimalForm and Exchange Management Console
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.
PrimalForm and Exchange Management Console
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}
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}
PrimalForm and Exchange Management Console
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
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
PrimalForm and Exchange Management Console
It could be that this is created by the internal powershell host. I will check on that.
Alex
Alex
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
PrimalForm and Exchange Management Console
I am seeing the Completed box as well, have mostly noticed it when I am using the Exchange mgmt tools
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
PrimalForm and Exchange Management Console
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
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.
SAPIEN Technologies, Inc.
PrimalForm and Exchange Management Console
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?
PrimalForm and Exchange Management Console
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"