Just can't get enough of IT

This blog is about mostly anything in IT. But the primary focuses are Microsoft Technologies like Exchange, Office 365, Azure and Cloud Security.


The Skype for Business client merges contact data from different sources when displaying the contact card. The merged data is used to perform name resolution when performing a user search. In a more complex deployment scenario where an email domain name is in shared use in two in Active Directory forests you might run into a situation where the Skype for Business client tries to use the wrong target address.

Such a scenario would look like as follows.

Forest A is used as a dedicated infrastructure for developers. When logged on to the development network the users should be able to skype with colleagues currently connected to the default office client network.

Forest B is the default office client network.

Clients logged on to forest A connect to the Skype for Business infrastructure in forest B as external clients. Forest A is used for user account authentication while forest B is used for Skype for Business connection and authentication. 

Forest A

Forest A runs an Exchange Server 2013 organization.

  • Active Directory domain:
  • SMTP domains:,

Forest B

Forest B runs an Exchange Server 2013 organization and a full Skype for Business 2015 server deployment.

  • Active Directory domains:
    • root.internal - Forest root, resource domain with Skype for Business 2015, Exchange 2013
    • - user domain, primary email domain
  • SMTP domain:

Both Active Directory forests to not have trust of any sort established.

Such a configuration would result in forest A users trying to contact a Skype for Business user using the wrong address. Instead of using the Skype for Business client of Jane (logged on to forest A) would try to contact As there is no endpoint defined for a connection could not be established. Therefore, no availability information is available and no call or chat connection could be established.


The Skype for Business client uses merged data pulled from the Skype for Business address and from the local (Forest A) Active Directory (GAL). This results in a connection attempt to

Forest A object attributes

  • proxyAddresses:
  • proxyAddresses:
  • msExchShadowProxyAddresses:
  • msExchShadowProxyAddresses:
  • msExchShadowProxyAddresses:
  • msRTCSIP-UserEnabled: TRUE
  • msRTCSIP-PrimaryUserAddress:

Forest B object attributes

  • proxyAddresses:
  • proxyAddresses:
  • msRTCSP-InternetAccessEnabled: TRUE
  • msRTCSIP-UserEnabled: TRUE
  • msRTCSIP-PrimaryUserAddress:


  • Create a new text file named ocapi_test.config.xml using notepad
  • Add the following Xml text
<?xml version="1.0"?> 
  • Save the file in same directory as Lync.exe
  • Terminate the Skype for Business client
  • Delete all files from the users SIP folder
    • e.g. C:\Users\JDOE\AppData\Local\Microsoft\Office\16.0\Lync\
  • Restart the Skype for Business client


Enjoy Skype for Business





Read More »

Exchange Server 2007Exchange Server 2010Exchange Server 2013Exchange Server 2016Description

The script gathers a lot of Exchange organizational configuration data for documentation purposes.

The data is stored in separate log files. The log files are stored in a separate subfolder located under the script directory.

An exisiting subfolder will be deleted automatically.

Optionally, the log files can automatically be zipped. The zipped archive can be sent by email as an attachment.


When the script runs, a progress bar informs about the current step being executed.

Script progress bar

All files are stored in a dedicated subfolder (default name: ExchangeOrgInfo)

Example of exported files

The hash table $infoSources defines the following

  • Types of Exchange configuration data to be gathered
  • Output type for each configuration data entity
  • Optional paramaters for each configuration data entity
  • Attribute name for object sorting within an entity
  • The order of the data to be gathered (long running tasks are at the end)



# Gather all data using MYCOMPANY as a prefix
.\Get-ExchangeOrganizationDetails.ps1 -Prefix MYCOMPANY

# Gather all data using MYCOMPANY as a prefix and save all files as a compressed archive
.\Get-ExchangeOrganizationDetails.ps1 -Prefix MYCOMPANY -Zip

Version History

  • 1.0, Initial community release
  • 1.1, Updated and some PowerShell hygiene






Read More »
On January 11, 2017
0 Comment

Exchange Server 2013 Exchange Server 2016When you delete a mailbox or an Active Directory account, the soft-deleted or disconnected mailbox won't show up in the list of disconnected mailboxes immediately. The mailbox status is updated as part of a mailbox store maintenance task.

When you query a mailbox database for disconnected mailboxes you will find a mailbox having the DisconnectReason and DisconnectDate attribute empty.

# Query the mailbox using the original user display name 
Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -eq "LASTNAME, FIRSTNAME" } | fl DisconnectReason,DisconnectDate,MailboxGuid,Database
# Use wildcards if the correct display name is unknown 
Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -like "*LASTNAME*" } | fl DisconnectReason,DisconnectDate,MailboxGuid,Database
DisconnectReason :
DisconnectDate   :
MailboxGuid      : a04a8aab-c360-406b-a194-8c290d56668b
Database         : MBXDB34

You can find disonnected mailboxes by

  • DisplayName
  • MailboxGuid
  • LegacyExchangeDN


The following PowerShell cmdlet updates the mailbox state of a single mailbox using the MailboxGuid as an identifier.

Update-StoreMailboxState -Database MBXDB34 -Identity a04a8aab-c360-406b-a194-8c290d56668b


After updating the mailbox state the DisconnectReason and DisconnectDate attributes are properly set.

Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisplayName -eq "LASTNAME, FIRSTNAME" } | fl DisconnectReason,DisconnectDate,MailboxGuid,Database
DisconnectReason : Disabled
DisconnectDate   : 01.01.2017 15:02:59
MailboxGuid      : a04a8aab-c360-406b-a194-8c290d56668b
Database         : MBXDB34


The disconnected mailbox is now visible in Exchange Administrative Center (EAC) and can be reconnected using EAC or Exchange Management Shell.

By default a disconnected mailbox is supposed to be connected it's original account having a matching LegacyExchangeDN attribute. Connecting the mailbox to a different Active Directory account requires the use of the AllowLegacyDNMismatch parameter.

# Connect a mailbox to the original AD account having a matching LegacyExchangeDN
Connect-Mailbox -Database MBXDB34 -Identity "Doe, John"

# Connect a mailbox to a different AD account 
Connect-Mailbox -Database MBXDB34 -Identity "Doe, John" -User "Jane Doe" -AllowLegacyDNMismatch

Examples for room and shared mailboxes are described in the Connect-Mailbox documentation.





Read More »

Exchange Server 2007When you are dealing with legacy public folders and you are still using Exchange Server 2007 you might be interested in the overall size of the data hosting in your public folder hierarchy.

The following script calculates the public folder size based on the public folder statistics output provided by Exchange Server 2007.

# Server name hosting legacy public folders

# Fetch legacy public folder statistics
$Folders = Get-PublicFolderStatistics -server $Server | Where-Object {($_.TotalItemSize -ne "0B")}  

$TotalBytes = 0

# Let's do some string manipulation stuff
ForEach ($Item in $Folders) {
  $TotalItemSize = $Item.TotalItemSize
  $TotalItemSize = [string]$TotalItemSize
  if ( ($TotalItemSize.contains('KB')) ) {
      $TotalItemSize = $TotalItemSize -Replace ('KB','')
      $TotalItemSize = [int]$TotalItemSize * 1024
  $TotalItemSize = $TotalItemSize -Replace ('B','')
  $TotalBytes = [long]$TotalItemSize + [long]$TotalBytes

# Output as GB 
[math]::round($TotalBytes/1Gb, 2)





Read More »
On January 6, 2017
0 Comment

You might encounter a situation where you log on to your Windows 10 client and the Start menu is unresponsive and the taskbar remains empty.

The following two actions help to recover from the situation.

Step 1

Open an administrative PowerShell window and execute the following command

DISM /Online /Cleanup-Image /RestoreHealth

Restart Windows and check if the issue has been fixed.


Step 2

Reinstall (fix) all Windows apps. This step requires internet access, as all sources are downloaded using the local app manifest information

Open an administrative PowerShell window and execute the following command

Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Be patient and wait until the app download and installation process has been completed. Just ignore any error message and restart Windows.


The first step might fix the issue already. if this is the case, do not execute the PowerShell cmdlet described in step 2.





Read More »