Tag Archives: Office 365

Receive a User’s UPN, Email, First and Last Name via Azure Active Directory Custom Manifest

In May 2019 Microsoft has made the new and improved App Registration portal generally available. For some time this new portal has been available under the Azure Active Directory > App registration (preview) menu in the Azure Portal. The old App Registration is still available under Azure Active Directory > App registration (legacy) but most likely it will be discontinued soon.

The ID token does no longer by default contains fields such as user principal name (UPN), email, first and last name, most likely to ensure that personal data is handled with more consideration. As a result, you must manually update the app registration’s manifest to ensure that ID tokens include the UPN, email, first and last name by adding these optional claims.

  1. Go to Azure Portal > Azure Active Directory > App registrations
  2. Find your application registration (you may click on the All applications tab)
  3. Click Manifest
  4. Update the Manifest and change the optionalClaims node as shown below
"optionalClaims": {
	"idToken": [{
			"name": "family_name",
			"source": null,
			"essential": false,
			"additionalProperties": []
		}, {
			"name": "given_name",
			"source": null,
			"essential": false,
			"additionalProperties": []
		}, {
			"name": "upn",
			"source": null,
			"essential": false,
			"additionalProperties": []
		}, {
			"name": "email",
			"source": null,
			"essential": false,
			"additionalProperties": []
		}
	],
	"accessToken": [],
	"saml2Token": []
},

Install OneDrive Free Client on Gentoo without Root Permission

OneDrive Free Client is “a complete tool to interact with OneDrive on Linux”.

Install the D language compiler:

curl -fsS https://dlang.org/install.sh | bash -s dmd

Run the full source command provided by the output of the above install script.

Download OneDrive Free Client’s source:

git clone https://github.com/skilion/onedrive.git

Change to the source directory:

cd onedrive

Use the following command to edit the prefix defined in Makefile:

sed -i 's|/usr/local|/home/username|g' Makefile

Compile and install OneDrive Free Client:

make && make install

Deactivate the source command:

deactivate

Add ~/bin to your PATH so that you can run binaries in ~/bin without specifying the path. Ignore this step if you have performed it for a different program.

echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc

You can now run OneDrive Free Client with onedrive. To run it in the background, you can use:

screen -dmS onedrive onedrive -m

Run the following command to create a sync list, which let onedrive only syncs specific directories:

vi ~/.config/onedrive/sync_list

In sync_list (one directory per line):

Apps/Datasets-1/
Datasets-Prepare/

Adding Email Aliases to Office 365 Groups via PowerShell

This is a “hidden” feature that can only be added via PowerShell at the moment. And web admin portal won’t reflect the changes you made via PowerShell. That means you can only view alias for Office 365 Group from the following PowerShell cmdlet.

First log into your admin account with PowerShell

Set-UnifiedGroup –Identity [email protected] –EmailAddresses @{Add="[email protected]"}

Check if it works

Get-UnifiedGroup –Identity [email protected] | FL EmailAddresses

EmailAddresses : {smtp:[email protected], SPO:SPO_fa5eb50c-147e-4715-b64b-76af8be79767@SPO_f0712c15-1102-49c4-945a-7eda01ce10ff, smtp:[email protected], SMTP:[email protected]}