Office 365: Manage users by calling Windows PowerShell cmdlets from C#
This code sample helps you understand how to use the Windows PowerShell SDK to manage Office 365 users. The sample performs three Office 365 user-management tasks: Show list of all users in domain. Add users with required details to domain. Change basic details of existing user.