can not use powershell to execute Mailenable commands

Discussion regarding the Standard version.
Post Reply
hunguyen
Posts: 2
Joined: Wed Mar 18, 2020 3:05 pm

can not use powershell to execute Mailenable commands

Post by hunguyen »

Hi,

I am not able to execute Add-PSSnapin MailEnable.Provision.Command. It returned an invalideArgument error. See below.
I am using the Mailenable standard edition version 10.23

Get-PSSnapin -Registered command return nothing.

I can run the mailEnable management console. The add/remove snap-ins show "MailEnable Management" is listed in selected snap-ins under Console Root

What can I do to get around this problem?

Thanks,

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\admin> Add-PSSnapin MailEnable.Provision.Command
Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.
At line:1 char:1
+ Add-PSSnapin MailEnable.Provision.Command
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (MailEnable.Provision.Command:String) [Add-PSSnapin], PSArgumentExcepti
on
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand



PS C:\Users\admin> Get-PSSnapin -Registered

hunguyen
Posts: 2
Joined: Wed Mar 18, 2020 3:05 pm

Re: can not use powershell to execute Mailenable commands

Post by hunguyen »

Hi,

Below is MailEnable PowerShell Reference page.
It mentioned: :PowerShell support is available for all editions of MailEnable since version 9.5"

Is this feature available in Standard Edition version 10.23 ?

I tried what it said and it does not work.

Thanks,

==============

MailEnable PowerShell Reference
10
th April 2019
Overview
MailEnable's PowerShell interface allows system administrators and developers to manage MailEnable via
PowerShell.
Administrators can perform typical actions via scripts and can develop and extend these to these commands via
scripting. PowerShell significantly improves automation and integrated management of MailEnable.
PowerShell support is available for all editions of MailEnable since version 9.5.
Launching PowerShell
You can launch PowerShell either by:
1. Selecting Windows PowerShell from the Start screen, or:
2. Selecting Windows PowerShell from the taskbar.
Executing MailEnable PowerShell Commands
Once PowerShell opens, use the following command to add the MailEnable PowerShell snap-in to the current
PowerShell session:
Add-PSSnapin MailEnable.Provision.Command

You can then issue specific commands depending on the area of MailEnable you wish to configure. You can add this
to your PowerShell profile so this line is not needed each time.
...

Friedhelm
Posts: 2
Joined: Wed Feb 24, 2016 5:15 pm

Re: can not use powershell to execute Mailenable commands

Post by Friedhelm »

Hello,

we have the same issue here on Windows Server 2019 running in a VM.
Maybe there are any news on this issue?
Any help is much appreciated.
Greetings
Friedhelm

stephenl
Posts: 3
Joined: Tue Apr 25, 2023 3:38 pm

Re: can not use powershell to execute Mailenable commands

Post by stephenl »

I'm seeing the same error message running the latest MailEnable Standard v10.45 and Powershell 5. It doesn't work even if I run Powershell console as Administrator or set execution policy to Unlimited. Any help is appreciated?

> Add-PSSnapin MailEnable.Provision.Command

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.
At line:1 char:1
+ Add-PSSnapin MailEnable.Provision.Command
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (MailEnable.Provision.Command:String) [Add-PSSnapin], PSArgumentExcepti
on
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Admin
Site Admin
Posts: 1127
Joined: Mon Jun 10, 2002 6:31 pm
Location: Melbourne, Victoria, Australia

Re: can not use powershell to execute Mailenable commands

Post by Admin »

Make sure you are using the 64bit version of PowerShell - it is not compatible with the 32bit version. If you don't see it as a snap-in using:

Get-PSSnapin -Registered

Then it means it is not registered. To register it, open a command prompt and enter:

c:\windows\microsoft.net\framework64\v4.0.30319\installutil "C:\Program Files (x86)\Mail Enable\Command\mailenable.provision.command.dll"

You should then see it using Get-PSSnapin which will indicate then adding it will work.

stephenl
Posts: 3
Joined: Tue Apr 25, 2023 3:38 pm

Re: can not use powershell to execute Mailenable commands

Post by stephenl »

I'm running v64 of powershell.

I noticed the file (entire Command folder) does not exist in my Standard installation. How do I get that? I'm already running the latest MailEnable and I have selected all the features during installation.

C:\Program Files (x86)\Mail Enable\Command

Admin
Site Admin
Posts: 1127
Joined: Mon Jun 10, 2002 6:31 pm
Location: Melbourne, Victoria, Australia

Re: can not use powershell to execute Mailenable commands

Post by Admin »

If you don't have the Command directory it sounds like the installation did not complete. Try reinstalling, then check if it is created. You should see this in the install log INSTALL-STANDARD.LOG in the Mail Enable\bin directory. If you search this file for

\Command\

Then it should return something showing where it was installed to.

stephenl
Posts: 3
Joined: Tue Apr 25, 2023 3:38 pm

Re: can not use powershell to execute Mailenable commands

Post by stephenl »

It works now! The problem I think the server did not have the World Wide Web Publishing feature installed before installing MailEnable. After installing WWW publishing, I see the Command folder.

Thank you!

Post Reply