a command line interface and scripting platform for Microsoft Exchange Server. It is a fully featured version of Windows PowerShell with Exchange-specific extensions, first introduced with Exchange Server 2007 and included in all later versions.
Questions tagged [exchange-management-shell]
48 questions
5
votes
7 answers
Suddenly can't connect to Exchange Online via EXO v2 PS module
I've been successfully using PowerShell and Exchange Online Management module for a long time. First I used the original version and lately I've been using the EXO v2 module. I'm also using MFA and a Global Admin account. We do not use any hybrid…

Tenttu
- 225
- 1
- 2
- 8
3
votes
3 answers
Error when using PSSession and Microsoft.Exchange.Management.PowerShell.SnapIn
So trying to run Exchange Management Shell Locally using PSSession, but getting an AD Operation Failure.
Here are my steps
1)open PSmodule as Admin
2)
Enter-PSSession -ComputerName DAG01 -Credential domain\user
3)
Add-PSSnapin…

MannyFresh
- 35
- 1
- 3
3
votes
1 answer
Run Exchange Powershell commands from Linux using Ruby/WinRM
I am attempting to run the enable-mailbox command for existing users in Active Directory from a ruby script. I'm using this winrm gem. So far I have been able to connect to the exchange server using winrm and kerberos authentication. I can run an…

dmautz
- 61
- 6
3
votes
1 answer
Set the Active Directory account properties during a New-Mailbox creation with PowerShell
I am using Exchange 2010. I am currently creating a new mailbox account with the PowerShell cmdlet New-Mailbox in c#.
It is possible to create a new mailbox dynamically (c#)? Here's the code I am using:
// Prepare the credentials that will be used…

Vinc 웃
- 1,187
- 4
- 25
- 64
2
votes
0 answers
PowerShell: Exchange Management Shell: Unable to execute the variable to modify the multivalued variable EmailAddresses
Function Get-GmailAlias ($ID) {
$a = (Get-RemoteMailbox $ID |
Select-Object DisplayName,PrimarySmtpAddress, @{ Name="EmailAddresses"; Expression={$_.EmailAddresses | Where-Object { $_.PrefixString -ceq "smtp" } | ForEach-Object {…

LittleBuddha
- 41
- 6
2
votes
0 answers
Consuming a deserialised Exchange 2013 PSSession in PowerShell
I have created a New-PSSession to a ConnectionUri for an Exchange 2013 server, but see that the type of the session is Deserialised. This deserialised session cannot be consumed by Invoke-Command, Enter-PSSession or Import-PSSession.
How do I…

Luke
- 776
- 9
- 24
2
votes
1 answer
Powershell script combine
How can I combine these PowerShell cmdlets instead of running them separately? These commands are ran on our Exchange server for on premise and Office 365.
# General
New-DistributionGroup -Name dis_its3 -DisplayName dis_its3 -Alias dis_its3…

Mykal
- 21
- 2
2
votes
3 answers
C# Connected to Powershell, but I need connect to Exchange Management Shell
I have this code, I send remotely a powershell command "date" to my exchange server (server01) and it works, I'm receiving a result in a messagebox.
but, if I send the command "Get-Mailbox" the debbugers stops with this error: The term 'Get-Mailbox'…

Emmanuel_InfTech
- 81
- 7
2
votes
2 answers
Exchange Managed Shell from C#
I'm trying to run next script remotely from client computer:
Get-Mailbox | foreach { Get-InboxRule -Mailbox $_.Name |
Remove-InboxRule }
There is my code:
private const string SHELL_URI =…

IStar
- 184
- 1
- 15
1
vote
0 answers
How do I loop a variable properly in Powershell? (Exchange)
I'm trying, but not so good with Powershell. I'm trying to dynamically check and create many Dynamic distribution lists in Exchange. Seeing as we have a relatively high turn-over of staff in this department, I wanted to script the creation of their…

Brad
- 11
- 1
1
vote
2 answers
Remove characters from output in each row
I am a newbie to PowerShell and I am struggling to modify an output according to the way I want.
The command I run in MS Exchange Shell is this:
Get-Mailbox user1 | Get-ADPermission | ? {($_.ExtendedRights -like "*send-as*") -and -not ($_.User -like…

MWH
- 399
- 1
- 5
- 19
1
vote
0 answers
New-MailboxExportRequest By Date Range
I am trying to export items out of a mailbox, sent and received between a certain date on Exchange 2016. However the script keeps failing without an error message. Not sure where I am going wrong....
New-MailboxExportRequest -Mailbox "User"…

BrackleyMan
- 19
- 5
1
vote
1 answer
Powershell Speed Up Get-MessageTrackingLog
Currently I am trying to get an output of all disabled users and their message counts in exchange. This is easy enough through a foreach loop:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri…

jrider
- 1,571
- 1
- 10
- 26
1
vote
0 answers
Errors don't get caught properly in Powershell script run in Exchange Management Shell. Caught properly when run in regular Powershell shell/CLI
I have a Powershell .ps1 script that is run through the Exchange Management Shell. When testing and writing the script, it worked perfectly. Cmdlets inside try blocks with "-ErrorAction 'stop'" properly go into the catch block on error.
However,…

Alex C. Fish
- 83
- 2
- 6
1
vote
2 answers
Get monthly count of received mails in list of inboxes
I am trying to get a monthly report of received e-mails from a list of e-mail-addresses. I want to export the results to a .csv and if possible send the csv automatically via e-mail to another address.
This is my approach in the…

Uke
- 169
- 3
- 21