Power Automate Add Azure AD users and managers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi this is Laurie B and in this video we're gonna look at how to use peril to mate to populate my azure active directory so here we start in and azure active directory it's completely empty okay we've got an excel file that lists all my employees and the hierarchy that they all fit in okay and we've got some calculated columns turn off the email addresses and what their managers email addresses so let's go and create ourselves a flow so new flow instant from blank and employees and we'll manually trigger it and let's click create so my first step let's organize this float a little using some scopes so we're gonna the first scope we're going to do is we are going to get the employee data okay so let's add an action into their Excel list rows present in a table okay and if we come into here it's an onedrive document library onedrive little folder pick my excel file okay and on the tables pic employees right so that's that done okay I'm then gonna add a new step which is gonna be another scope and we're gonna add an action into here now we want to loop through every employee so I'm gonna go for a control and we're going to go for and apply to each so into here we put value okay then we're going to click add an action and we're gonna have a look at the azure ad and there we are azure ad what actions have we got let's go down a little bit there we go second one down create user so account enabled let's go for yes it's a display name okay so control spacebar to bring up the dynamics and I'm gonna put in their first name space their last name okay mail nickname let's put that in is the first password okay now this can be anything you like I'm gonna put in red monkey one two okay I use a different password every time so believe me straight after this that password will not be the password it's being used okay so their user principal name is going to be their email their given name it's gonna be the first name and their surname is gonna be their last name okay so show advanced down here gives you options for more things so I'm gonna put in the department I've got that as well the job title with God as well mobile phone haven't bothered obviously ocation I've got a location column okay right so that creates the user and that's looping through them all so let's quickly rename that scope add users okay so let's go and put in a new scope new step and that's gonna be another scope and then to this I'm gonna rename that to be add organisation okay so in my data I've got some people who haven't got managers okay I've got one person who hasn't got a manager they're the top of the hierarchy is Tonya she's the chief exec okay so I the first thing I need to do is I need to filter it so that I don't try and give her a manager because that will fail so add an action we're gonna filter okay filter the array and the array we're gonna filter is that one there and we're gonna go for that I want the manager dull is not equal to and I'm gonna leave it blank okay now he filtered the array we can look at using that list to add managers so we're going to add in an action we need to loop through them so it's a control and and apply to each okay output from the previous steps if you look down here we've got a body from the filter array let's put that into there and let's add in an action okay so the first thing we want to put into the first thing I want to put in it that's gonna have a look at us you're 80 can't spell today those either watch my videos you'll know that I never can spell so that's fine normal normal situation here and we're going to go for a sign manager right user ID or principal name well I kind of got that because I've got the email address of the user so that's fine use your idea of a manager well there isn't the UPN in that I can't use a user principal name in that so I'm gonna have to get the ID so we all have been add in a step now my issue here is I can't add in a step in to hit there is the plus button at the top hit so I'm gonna add an action below it and then I'll swap the order right now given that we're doing as your stuff you go and have a look at the azure ad actions and if you type into here get user you'll see there is a get user it'll give you an ID Wiggly it doesn't work okay so that took me hours so just to save you some pain here don't use the get user as your ID here it doesn't work so I put in a bug I happen at a report I'm sure it is something that will get fixed soon so instead we're gonna add an action because there's an alternative office 365 users comes up with one as well so we can get a user profile and into their I'll so now I can swap around so I can drag that underneath so they are the soft round so into here I want to better put in they managers email write a no control spacebar to get up the dynamic stuff but I don't get anything from that filter array doesn't come through so what we're gonna do all right there are a number of ways to solve for this but we're gonna do it by using the function method and we're gonna bring in the item function okay and then after the item function you put in some square brackets you put in an apostrophe and you put in the name of the column you'd like get it right okay and then we are going to assign a manager so into your site manager step I can from here so the email address of the user so we're going to use the same technique we've just used the best the effects button and I'm gonna put an item okay and this one is just called email it's a lowercase M right and this one here if I search for ID there you are get user profile ID right so we have our get the employee data and the users add the organizational in chart details now what I'm gonna do just in case the last person we out there is the manager of the first person we try to up their takes a little while for that to happen so we're gonna put into here and an action over delay and all I'm gonna do is a delay for 30 seconds because that appears to work right so I'm gonna click Save let's confirm we've got no users let's press test save and test it confirms all the connections we're going to use let's press continue and let's click run flow and done and there we go a completely successful run okay so we can come into here look at our list do a quick refresh and there you are I have a complete organization and let's just go and check one of the people so let's go and check Amy ash and they are Amy ash has a manager Alice Archer so is building a as your 80 directory from an excel file using parallel to meet if you haven't already please press subscribe take care now
Info
Channel: Hat Full Of Data
Views: 3,944
Rating: 5 out of 5
Keywords:
Id: BdpzWYOePQ4
Channel Id: undefined
Length: 11min 14sec (674 seconds)
Published: Tue Apr 28 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.