Distribution Groups nested – get list only groups

Recently, we described how to obtain a list of all mailboxes in the group that has nested distribution groups.

Unfortunately, using this method, you can not get a list of groups in a distribution group, only users (mailboxes).

To obtain this list, you need to write more or less complicated powershell script or use the additive Quest Powershell Module for Active Directory.

 

After installation of Quest Module, run powershell console and run:

add-PSSnapin quest.activeroles.admanagement

Continue reading

Exchange MessageTrackingLogs get recipients list

From time to time we need to get a list of all persons to whom the email was sent with a given subject.

The list of recipients in a fairly simple way we can get from the transaction logs which are located on Exchange servers with HT roles.

Of course, before you do this, you have to configure your environment so that the transaction logs are kept for a few days on the servers.

The following script returns a list of recipients to whom the email was sent with the subject “Test mail”, but we are interested in the time of dispatch of the last day.

Number of days is defined in $DAYS and subject in $SUBJECT.

Script you can find below:

Continue reading

Remote Exchange PowerShell Session in Powershell ISE

 

During Microsoft Exchange servers administration we often use EMS (Exchange Management Shell). Many times it’s the best and the fastest way to achieve what we need. We can create Powershell scripts to automate some administrative actions.

Unfortunately lot of us to use Exchange Management Shell, first connect by RDP to Exchnage Server or workstation with Exchange Management Tools and then run EMS.

We can easly connect to Powershell Exchange Management Console from workstation using New-PSSession in Powershell ISE console.

Below we present how to add menu Powershell ISE to connect to Exchange Server Powershell Console.

First we need to run Powershell ISE console and write:

Set-ExecutionPolicy RemoteSigned

 

next we need to write to check powershell profile used on our computer:

$profile

 

 

Now we know where is located file with our powershell profile, but we have to check if this file exists.

To check if this profile file exists we have to run below command:

test-path $profile

Continue reading

Exchange Server scripts repository resources

 

If you write scripts for you Exchange Server environment, you can be interested in Microsoft  Scripts Repository.

On Microsoft websites you can find many scripts for Exchange environment, which are written in VBS, Powershell, SQL, JavaScript and others.

Those scripts are divided for Exchange Server versions 2003, 2007, 2010.

Links to Exchange Scripts repository :

Microsoft Exchange Script Center

Technet Gallery Exchange Scripts

 

 

Microsoft Exchange 2013 New PowerShell cmdlets

List of new PowerShell commands (cmdlets), released with Microsoft Exchange 2013 we published in our post on Exchange Blog here:
Exchange 2013 Powershell

You can now find in internet a detailed list of new commands and a description of their use.
This list is shown below:

Continue reading

Exchange 2013 Powershell EMS

In Microsoft Exchange 2013 Preview, PowerShell still plays an important role.
In new edition PowerShell for Exchange 2013 is based on PowerShell v3 and Management Framework 3.0 and in addition it has been enhanced with new cmdlets.
Even in Microsoft Exchange 2010 PowerShell allow administrators to perform many complicated things that were not available in the graphics console EMC. That allows us to create scripts to facilitate the daily administrative work.

By using PowerShell version 3.0 the new Exchange server support gained by using the commands on the functionality and simplicity.
For version 2.0 to search a box for a particular look like this:

 Get-Mailbox | Where {$_.Name –like “*smith*”}

now in PowerShell version 3.0 it looks:

Get-Mailbox | where name –like “*smith*”

 

Continue reading

Microsoft Exchange 2010 how to reduce the size of the database

As is known in the Microsoft Exchange database size after removal of the mailboxes is not decreasing but remains the same.
Created the database “gap” so called White Space which tells us about the amount of available space, which can be used without the need to increase the size of the database file .edb.
Only after completing the White Space, a further increase in the size of mailboxes in the database, it will increase the file size .edb file.

In the case of Microsoft Exchange databases such solution is problematic, because in order to reduce file size .edb after removing mailboxes from the database we use the most with ESEUTIL, which have performed defrag the database.

Continue reading