AzureAD This script will help to get onPremisesDistinguishedName property from AzureAD and write it to excel file with additional column. You may replace the field to relevent one for getting required data.