Troubleshooting Distribution Group not syncing to office 365

Follow me Often when we have directory synchronization setup between the on premise AD and the Office 365 we find that at times some objects do not get replicated or synced no matter how many times we resync and we find them listed under filtered connectors. This article is about the troubleshooting such situations and especially focusing on distribution group or mail enabled groups unable to sync. Why do my Group not sync ? Your group may have a sync conflict caused by a duplicate or invalid attribute. To identify this problem use KB 2643629. The technical contact for the tenant will likely have received an email with details about the offending attribute A member of the group having one of the above conflicts could also cause the group to not sync correctly The group is being filtered by the Directory Synchronization tool Following is a screenshot from KB 2643629, about default sync scoping rules:       MailEnabledGroup Can be filtered if any of the following condition is true Group has over 15000 members Display name is empty in which case you can follow KB 2508722 to fix the issue The group has not SMTP or primary SMTP address defined Group is placed under a filtered OU, Yes you can specify OU’s whose objects will not be synced to 365, read here about filtered OU’s   If you already fixed the above four conditions and still your issue is not resolved (Highly Unlikely 🙂 ) than please keep reading. Filtered Disconnectors It is quite likely that filtered connectors are causing the issue.To diagnose the issue with filtered connector follow the below steps Open...

Office 365 powershell cmdlets for Managing Exchange online

Follow me We have been working on Office 365 migrations quite long and found Azure PowerShell more than useful in managing 365 hosted organizations. There are a lot of cmdlet which we use regularly and believe every Office 365 Admin should know about them. Hence I am summarizing this article detailing all of them. To execute following Cmdlets , you need to install and connect to windows Azure PowerShell console,  Refer following article to understand how to do that. How to Connect to Office 365 via PowerShell Get company information Get-MsolCompanyInformation Find out total number of users in your office 365 Organization. (Get-MsolUser -All).length Get the total number of deleted users in your Office365 Org (get-msoluser -returndeletedusers).length Get a complete dump of all the users in your Office 365 Org. Get-MsolUser -All Get List of all the Groups in your Office 365 Org. Get-MsolGroup -All Provide the details of one particular user name Get-MsolUser -UserPrincipalName $myusername | Format-List Provides a dump of all users with UsageLocation US Get-MsolUser -UsageLocation “US”   Specify  Usage location ( Country where user is going to be mostly working like US or India) before activating it. Set-MSOLUser –UserPrincipalName $myusername –UsageLocation US   How to set Password Never Expire for Office 365 users. Set-MsolUser -UserPrincipalName $myusername -PasswordNeverExpires $true   Find Users with certain UPN or replace with other attribute or logic Get-MsolUser | where {$_.UserPrincipalName -match “contoso.com”} Get-MsolUser | where {$_.UsageLocation -match “UK”} | Format-Table DisplayName, UserPrincipalName, UsageLocation Get-MsolUser | where {$_.UserPrincipalName -match “John”} | Format-Table DisplayName, UserPrincipalName, UsageLocation Set User attributes using Set-MsolUser Cmdlet Set-MsolUser -UserPrincipalName $myusername -Title  “Dr.” Similarly Get-msoluser can provide dump...

View Office 365 License / Plan information via PowerShell

This article provides the step-by-step procedure to check the type of licenses you have in your Office 365 plan. This information is required if you are planning to add individual or bulk users on Office 365 via PowerShell and License them as well. First you’ll need to connect to your Office 365 Portal via PowerShell. Connect to Office 365 via PowerShell To get Plan/License Information, run the following command: Get-MsolAccountSku As shown in the image below, AccountSkuID is the type of License assigned to your Organization. If you have multiple type of Office 365 License, than they all will be listed here. You can use tho information when you configure a new user on Office 365 Portal via PowerShell to assign it to the user. Please do not forget to share your feedback, or ask a question by clicking here.   Follow...

Configure Email Forwarding on Office 365 via PowerShell

This article will explain how to forward emails from one user to anther user via PowerShell. Connect to Office 365 via PowerShell To check the current forwarding settings (if any) on the mailbox: Get-Mailbox -Identity user@domain.com | FL ForwardingSMTPAddress Note: It is not necessary that you’ll receive an email in the list, you may get a blank result. It means that there is no forwarding configured yet. However if you see that there is an existing email address listed, and you wish to remove it before adding another email address, you can run the following command: Set-Mailbox -Identity user1@domain.com -ForwardingSmtpAddress $null The command above will remove the existing forwarding address (if any) and you can then configure the new forwarding address. To Configure forwarding for a user to another user, considering the mailbox still exists: Set-Mailbox -Identity user1@domain.com -ForwardingSmtpAddress user2@domain.com -DeliverToMailboxAndForward $true With the use of this command you are forwarding all emails sent to user1@domain.com to user2@domain.com and also leaving the copy of the email in the mailbox of user1@domain.com. If you do not wish to leave a copy of the mail in user1’s mailbox, than set the value of –DeliverToMailboxAndForward to $false. You can also configure the forwarding to an external email address instead of internal, if required. Please do not forget to share your feedback, or ask us a question by clicking here.   Follow...

Disable Password Complexity for Office 365 Users

Follow me This article will explain on how to change/disable Password Complexity Requirement for the Office 365 users. It is recommended that you configure these policies before setting up the user’s final passwords, and this would force the user’s to change the password again. Please be careful with the commands you run on PowerShell, it’s a powerful tool, and can do a lot more than you can imagine. Connect to Office 365 via PowerShell Command to change the Complexity for single user: Set-MsolUser -UserPrincipalName user@domain.com -StrongPasswordRequired $false Command to change the Complexity requirements for All Users: Get-MsolUser | Set-MsolUser –StrongPasswordRequired $false Note: Once you run this command, you will be prompted to change the password on the next login. You can run the following command to ensure that the password is not expired on the next login. However there is a catch, in any case  you’ll either settings up a new password for them, or you’ll need to know their existing passwords. Disable password change on next login for one user: Set-MsolUserPassword -UserPrincipalName user@domain.com -NewPassword “password” -ForceChangePassword $false Note: Value for New Password can be an existing password or a new Password. Disable password change on next login for all Users: Get-MsolUser | Set-MsolUserPassword –NewPassword “password” -ForceChangePassword $false Note: This command will assign a common password for all users. However, my suggestion would be change the ForceChangePassword to True, as the users can than choose their own password when doing this for bulk users. Although it’s a complicated process to not allow the password to expire after configuring the password, I would still advise that one should change the complexity before...

How to Connect to Office 365 via PowerShell

This article explains How to Connect to Office 365 via PowerShell. There are lot of things you can do from the Portal, however for most of the tasks, you’ll need PowerShell. Please be sure to use it carefully as its a powerful tool, and can do a lot more than you can imagine. To login to Office 365 via Azure PowerShell, it’s advised to install the latest version of PowerShell. Prerequisite for Azure PowerShell is Microsoft Online Sign-in Assistant. You can download it from here. You can install this on Windows 8, Windows 8.1, Windows 7 (SP1)*, Windows Server 2008 R2 (SP1)* * You’ll need to install Microsoft .NET 4.5 framework or above along with Windows Management Framework 3.0 or above. Please click to know how to install .NET Framework 4.0 and Windows Management Framework 4.0 You can download the Azure PowerShell from the links below: Windows Azure Active Directory Module for Windows PowerShell (32-bit version) Windows Azure Active Directory Module for Windows PowerShell (64-bit version) Install the Sign-in Assistant, and Azure Active Directory Module, and launch Windows Azure PowerShell as Administrator (ensure that you Run it as Administrator) Run the following commands to connect with your Office 365 account: Set-ExecutionPolicy = unrestricted $cred = Get-Credential -Credential $user Enter the credentials for your Office 365 Admin account and hit OK. Import-Module MSOnline Connect-MsolService -Credential $cred $msoExchangeURL = “https://ps.outlook.com/powershell/” $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $msoExchangeURL -Credential $cred -Authentication Basic -AllowRedirection Import-PSSession $session Now you are connected to Office 365 via PowerShell. Please do not forget to share your feedback, or ask us a question by clicking here. Follow...