Month: March 2015

The missing site-to-site connectivity option

When creating a new Virtual Network in Azure, you might have noticed that the site-to-site connectivity option is missing, while the point-to-site connectivity is ready for activation.

The most probable reason for this is that there is no Local Networks configured in the subscription where you created the new Virtual Network.

Try browsing to New, Network Services, Virtual Network, All Local Network, and create a new one for the subscription where you need it. Then go back to the Virtual Network Configuration tab and you should see the create a site-to-site connectivity option.

Powershell One-liner for finding all objcets that use a spesific domain name in Exchange Online

In some cases we need to find all objects that use a domain name in Exchange Online or Azure AD. For example when we need to remove a domain from a Office 365 tenant. This is not a easy task, unless we are able to script it.

The following three one-liners prints out all email addresses that is active on a object.

Get all users with @mydomain.com

Get-MsolUser -DomainName "mydomain.com"

Get all distribution groups with @mydomain.com

Get-DistributionGroup | foreach {$_.EmailAddresses | ? {$_ -like "*@mydomain.com"}}

Get all dynamic distribution groups with @mydomain.com

Get-DynamicDistributionGroup | foreach {$_.EmailAddresses | ? {$_ -like "*@mydomain.com"}}

Thereafter we can either go in and remove these manually, or we could write a new script that does it for us using the Set-MailUser, Set-Mailbox, Set-DistributionGroup or Set-DynamicDistributionGroup