Office 365

Create A Custom Email Address for External Office 365 Users

With SharePoint Online, you can create sites that external users can log into and access. This is great for things like sharing documents, with a lot more functionality than a plain file download and upload like Dropbox.

Unfortunately, there isn’t an easy way to create a manual user, but have notifications go to their external email address. When you create a user in Office 365 or Azure AD, they have to be set up with one of your valid, owned domains.

There is a way to modify the ‘Work Email’ field of a cloud user, which is then used by SharePoint Online to send notifications and updates to whatever address they want – but at the time of writing this, can’t be done via the webpage GUI, nor by native PowerShell commands.

There is a way though, thanks to a script written by Ivan Yankulov called “Script to Write and Get User Profile Properties in SharePoint Online with CSOM

The script uses the API’s of SharePoint Online to make changes to users, but read Ivan’s explanation of it on his blog if you’re interested in understanding how it works.

 

These instructions assume you’ve already created the user in Office 365/Azure AD.

Log on to SharePoint Online as user: http://yourwebsite.sharepoint.com

Install SharePoint Online Client Components SDK

Download script Script to Write and Get User Profile Properties in SharePoint Online with CSOM

To get user’s details (need to be an Office 365 Global admin, and use standard PowerShell to launch the .ps1 file from the script above):

.\Get-SPOUserProfileProperty.ps1 -accountname “[email protected]” -spoadminportalurl “https://yourdomain-admin.sharepoint.com” -username [email protected] – password xxx

If you don’t specify the password in the command line, it will prompt for credentials (which is fine). This will make sure things are working, and you’ll see all the fields of that user

To set user’s details:

.\set-SPOUserProfileProperty.ps1 -propertyname WorkEmail -accountname “[email protected]” -value [email protected] -spoadminportalurl “https://yourdomain-admin.sharepoint.com” -username [email protected] -password xxx

This is fine on a single user basis, but can also be scripted:

$data = import-csv -path C:\Temp\userdetails.csv
foreach ($user in $data){
.\set-SPOUserProfileProperty.ps1 -propertyname WorkEmail -accountname $user.UserPrincipalName -value $user.EmailAddress -spoadminportalurl “https://yourdomain-admin.sharepoint.com” -username [email protected] -password xxx
}

The password is specified in this script because you’ll be prompted for the password on every single user change. You can always save this script, add your password, run the script but not save the changes.

The CSV file used is the same as my last article Office 365 and PowerShell Cloud User Creation

DisplayName,FirstName,LastName,Password,EmailAddress,UserPrincipalName
Richard Sole,Richard,Sole,ILovePSv4,[email protected],[email protected]

If you have any issues getting the above working, feel free to ask in the comments below.

Office 365 and PowerShell Cloud User Creation

Getting started with Office 365 and Powershell can be a bit confusing, partly because so many aspects have changed in a short time. This is really for my own notes, but I’ve made it generic and may help others:

Here’s a very brief rundown on how to set yourself up and start creating cloud users. For internal users, DirSync/AzureAD is a much better option, but you may have requirements for external parties to access your Office 365 environment in some way.

Install Microsoft Online Services Sign-In Assistant for IT Professionals

Install Azure AD Module

Launch Azure Active Directory PowerShell

Test connectivity to Azure/Office365 by adding account using command “connect-msolservice” – will get prompted for credentials.

Check you’re connected with a command such as “Get-MsolCompanyInformation”

Create a CSV with your users such as this:

DisplayName,FirstName,LastName,Password,EmailAddress,UserPrincipalName
Richard Sole,Richard,Sole,ILovePSv4,[email protected],[email protected]

Run this script which will prompt for Azure credentials. This one is hardcoded for the AU region, but can be added as a variable to the CSV.

Connect-MsolService
$data = import-csv -path C:\Temp\myusers.csv
foreach ($user in $data){
New-MsolUser -FirstName $user.FirstName -DisplayName $user.DisplayName -LastName $user.LastName -Password $user.Password -UserPrincipalName $user.UserPrincipalName -UsageLocation AU
}

Users are now created in Office 365!

You can store the credentials to be used, or use a certificate – this Azure article shows how https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/

 

Office 365 Chat on The Register

Hi,

I was invited by Trevor Pott @cakeis_not alie to be involved in an event on The Register to discuss Office 365. I’ve had a 1 year’s subscription thanks to Microsoft, so decided to accept. It was quite interesting to do, but also nice to see we all had similar ideas on the questions raised.

The feed of the live chat is available here:

http://www.theregister.co.uk/2013/06/18/office_365_livechat_promo/

Phoummala Schmitt @PhoummalaSchmit and Aaron Milne @wigginsix were also in on the chat. Hopefully more come up in the future!