Thursday, August 28, 2014

Exchange 2010 - Creating a Dynamic Distribution List from an AD Security Group

As part of SCSM group notifications I wanted a way to provide security; separate the analysts into groups; be able to provide email addresses for each of the groups; and not have to manage the groups myself.

Enter - Dynamic Distribution Groups

I opened the Exchange Administration Console and started creating a new Dynamic Distribution Group (DDG). I quickly realized that I am unable to filter the DDG based on an Active Directory Security Group (ADSG) like I thought I could.

Quick google search later and I found this technet article

Here is what I came up with Open the Exchange Shell and enter the following commands:

New-DynamicDistributionGroup -Name "NAME_OF_DDG_TO_CREATE" -RecipientFilter {(RecipientTypeDetails -eq 'UserMailbox') -and (MemberOfGroup -eq 'CN=ADSEC_GROUP,OU=GROUPS,DC=SOMEWHERE,DC=COM')

Then I was able to find my DDG in the Exchange Administration Console and set other options like:

  • "Managed By"
  • "Select the recipient container where you want to apply this filter" (by default this points to domain/Users and we have moved all users into a different container for organization)
  • "Hide group from Exchange address lists" (I don't want people to be able to email these groups directly
  • "Do not send delivery reports" (No need since all of these emails are coming from Orchestration Runbooks as the SCSM notifications)

Monday, August 11, 2014

Check for Running Task & Start

We have an open source Application call iSpy Connect that monitors all of the IP cameras in the building. This software (because we aren't paying for the licensed version) runs as a standard application and not as a service. This causes issues when someone logs into the server to check a recording and closes the Application or logs out. Now the software isn't running which means it isn't recording camera activity. I wrote this powershell script to check to see if the service was running. If it's running it just closes... if it's not running it will start the application. It looks like this -
#Process Name
$procToCheck = "iSpy"

#Process exe location
$procFileExe = "C:\Program Files\iSpy\iSpy (64 bit)\ispy.exe"

#Checks for running process and starts if needed 
$process = Get-process $procToCheck
if (!($process)) {
 start-process $procFileExe
}
And added a 15 minute task in Task Scheduler following these steps: Create Basic Task Name Task and Description Schedule it Daily Run it Every Day Start a Program Program/Script: powershell.exe Add arguments (optional): -file "c:\scripts\ispy_Running.ps1" Check the box to open the Properties dialog for this task when clicking Finish Double click the trigger created to edit the trigger Check the box to Repeat the task every: - And set it to 15 minutes or whatever is appropriate Change the duration to Indefinite Save your changes and that should create a task that will monitor for your program running and start it should it close (or be closed)

Remote Mailboxes - Hybrid Config - Missing

The Remote Mailbox exists on the On Prem Exchange server and linked to the Office 365 mailbox. Without one of these for each Office 365 mail...