cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

A guide to creating a non-admin, admin centre for office 365

This tutorial will be posted in several parts as I get time to put them together. This first post will contain the first 3 parts, which mainly consists of getting the back end of the app ready to create new users and provide them licences. I decided to split the posts due to the amount of time it took me to put this one together. I understand this initial post doesn't actually touch on power apps yet, but it will. I just wanted to ensure I covered as much bases as possible. 

 

Bit of background info:

The app was created because I have managers at sites who request accounts/account changes all the time, but I don't want to give any of them admin centre access. The app allows me to create the requested accounts with the correct licences by simply accepting the approval email (which contains all of the right details of the account for me to check) and the log in details then subsequently emailed to the requester. 

In short, this allows any user given access to the app the ability to:

- Create new office 365 users and assign licences.

And, for users they create in this app:

- Change current assigned licences, update passwords.

- Block users, convert inbox to shared inbox, remove licences. 

Each action has its own approval process. 

 

 

 

Part Zero: Prerequisites

First off, its assumed you are a global admin to set everything up in this tutorial, and that you have the relevant licences for SQL, servers etc and that you have access to azure. It might be possible to set up a non-admin account to do this, but as this was a learn-while-you-build project, I wanted as little issues to solve as possible.  

 

Next, you will need a place to store the users you create within the app. I used an SQL database installed on a virtual machine in our azure environment, but I’m 99.9% sure this will work with an excel spreadsheet on SharePoint with a little tweaking. On the server, I have also installed the on-premise data gateway that allows me to access this SQL server in power apps and power automate.

The app currently only uses one table, which I have provided the code for below. Please feel free to make changes as you wish.

 

 

 

CREATE TABLE [dbo].[EmailUsers](

         [ID] [int] IDENTITY(1,1) NOT NULL,

         [Created] [datetime] NULL,

         [Department] [nvarchar](255) NULL,

         [First Name] [nvarchar](255) NULL,

         [Job Title] [nvarchar](255) NULL,

         [Last Name] [nvarchar](255) NULL,

         [Line Manager] [nvarchar](255) NULL,

         [Mobile Number] [nvarchar](255) NULL,

         [Modified] [datetime] NULL,

         [Office Location] [nvarchar](255) NULL,

         [Created by] [nvarchar](255) NULL,

         [Licence] [nvarchar](255) NULL,

         [User Email] [nvarchar](255) NULL,

         [Requested licence] [nvarchar](255) NULL,

 CONSTRAINT [PK_EmailUsers] PRIMARY KEY CLUSTERED

(

         [ID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO



ALTER TABLE [dbo].[EmailUsers] ADD  CONSTRAINT [DF_EmailUsers_Created]  DEFAULT (getdate()) FOR [Created]

GO



ALTER TABLE [dbo].[EmailUsers] ADD  CONSTRAINT [DF_EmailUsers_Modified]  DEFAULT (getdate()) FOR [Modified]
GO

 

 

 

 

When I originally built the table, it started out a lot smaller, but as I learnt how to do certain things extra columns were added which resulted eventually in column names like “licence” being used for licence approval state. This is because there is a significant delay in renaming columns and how long it takes to update in power apps when using the on-premise data gateway. It was also partially due to it starting out as more of a proof-of-concept project that ended up getting used.

The next thing you need to make sure you have is an Azure Automation account. The automation account has a feature called runbooks that will execute our power shell script for exchange online tasks, like converting an inbox to a shared one when a member of staff leaves. These runbooks can then subsequently be accessed in power automate, passing through any variable you wish to execute in any PowerShell you can think of. It’s a crazy powerful tool that I only discovered recently, and I will surely be exploring the possibilities of it in the future.

 

 

 

 

Part 1: User Groups and Licences.

 

Now that we have gone over the prerequisites we’re going to get started.

First off you’re going to create a user group. You will need to head to the azure portal to do this.

In the left side panel navigate to Azure Active Directory > Groups and click create group.

VinnyClegg_0-1681745417870.png

You can call this what you like, but in this tutorial I called mine AutomatedExchangeOnlineUsers. Set the group type to “security” and make sure the membership type is set to “assigned”. Make sure you set yourself as the owner and then click create.

 

Once the group is created, head back to the groups page in Azure Active Directory, search for your group. Click the groups name and make a note of its Object Id, you will need this later. On the left hand menu select licences, then add assignments.

VinnyClegg_1-1681745417872.png

 

Choose the licences you wish to automatically assign to this group. The first column is the licences, the second is the apps/licences that come with the selected licence.

VinnyClegg_2-1681745417873.png

 

Click Save.

I actually created 3 different groups for 3 different licencing options, which you will see later.

 

 

Part 2: Creating a flow to create new users and assign them to the correct group.

 

Head to power automate and create a new automated cloud flow.

 

Set the name to whatever you wish, and in the search box type SQL and then select “When an item is created (V2)” and click create.

VinnyClegg_3-1681745417874.png

 

Select your server, Database and Table name.

 

VinnyClegg_4-1681745417875.png

 

Below the box, click the little + sign and select “choose an action”, search for “Start and wait for an approval” and click the circled option below.

 

VinnyClegg_5-1681745417876.png

 

Complete this section any way you wish. All of the fields from the table can be pulled into this email. Below is what I chose.

VinnyClegg_6-1681745417879.png

 

Next, click the little + again and add a condition control

 

VinnyClegg_7-1681745417881.png

 

Set the value to “outcome” of the previous approval in the dynamic content option.

 

VinnyClegg_8-1681745417886.png

 

Type “Approve” in the value like below.

VinnyClegg_9-1681745417887.png

 

Under the If yes section, add a control again, but this time select “switch”.

 

VinnyClegg_10-1681745417888.png

 

This is where you will create separate paths based on how many groups you created earlier. If you set the “On” property to the “Requested licence type” column, you can create a separate path based on what is entered.

 

VinnyClegg_11-1681745417889.png

 

Under the first Case column, and find Azure AD Create User.

 

VinnyClegg_12-1681745417891.png

 

Complete the details as needed below. I used the table ID column to help the password be not easily guessable. Again, all of the fields are pulled from the dynamic content from the original table entry.  

 

 

VinnyClegg_13-1681745417892.png

 

Select the + sign and search for Azure AD Add user to group.

 

VinnyClegg_14-1681745417894.png

 

Here, you will need to enter the object Id of one of the groups you created earlier, corresponding to the licence type you are filtering by in this path of the switch. Set the User Id to the ID created from the previous step from the dynamic content option.

 

VinnyClegg_15-1681745417894.png

Add your next action and find Office 365 outlook – Send an email (v2)

 

VinnyClegg_16-1681745417896.png

 

Complete the email to your liking using the dynamic content. I made sure to set the “To” field to the “Created by” column, thereby emailing the log-in info to the original requester.

 

VinnyClegg_17-1681745417898.png

 

 

By default, this email will come from yourself. You can change this by clicking the …  and adding another account.

The last thing we want to do is update the original table and set the “Licence” column for the entry that triggered the flow.

 

Add another action below the email and search for SQL Update row (V2)

 

VinnyClegg_18-1681745417900.png

 

Set the server, database and table name to the correct details.

The “row Id” should be set to the id of the original table entry, and in the Licence column type “Approved”.

 

VinnyClegg_19-1681745417901.png

 

And that’s the main part of this flow completed. As you can see below, I created a path for each of the options I created. On a side note if you are going to have multiple paths, ensure you name each action separately. You need to add the new users ID in the “add to group” action from the flow path it was created on by selecting the right one in the dynamic content section, otherwise the flow will fail. Naming them makes it easier to identify the correct one.

 

VinnyClegg_20-1681745417905.png

 

As you can see, I have also added a delete row and send email action to the default option of the switch, which means any entry that doesn’t match one of the paths “Equals” fields, the row will be deleted with an error message sent to the requester saying along the lines of, the request was approved but their was a failure for some reason and the account has not been created.

 

Next, I set the “If no” section up from the original approval outcome. Like the default section of the switch, it deletes the entry on the table and sends an email explaining it was not approved.

VinnyClegg_21-1681745417906.png

 

 

Anyway, thats the end of the first post of the tutorial. Let me know what you think so far and i promise ill try to post the rest as soon as possible in this same post. 

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @VinnyClegg ,

 

Thank you for sharing such a good ideal.

 

Best Regards,

Bof

thanks, having to put it together in my own time so will be a day o two before I post more, but I've had so much help from this community in the past that I thought it was only right to give something I have found useful back. 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,137)