none
Exchange 2010 and Powershell (Enable-Mailbox RRS feed

  • Question

  • Hello everyone,

    I have this powershell that enables users mailbox that used to work and now does not.

    The script basically adds a new user to the AD then enables the mailbox for him. I'm running Exchange 2010 so I have this at the top "Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010"

    so when I run the script, the user gets added to the AD but I get this error

    "The Windows PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.E2010' is not installed on this computer"

    I searched online and found out that I can install the Exchange management.

    so I tried Get-PSSnapin and all that is there is:

    Name        : Microsoft.PowerShell.Core
    PSVersion   : 5.1.19041.546
    Description : This Windows PowerShell snap-in contains cmdlets used to manage components of Windows PowerShell.

    And when I tried Get-PSSnapin -registered, all that is there is

    Name        : WDeploySnapin3.0
    PSVersion   : 2.0
    Description : This is a PowerShell snap-in that contains cmdlets for managing Microsoft Web Deployment infrastructure.

    I used to do this from my computer in the past but not sure what changed.

    The line I have to add the email is:

    Enable-Mailbox -Identity $Name -Alias $Username -Database 'defaultdb' -RetentionPolicy 'Default Archive and Retention Policy' -ActiveSyncMailboxPolicy 'Default'
                

    Please let me know what am I missing or need to be done to enable this. 

    The server and my computer are on primases and on the same domain.

    Thanks.

    Wednesday, October 21, 2020 6:23 PM