Thursday 19 July 2012

Import users form a CSV file to Distribution Group

I have been getting asked lately on how to due bulk user imports into Exchange for various tasks.

The below example will use the user Alias field to add users to a Distribution group.  You can use this method to do other things like make new mailboxes and such.  All you need to do is change the command.  the CSV file should be comma delineated and the first line should say alias since that is what I am using.

Also note I used the alias field you can also use email addresses etc.

Import-CSV c:\users.csv | ForEach {Add-DistributionGroupMember -Identity "DL Name" -Member $_.alias}

Monday 16 July 2012

How to get members of a Dynamic Distribution Group in Exchange 2010

Sometimes, we are asked to send a report off which members are in a DL.  If the DL is Dynamic this can be tricky.


    $1 = Get-DynamicDistributionGroup "groupname"
    Get-Recipient -resultsize unlimited -RecipientPreviewFilter $1.recipientfilter -OrganizationalUnit $1.organizatunit

 The above commands will get the list of members.  What I did was make a variable of $1 for the dynamic DL.  This saved me typing time when I ran the command to get the members.

Friday 18 May 2012

Test SMTP through Telnet

Sometimes you need a tool to verify if SMTP is enabled and if it is able to relay messages.  Telnet is great for that.  Also Putty is a great Telnet client.

Below are the steps to send a mail using telnet or Putty.

You do/type this Server responds with
Telnet to hostname on port 25 220 (then identifies itself - possibly with several lines of 220 + text)
HELO your_domain_name or whatever 250 (followed by human readable message)
MAIL FROM:you@hostname.com (ie, your email address) 250 is syntactically correct (or similar)
RCPT TO:them@someplace_else.com (email address you want to send to) 250 is syntactically correct
DATA Tells you to send data then CRLF period CRLF at end
You type your message then CRLF period CRLF (ie, type a period on a line by itself then hit ENTER) 250
QUIT Signoff message

Thursday 17 May 2012

Installing a SSL Certificate in Exchange 2010

To import a SSL Certificate use the below command

Import-ExchangeCertificate -FileData ([Byte[]]$(Get-Content -Path c:\CERTNAME.pfx -Encoding byte -ReadCount 0)) -Password:(Get-Credential).password

To enable a service on the cert, make sure you get the thumbprint of the cert which you can get by using the following command Get-exchangecertificate |fl  and then use the below command to assign a certificate.

Enable-ExchangeCertificate -Thumbprint E8C1BB735FA57C4E70988420CE247263AD92DC65 -Services "iis,imap,pop"

If you do SSL offloading then make sure you use the DoNotRequireSSL tag after the command look below for example

Enable-ExchangeCertificate -Thumbprint E8C1BB735FA57C4E70988420CE247263AD92DC65 -Services "iis,imap,pop" -DoNotRequireSsl

Monday 7 May 2012

Manually Update the Global Address List in Exchange 2010

Here is the command to update the GAL in exchange.  If your address list is not the default add the name in.

update-globaladdresslist -identity "default global list"

To update the users cache copy faster also make sure you sync your CAS server's also.

Update-FileDistributionService -Identity Server1 -Type "OAB"

Now if the user manually updates their address book using outlook they will download the latest copy.

Monday 6 February 2012

How to install and configure Remote Apps in Remote Desktop Services for Server 2008 R2

Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications. The user can either have a desktop shortcut installed or go through the web portal to launch applications. The reason why IT administrator would apply this approach for running applications is end user experience.

The end users now have to simply click a shortcut on his/her desktop and the application begins to run. To the user it looks as if the application is installed locally. Also any printers that the user has get redirected. If they have dual screens they can move the application around between screens just like if it was locally installed. The bonus for IT administrators is that they can control who has access to an application.

Below are the steps to install Remote Desktop Services on one server with Remote App functionality. These are the basic steps to get the server going so you can play with the features.

1. Install server 2008 R2

2. From Server Manager install the role Remote Desktop Services



3. Install the Remote Desktop Session Host and the Remote Desktop Web Access Services for the role. (IIS will be required for this but it will install for you)



4. Now at this point you have all the core services and roles installed to get going. We did not install services such as gateway, or licencing as those are not required to get remote app working. But if you are planning to do a production implementation of Remote Apps, you will need a licence server and the various other services to support it. As we stand now, we have roughly 120 days before we have to input a licencing server, which is more than enough time to test Remote Apps to see how they work, before you design your production environment.

5. Now that we have installed the roles it’s time to configure Remote Apps. This process is very easy on one server.

6. Open Remote App manger and it should look like below
Remote App Manager

7. First Setting to look at is the RD Session Host Server Settings. Here is where you will define a farm name, RDP port number, Digital Signatures and Common RDP Settings such as allow printer redirecting etc. For our purpose we can leave these all default as we only have one server and do not need a farm name and the local server name is fine for this.


8. The next setting to look at is Distribution with RD Web Access. This is needed if you would like users to launch applications from the web interface. The web interface will use the name specified in the RD Session Host Server Settings. So if you have the local server set in the field it would be https://servername/rdweb if you had a farm name it would be https://farmname/rdweb. Below is the login page the user will see and the applications the user is able to run. What you need to do is add the RDS server to the local security group named TS Web Access Computers



9. Now we need to actually add a Remote App. As you can see I already added calculator, but let’s add another one.

  • Go to the Actions Pane on the right of Remote App Manger and click Add RemoteApps Program.

  • Select from the list of programs or select a different program by finding its .exe by using the browse button.


Add a Remote App

  • You can also assign command line arguments if needed for greater flexibility By clicking properties of the application




  • After you have chosen the application hit apply, now you should see the app in the RemoteApp Programs section at the bottom. Now if you want to web publish this you will need to select the app and in the action pane and click Show in RD Web Access




10. Now at this point you have a Remote Desktop Server running and a Remote App published. If you want users to access it through the web portal simply give the URL to the user. Also if you want to limit who can run an application or not click properties on the remote app in Remote App Manager and go to user assignment this is where you can specify who can access an application or not.


11. If you want the remote app to be accessed by a desktop shortcut then you should either create an .rdp file or better yet create an MSI so you can deploy it by GPO. These actions can be found on the Actions Pane for the App


12. That is really it, now you should be able to setup a Remote Apps Server and test some Remote Apps

Thursday 5 January 2012

Discovery mailbox can't be found

"The discovery mailbox, a hidden default mailbox that is required to search mailboxes, can’t be found. It may have been inadvertently deleted. This mailbox must be re-created before you can search mailboxes.”

If you are getting the above error when trying to run Audit reports from ECP such as Run a non-owner mailbox report try the following suggestions.

1. If the mailbox SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9} has not been deleted and is still in the users OU try enabling it by running the powershell command.  This is all I had to do to get it working. After I did my Exchagne 2007 to Exchange 2010 Migration.

Enable-Mailbox  -Identity "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}" -Arbitration

2. If Discovery System Mailbox has been deleted then you will need to recreate it (Will not stop mail flow and will require no downtime)
  • Make sure the Mailbox SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9} is not present if it is you can delete it.
  • Install the Exchange media into a Domain Controller and run Setup /PrepareAD
  • Enable the mailbox using EMC - Enable-Mailbox -Identity "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}" -Arbitration
This should solve your issue.

http://technet.microsoft.com/en-us/library/gg588318.aspx