Showing posts with label Office365. Show all posts
Showing posts with label Office365. Show all posts

Tuesday 25 October 2016

How to export email trace results of Office365 server?

Or, PowerShell command to export email trace of Office365 server.

Descriptions: This is something every Office365 administrators should know. When you perform email trace in office365 server using Web-console, you can’t export the email trace results in to some excel or CSV files if you want. The easiest way to doing it is, you can use Office365 PowerShell command to export the desired mail trace results in to .CSV file.

Steps:
Connect to office365 server PowerShell admin console with administrative privilege.
Run below command to get the email traces exported in to a CSV file.

Get-MessageTrace -StartDate 10/12/2016 -EndDate 10/13/2016|Export-Csv C:\test.csv


Updated: 23/03/2018

To export Message trace for specific users, you may use the command given below
-----------------------------------------------------------------------------------------------------------------------
Get-MessageTrace -SenderAddress "test.user@techiessphere.com" -StartDate 3/20/2018 -EndDate 3/22/2018 | Export-Csv D:\temp\report123.csv
-----------------------------------------------------------------------------------------------------------------------

Note: you can change the Start and End date as per your requirements. Also, you can specify the export path as per your convenient.

How to export the exception members list of a Moderated DL in Office356 server?

Or, PowerShell command to export the exception list of a moderated DL in Office365 server.

Descriptions: If you have enabled moderation on some sensitive DLs and want to verify who all are excluded from being moderated, you can use below PowerShell command to export the list of exceptions defined under DL moderation settings.

Steps:
Connect to office365 server PowerShell admin console with administrative privilege.
Run below command to get the list:

Get-DistributionGroup -Identity "MyModeratedDLName" | Select-Object bypass* |Export-Csv D:\list.csv

Note: you can replace the ‘MyModeratedDLName’ with your moderated DL name as per your requirements. Also, you can specify the export path as per your convenient.

Exporting DLs with Last modify date, Date created, DL members, Members display name etc. Details in Office365 server using PowerShell.

Or, PowerShell script to export DLs in Office365 server containing details like Last Modify, Date Created, DL Members, Members Display Name, Owners etc...

Descriptions: Sometime you may need to export the DLs with their last modify date, members list and creation date for audit or inventory purpose.  You can use below PowerShell command to get these details exported in an .CSV file.

Note: Please understand the risk before executing any commands/scripts.

Steps:
Login to Office365 Server Admin PowerShell Console with administrative rights.

Copy all script section contents and run that on powershell to get the DLs details as explained above. You can change the yellow marked path and file name if you want results to be exported to some other path and with some other file name as per your requirements.

-----------------------------------------------------------------------------------------------------------------------
#Prepare Output file with headers
Out-File -FilePath d:\new.csv -InputObject "Distribution Group DisplayName,Distribution Group Email,When Created,Last Modified,Owner,Member DisplayName, Member Email, Member Type" -Encoding UTF8


#Get all Distribution Groups from Office 365
$objDistributionGroups = Get-DistributionGroup -ResultSize Unlimited

#Iterate through all groups, one at a time    
Foreach ($objDistributionGroup in $objDistributionGroups)
{    
               
                write-host "Processing $($objDistributionGroup.DisplayName)..."

                #Get members of this group
                $objDGMembers = Get-DistributionGroupMember -Identity $($objDistributionGroup.PrimarySmtpAddress)
                
                write-host "Found $($objDGMembers.Count) members..."
                
                #Iterate through each member
                Foreach ($objMember in $objDGMembers)
                {
                                Out-File -FilePath d:\new.csv -InputObject "$($objDistributionGroup.DisplayName),$($objDistributionGroup.PrimarySMTPAddress),$($objDistributionGroup.WhenCreated),$($objDistributionGroup.WhenChanged),$($objDistributionGroup.Managedby),$($objMember.DisplayName),$($objMember.PrimarySMTPAddress),$($objMember.RecipientType)" -Encoding UTF8 -append
                                write-host "`t$($objDistributionGroup.DisplayName),$($objDistributionGroup.PrimarySMTPAddress),$($objDistributionGroup.WhenCreated),$($objDistributionGroup.WhenChanged),$($objDistributionGroup.Managedby),$($objMember.DisplayName),$($objMember.PrimarySMTPAddress),$($objMember.RecipientType)"
                }
}
-----------------------------------------------------------------------------------------------------------------------

Sunday 2 October 2016

How to export all mailboxes with usage size details in Office365 Server?

Or, PowerShell command to export all user’s mailboxes with used size details in Office365 server.

Descriptions:  Guys, I am going to show you the way of exporting all mailboxes from your Office365 server containing used size details of all mailboxes. You may need to do some formatting in excel/csv file after exporting the details as per your requirement and convenient.
First of all, you need to connect to Office365 server PowerShell Admin Console. Once you are connected, you can run the below command on PowerShell window to get the results you need as explained above.

Don’t know how to connect to the Office365 Server PowerShell window, please read my another article to know “How to connect Office 365 Server PowerShell admin console?".

Steps (Exporting Mailboxes):
Login to Office365 Server Admin PowerShell Console with administrative rights. Click here for steps of connecting to Office365 PowerShell.

Once you are connected to Office365 PowerShell consoleRun below command to get the mailbox size details.
-----------------------------------------------------------------------------------------------------------------------
get-mailbox | get-mailboxstatistics | select DisplayName,ItemCount,TotalItemSize | export-csv "D:\temp\MailboxSizes.csv"
-----------------------------------------------------------------------------------------------------------------------
Reference Screenshot of command execution:

How to connect Office365 Server PowerShell admin console?

Or, Connecting Office365 Server PowerShell admin console.

Steps:
1. Open Windows PowerShell (Run as Administrator)
2. Run below command sequentially (one by one).
-----------------------------------------------------------------------------------------------------------------
 Set-ExecutionPolicy RemoteSigned
---------------------------------------------------------------------------------------------------------------
 $LiveCred = Get-Credential
----------------------------------------------------------------------------------------------------------------
 Note:  (in the pop-up window, please enter Office365 global admin credentials, preferably administrator@yourdomain.com)  
-----------------------------------------------------------------------------------------------------------------
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri  https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
-----------------------------------------------------------------------------------------------------------------
Import-PSSession $Session
 ----------------------------------------------------------------------------------------------------------------

(All above mentioned commands are highlighted in below screenshot sequentially)











Now you can execute any administrative command from here as you are connected to your Office365 Server successfully.

Friday 9 September 2016

How to update or modify SPF records in Office365 managed DNS Management portal?

Or, Modifying SPF records in Office365 DNS Management portal.
Or, Adding DKIM records in Office365 managed DNS management control panel.

Descriptions:
I must say, it was one of the easiest and completed task for me to find it out where are the SPF and DKIM records of my Office365 server. After reading too many articles and many calls follow-ups with MS Support guys, I decided to put it on my blog in better and easy way so that the one who is even not aware of these features of MS Office365 can navigate these options easily.

Guys one thing to note here is, it’s always best to have a separate DNS Management Control Panel for managing your all DNS records. If you are still running your domain/email domain or Office365 online exchange server with all DNS records created inside Office365 portal itself, you must try to take a downtime and point your NS record to your DNS management control panel portal keeping your manageability and administrative future a peaceful journey.

You may check with MS Support and your DNS service providers also on this to plan it in a better way to reduce overall downtime.

If I am taking about Downtime, it’s not that your email services are going to be down for next 24 hrs.. but it may take approx. 24 hrs to replicate and update your DNS records across the globe. Because, when you migrate your DNS records from Office365 Server to your DNS service provider, you may need to delete all the required records at MS Office365 portal and re-create it at your DNS Service provider’s DNS control panel.

I realized it’s good to explain about the technical background what we are going to do, where we are staying and what should be the next plan of action. Let’s come to the point now.
Please follow the below steps for navigating or modifying the SPF records created under Office365 DNS management Portal.

Steps:

Login to Office365 Portal with Administrative privilege > Go to Settings > Click on Domains





















Click on Default highlighted your email domain, in my case it is techiessphere.com (default)
















Click on Exchange Online to expand it















Here you have your SPF(TXT) record > to modify or update it, Click on Edit option











Once you Click on Edit option, the next pop-up windows will appear like below


















Update your required SPF record here. In my case I had added mailcot.org in my exiting SPF record. Please make sure you do enter additional entries behind < -all > sign and in the format

< include:yourSPFrecord.xyz > etc…

Click on Save after you are done with modifying the SPF record.


















Upon successful completion of the SPF record update, the below message will appear, saying “Custom Record Saved Successfully”.










For creating DKIM records, you just need to create a CNAME record with the value and key ID that you may have already received from your service provider.
Stay tuned, will post another article specially for adding DKIM record under Office365 DNS management Portal.

Cheers Guys, please write me back for any feedback, suggestion or corrections. 

Thursday 8 September 2016

How to add a custom field or attribute in user’s mailbox in Office365 server?

Or, Adding additional custom fields in email mailbox’s properties hosted on Office365 server.
Or, Office365 mailbox additional custom field in mailbox properties.
Or, Exporting custom attribute of all User mailboxes in Office365.
Or, Export all user’s mailbox list of Office365 server with custom attributes.

Descriptions: 
If you are an Office365 online exchange server administrator, you may have faced this query or may face in future. This situation typically arises when you have your AD domain completely separate and your email Office365 server domain is not integrated with your AD domain.
For example: Your AD domain may be yourcompanydomain.net and your Email domain of Office365 server is yourcompanydomain.com.

Scenario:
Your management team wants you to put Employee ID of every user for reference purpose as a unique identifier of AD accounts as well as for email accounts so that it can be easily tracked which user ID or email ID belongs to which users when performing reconciliation of AD or Email accounts to get them in sync (Ideally you should be having equal number of AD and Email accounts always except Service accounts and DLs).

There may be situation where you may have multiple users with same Display Name (login ID can be different), in this case it will be tough for you to identify who is the actual user you are targeting for any specific purpose. Now if you have had the employee ID written for all users somewhere in AD account’s and email account’s properties, it could have been easy to identify the actual users and map them accordingly.

Options available in AD and Office365(may be considered if suited best for your need):

AD (Active Directory): You have Description field where you can specify the Employee ID if all other relevant AD fields you are already using for some purpose.

























Now when you want to export the AD users accounts with description fields and other required fields, you can read my another article “Exporting AD Users”.

Office365: You can go to mailbox properties and specify the custom attribute and values with Employee ID.



















Now to export the all Email mailboxes with defined custom attributes in mailbox’s properties, you may use/run below command on Office365 PowerShell:
--------------------------------------------------------------------------------------------------------------------------
Get-Mailbox -Filter '(RecipientTypeDetails -eq "UserMailbox")' | Select RecipientTypeDetails,Name,Alias,CustomAttribute1 | Export-Csv -Path D:\CAT.csv
--------------------------------------------------------------------------------------------------------------------------

To know how to connect to Office365 PowerShell, please see my another article:

You can refer below screenshot for more details in graphical view.










Now you have the CAT.CSV report with all mailboxes and custom attributes in your D:\ drive. Yes, off-course the Custom attributes will be having the employee IDs that you had already entered there in the user’s mailbox properties.

Cheers, Please write me back if you have any query or feedback..

Tuesday 26 July 2016

NDR - Office 365: Your message did not reach some or all of the intended recipients.

Or, the following recipient(s) cannot be reached, Outlook 2013 (Office 365 Server).

Problem Description:
This is a known behavior and it happens rarely due to common issues like wireless connectivity hangs, if outlook did not respond well when you click on send button etc.

The possible reason for the error you are facing could be the user was having some intermittent networking issue that happened to hit at the time the message was submitted. This behavior occurs because of a busy or unreachable Internet Mail server when you connect through your Internet service provider (ISP).

This behavior is by design and the error is expected when network failures occur.
In general, this problem is likely caused by intermittent network connectivity issues, or possibly out-of-resource problem on the client machine. Also refer this link MS reference KB : https://support.microsoft.com/en-us/kb/286106

NDR/Error Screenshot:













Solution:
Re-sending this type of email (Using Send Again button) is the available work around for this issue.
Timely windows update and reboot, up to date drivers etc. can help you in getting rid of such issues if it’s occurrence is very frequent for few of the users.

Thursday 23 June 2016

Step by step Exporting DLs from Office365 Server.

Or, How to export all DLs from Office365 server?
Or, Export Distribution List Office365 Server.

Steps:
1. Open Windows PowerShell (Run as Administrator)
2. Run below command sequentially (one by one).
----------------------------------------------------------------------------------------------------------------------------
 Set-ExecutionPolicy RemoteSigned
-----------------------------------------------------------------------------------------------------------------
 $LiveCred = Get-Credential
-----------------------------------------------------------------------------------------------------------------
 Note:  (in the pop out window, please enter Office365 global admin)  
-----------------------------------------------------------------------------------------------------------------
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri  https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
-----------------------------------------------------------------------------------------------------------------
Import-PSSession $Session
 ----------------------------------------------------------------------------------------------------------------

(All above mentioned commands are highlighted in below screenshot sequentially)











3. Now run the below highlighted script to get the list of all DLs from your office365 server. You can    copy this script from my article 









4. Go to your D drive and search for the below file, here is the list of your all DLs.

Saturday 18 June 2016

SMTP Server: System.Net.Mail.SmtpException: Server does not support secure connections (Office365 SMTP).

Or, Office365 SMTP Error:
--------------------------------------------------------------------------------------------------------------------------
SMTP Server Settings => SMTP Server: smtp.office365.com, Port: 587, EnableSsl: True, UserName: emailIDTest@youremaildomain.com, Password: *******
Error occured while sending mail using 'smtp.office365.com' SMTP Server: System.Net.Mail.SmtpException: Server does not support secure connections.
 at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
 at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
 at System.Net.Mail.SmtpClient.GetConnection()
 at System.Net.Mail.SmtpClient.Send(MailMessage message)
 at QuantMailService.MailService.SendMailMessage(MailMessage mailMessage, Boolean isSSLEnabled)
-----------------------------------------------------------------------------------------------------------


Problem:  Applications using Office365 SMTP for sending mails, stops working suddenly and works well after restarting the mailing services.

Scenario Description:  For the above error scenario, I had struggled a lot with programming team, Microsoft Support and with many more blogs and articles. Thanks to Microsoft Escalation Support guys who shows me the more relevant cause of this problem.

My point is, If the SSL is not supported on the server as per the error occurred, why the mail flow starts working after resting the service? SSL not supported platform should not be fixed only after restarting the services or server, it must have some settings to get it supported or change the method of mail flow which is supported my Office365 SMTP server. When we restart the services, mail flow works well but we don’t know when this will be stopped with some SMTP error.


Possible Solutions:
1. First thing first, if you are using EnableSSL:True argument in your mail sending application code, you may try to Change it to EnableSSL:False, this may solve your problem but please make sure you have verified your mail flow scenario and compatibility. If not sure about this, please seek help from Microsoft Support.
2. Schedule an automated reboot of the mailing service on daily basis using windows task scheduler with the help of some task scheduling scripts. This will help to keep your mailing service healthy and mails flow may not stops frequently
3. Last and the most important thing, Office 365 do not support SSL since 1st Dec, 2014, It supports TLS with following TLS versions:
•TLS version 1.2 (TLS 1.2)
•TLS version 1.1 (TLS 1.1)
•TLS version 1.0 (TLS 1.0)
So, now you can think of making changes in your mail sending code of application to make sure you are using not using SSL anymore. Start using TLS instead.

You may refer below URL for more info on this:

Good Luck, please write me back if you have any feedback or query on this.

Monday 6 June 2016

Command to export DLs members list in Office365 server?

Or, PowerShell command to exports list of DLs along with members in Office365 server.
Or, PowerShell command to export all DLs, members and owners list in Office365 Server.

Please run the below command on Office365 PowerShell windows to get the list of all DLs and It's members.
-----------------------------------------------------------------------------------------------------------------------
$Groups = Get-DistributionGroup
$Groups | ForEach-Object {
$group = $_.Name
$Owner = (Get-DistributionGroup -Identity $group).ManagedBy
$members = ''
Get-DistributionGroupMember $group | ForEach-Object {
        If($members) {
              $members=$members + ";" + $_.Name
           } Else {
              $members=$_.Name
           }
  }
New-Object -TypeName PSObject -Property @{
      GroupName = $group
      Members = $members
     Owner = $Owner
     }

} | Export-CSV "D:\Distribution-Group-Members3.csv" -NoTypeInformation -Encoding UTF8
-----------------------------------------------------------------------------------------------------------------------
Cheers..

Sunday 5 June 2016

Command to disable clutter for single user in Office365 server

Or, PowerShell command to disable clutter option for single user in Office365 server.
Or, PowerShell command to disable clutter option for all users in Office365 server.


COMMAND FOR SINGLE USER:
-----------------------------------------------------------------------------------
Set-Clutter -Identity user@domain.com -Enable $false 
-----------------------------------------------------------------------------------

COMMAND FOR ALL USER:
----------------------------------------------------------------------------------
Get-Mailbox | Set-Clutter -Enable $false
----------------------------------------------------------------------------------

IMP Note: Be careful while executing the PowerShell commands. Select the command appropriately as per your requirement.

How to disable clutter for all users in office365 server?

Or, How to disable clutter for all user’s mailbox in Office365 server?
You would need to run the PowerShell command explained below to disable the clutter option within your organization for all users.
Steps:
Let’s Connect to Office365 Server using Windows PowerShell
1. Open Windows PowerShell as Administrator
2. Copy and paste the commands below (all) then enter Office365 Admin credentials when login             windows popped up:
------------------------------------------------------------------------------------------------------------
Set-Executionpolicy -ExecutionPolicy Unrestricted

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
Import-PSSession $Session
 ------------------------------------------------------------------------------------------------------------
After the above command completion, the pop-up windows should like below:

Once you are connected to office 365 server PowerShell, please run the below
command to disable clutter for “All Users” within your organization.
-------------------------------------------------------------------------------------------------------------
Get-Mailbox | Set-Clutter -Enable $false
       ------------------------------------------------------------------------------------------------------------
Note: you can execute “Set-Executionpolicy -ExecutionPolicy Unrestricted” separately if the whole command does not work as combined..
Cheers, Please write me back if you have any query or feedback..

Friday 19 February 2016

How to integrate OneDrive for business with Outlook 2016?

Or, How to Integrate office 365 OneDrive for business with Outlook 2016?

Prerequisites:
1. Make sure you are having MS office 2016 installed in your machine.
2. Make sure you are having OneDrive For Business License assigned to your Office 365 mailbox.

Steps:

1. Login to your Office 365 Account (https://login.microsoftonline.com/

2. Open OneDrive










3. Click on “Return to classic OneDrive” from bottom left.









4. Now Go to Settings (Right Corner) > Click on “Show Ribbon”
















5. Now click on Library tab (Left Corner) > Click on “Connect to Outlook” (as shown in below screenshot).








6. Follow the connection instructions and you are done with integrating OneDrive for business with Outlook 2016.


To verify whether the OneDrive has been configured successfully or not, you can check below things:


7. Open your Outlook 2016 > Check if the “SharePoint List” folder is appearing.
















8. Open your My Computer(Press keys Windows+E) > Select “OneDrive for Business” > Create any Files > Write something > Sync with OneDrive > Open file Online and see if the contents are updated...












How to sync OneDrive folder from PC (Computer) to OneDrive Cloud account forcibly? Please see my another article How to Sync OneDrive From PC to OneDrive Cloud Account .
If everything is fine and syncing properly, you have done a great job…

Cheers!!!

How to sync OneDrive folder from PC to OneDrive cloud account?

Or, How to Forcibly Sync Outlook SharePoint contents from Computer(PC) to OneDrive Cloud account?

Steps:
1. Go to Notification bar > Right Click on “OneDrive” Icon















2. Click on “Sync Now






















To Know, How to integrate OneDrive for Business With Outlook 2016, please see my another article:
how-to-integrate-onedrive-for-business-with-Outlook-2016