Install and Configure PowerShell for Office 365

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in today's show we're gonna talk about how you get you going with office 365 and PowerShell really how you install it how you connected to it and then just talk about some of the bits and pieces you need to know so you can start becoming effective with it should be fast should be fun but first our intro if that GM doesn't get you ready to learn I don't know what will my name is Shane young and I'm with bold zebras those guys and today's show will then dive into PowerShell for office 365 so you know there are guides out there how to get started I just want to kind of create this video to walk you through it it's been a long time coming quite frankly because I just it annoys me you know there's a lot of little pieces you got to tape it out to get this going so I thought I'd just make a video and do it with you all right well that's enough of the talking let's just jump right in so here I'm on my Windows 10 VM and what I'm going to do first is I'm going to open up my browser and I use Internet Explorer because it does the best it resize and make it easy for you guys to read and what we're going to do is run go to powershell office comm slash get started and hopefully i just zoomed in on that it was kind of a cool little animation but if not though there is a link down in the description as well so don't feel like you got to figure out what I really typed there if you're having a hard time seeing it anyway so with this with a site does it gives you all the pieces you need to do there's about four different things we're going to install and then they're also going to talk about all the scripts that we need to do to get connected and you know something's going to kind of walk you through it and help you piece it all together all right so the first thing to consider though is in order to do most of what we're going to do if not all of it is you need to be an office 365 administrator now there are some of the pieces like the SharePoint Online stuff or you could have like just SharePoint Online administrator access I'm going to do those pieces but generally speaking I'm going to assume you're in office 365 administrator to make this go easier also we first get into powershell we're going to talk about the execution policy because to run some of these commandlets you do have to have remote scripts enabled so we'll set that but we'll get to that when we get to the PowerShell portion all right so we scroll down here there are four modules that we need to get and so those four modules they've given us like nice cool links here so we're just gonna download each one so we'll hit download on the first one we'll just talk about what they are as we go and how to choose which pieces you might need all right so the page rodents we're going to scroll down here and we're going to hit download for the sign on assistant and then we get prompted do we want 32-bit or 64-bit well I'm going to tell you right now you just want the 64-bit so want to say 64-bit next Oh scary Microsoft what you want to do we're going to actually allow always with all pop-ups for his site it's just easier for the video sake alright so now we're prompted so I'm gonna hit save and now that that's done we'll hit run and so what the sign-on assistant is right is it's just some bits and pieces that provide a good experience for you getting authenticated because remember with office 365 you might have a personal account you might have a work account might have a school account and so because of that they have to kind of have a smarts net when you type in your past or your user name it figures out where it needs to go to authenticate you so we're going to accept this accept and hit install yes to my user access control and if you're wondering about the whole 32 bit vs. 64 bit thing most of the 32-bit stuff has been deprecated at this point so it's still out there but they're not investing new new efforts into that so generally speaking unless you have a specific reason to install a 32-bit you'll want to stay away from that all right so that looks like that's done so we'll hit finish and we can close this window step one is done step two we're going to download the Azure Active Directory module so we'll click on that we'll scroll down here to the install section and click on it you'll notice if you read all the fine print here it would actually tell you the 32-bit stuff's been deprecated I will point out that for me here you get the both the preview bits and the GA bits I generally just do the GA bits right I don't want to be beta testing this stuff especially if you're in the learning phase it's better around the GA right GA for general availability and so we're gonna hit download for that we'll do the same thing save again and the reason I save all these is maybe you want to give them to your buddy later you know so there I'll save my downloads folder make here take all this install it or just because it's what I do Iram anyway hit run we'll see next I accept next do not crash worked up on my desktop next and install there's our user access control again so yes for that and just like that we're finished now I will point out that I feel like this one's kind of Sweeting as your Active Directory connection right but I'm not doing Azure idea what do I need that for well a if you're doing office 365 in the background you do have azure ad components but B I would have named this something different because this can includes all your Commandments for not only editing your users but also licensing in general managing your whole subscription stuff so I would have called this like the office 365 PowerShell connector but you know they didn't ask for my opinion so what do you do alright so we'll close out of that and so next here we need to download the SharePoint Online module if you're watching my stuff you probably a SharePoint person anyway so you okay this is what I came for no good news here it is you can also check out the surface studio ah you can buy me one of those to say thank you for making this video be nice alright so we'll hit download for this guy same deal again I'm only going to install the 64 bit so check that box and next alright looks like that's done so we'll hit run alright we'll accept the Terms you guys are going to read all those right I'm sure you did thank you hit install another user access control pop up wonder how many of you've actually disabled those because you got sick of them not judging just asking and we'll hit finish the other thing that should be obvious here if you haven't caught on is that you do need to be a local administrator of your PC to install all this stuff so if you're not then you keeping those user access control boxes and you don't need to have the IT guy standing by to type those in for you a lot so hopefully you're so local admin but I didn't mean to cover that earlier so close this one one more thing to install and that is the Skype for business stuff hasn't been renamed like six months so it's pretty cool so we'll hit download for that one office 365 ad which is weird since we already have office 365 and while we're installing this but we won't judge wet download for that one and we will say save I almost click run now it made fun of myself ha there we go now we'll hit on more licensing terms for you guys to read seen some scary stuff bout not reading licensing terms cartoon comes to mind quick install this is the family show so we're going to talk about that cartoon so then say yes the user access control alright and so then that finished up so we'll hit close there alright so I guess all of our installing done yeah installing so then the next piece is we need to get connected and so to get connected they've also got a nice little page here so we hit connect and so when this opens it's going to show us all the different PowerShell we're going to needle scroll down a little bit do a little zoom in here as well make as big as I can and so and also they'll be you know you've got the link down there so you can get to this web page yourself so you're not really trying to type the stuff in with me right you should be cutting and pasting along if you want but what they've done here is they've given us all of the different little snippets because each one of those sets of commands we just installed has a different way for us to connect to that service online so depending on what piece you need on a given day you don't need to connect to that piece right you wouldn't always just come in start your day by connecting to all four or five of those for what you would do is you would actually say okay today you know you're going to solve the SharePoint problem so I'm just going to do the SharePoint connection pieces and kind of work through it that way so that's why it's kind of important we break down what these all do and before we can connect to anything we're gonna need to open up PowerShell so I'm gonna hit start and I'm going to type in power and I'm going to right click on my Windows PowerShell and run as administrator there's my user access control so we'll say yes now for a lot of people they just go ahead and set their power show to always run as administrator because quite frankly there's almost nothing you ever do with PowerShell that you're not going to need to be administrator for you can also see here that I went ahead and resized all my fonts and screen sizes to make it a little easier for you guys to follow along but like we said you're just going to cut and paste from over there so it doesn't really matter but either way I was thinking of you that's what I want the credit for I thought about you so there's that so the first thing I want you to type in this is not in the instructions but I want you to type in start transcript right we can use tab complete to finish that and hit it if you're not familiar with start transcript what that's going to do is it's going to write everything that we do in this session everything gets shown back on the screen to that text file right there so this has two purposes one is it gives you a way to figure out what you did after the fact if something goes wrong like you know you're like I don't know why our tenants are not here anymore we'll go look at the transcript oh yeah I deleted all the tenants in the transcript you wish you can solve the problem you have a running log of everything you've done in the environment the other thing is is you're probably in a learning state right you need to go figure out how to do this and how to do that I'm still in a learning State you know five or six years into my PowerShell career and so I just yesterday have solving all these problems in PowerShell the problem with it is I got to the mmm finished and if I just close the PowerShell window they're gone right that big old script that I spent four hours writing is gone forever if I'm using start transcript it's not gone forever it's in the transcript so really recommend you always just use start transcript every time you start a PowerShell window start a transcript okay so the next thing you need to look at is you need to do a get - execution policy right tab complete again is your friend and you can see that mine is currently set to a remote signed and so that is the permission level that your should probably add if you are at a higher level right where it's restricted you know disallowed all those different things I forget what the exact ones called you need to set it and so to set it you would do set execution policy and then just type in remote sign right all tab completed for me because in order for all these scripts to run you have to have that now maybe you've turned it off completely but we're not gonna get into that that'd be scary so don't do that so run set execution policy remote signed when you do that you'll be prompted to say hey did you really mean to make your security lower than restricted you did so hit yes and just remember it's got to be safe because you learned about it on the internet and everything the internet is true so okay so those are our two things start a transcript get our execution policy got it let's dive in and look at commands will do CLS first the query screen and now we're going to kind of do the whole switch back and forth with the browser so the first thing you want to do is you're going to to a set of variable where you're going to put your credentials in right I right-click with PowerShell and PowerShell to do the paste and so dollar sign credential equals get credential and hit enter it's going to prompt me for my username and password so I'm going to grab that over here I'm also going to blank it out so you people aren't stealing my count I know how you are now as you do this it's important to know that it's not validating anything at this point it literally just took whatever I typed in whatever username whatever password I typed in and put them into that variable so we don't know if it actually if I typed in the right thing or not if I'm going to have any errors until we use it alright so now that we've done that now we're going to import the module so import module MS online right this is the one that has all of the command le'ts for dealing with and interacting with your subscription so managing your users managing your licenses you know all that high high end management stuff and so we import our module and then once we import our module and that's what made the PowerShell commands available in the session now we're going to run this line connect msl a.m. sol service - credential and then our dollar sign credential so we're going to use that username and password we put in that first time we're going to cross our fingers that it works and we didn't get any error messages so now we're logged in and so to check that we are actually and everything's good what I might do is do get MSO L that's so hard to say Ms Oh L user so I knew a little tab complete there and hit enter and so there's all the loot wealth of losers no no they're not losers mail maybe but different story all the users in my subscription so that tells me we got connected we're in we're good and so now you guys could dive in and start learning about all the different fun powershell commandlets you might want to do if you want to see all the command which you had available you do get command right tab complete - module and then MSO hit tab there and it will populate that with MS online and so then there's all the command lists that we got from that module and because I like to show off my nerdy skills you can put those in some parentheses gotta find the home row keys Shane if you'd like to type dollars count as you can see there's 96 PowerShell commands available and it is it's all those high level users licenses and then kind of domain or office 365 subscription wide settings so there you go that's enough to get you started it that particular level so let's look at the next piece we can dive into so we switch back over here and now what we do want us to do is we're going to import the module link online connector I just a second ago they call it Skype what is this they like to keep us guessing Oh before we do that that will quit screen all right we'll paste that in and says eh that one does when RM service is not running in order for this to work you need to run okay so I yes there all right so now that module has been done and so then now we're going to do is we're going to create a session so for the link stuff and for the exchange stuff you don't actually run the PowerShell here locally it's actually creating a remote session to your link server out there in the magical cloud so you have to keep that in mind there's two reasons for that one is because you have this weird connection process but two you can only have three of these connections per subscription so if you want make sure you always shut them down right we'd like the sharepoint online stuff you can just close powershell life is great with this one we're actually going to need to remove the session when we get done with it so there's my dollar sign link session and so then here's the line where we import that session so a trouble copy paste that in and so there you can see it's sucking all the stuff across the wire and so then it pulls in this weird name and you'll notice that every single time you import the session you're going to get a different module name don't don't overthink it and speaking of not overthinking it right so when we downloaded it was called Skype for business we set up a link session but now all of our commandlets are CS for good old communication server so you know links got some baggage here don't don't just don't overthink it but now that we are connected what I probably do is put the cursor over here so you could see what I was doing I know just get CS online Oh online user and so this would scroll for a week and a half so I'll hit control C there but that's going to show you that yes you're connected to your link session there's all your users same type of deal if you wanted to see all the commands available what I would do is I do get module here so there's all the modules and then there's that weirdo name and the modules we just imported so we're going to do is do a git command dash module type in TMP hit tab and so then there's all of the PowerShell module or all the powershell commandlets available to do your Skype for business or Lync or communication server or office communication server whatever name you'd like to call it there's a command what's for it you could do the same thing run the count command again I forget how many there are there's a few but remember when you're done with this the one thing I need you to do because you want to free up the resources so they're there either for you or for the next guy whichever maybe I need you to do a remove PS session and then you would do the Lync session so then that shuts down that connection now I can't running that powershell commandlets right if I do the git command or get CS online user it's like what do you mean I don't know what that is because all that stuff's been removed so got us into Lync got us out got it or Skype whatever call it whatever you want all right so that covers Skype now let's talk about the SharePoint stuff so we'll grab this guy and so step one will be to import the module for that well step one really will be to quit screen I'm going to import the module for that you do get this message right some of the commands use inappropriate verbs I don't know it's Microsoft why I didn't use the right verbs I don't know if you don't like error messages like that I know that it freaks out some people especially when I share my scripts with people if you do - just say name checking then when you import the module no errors there you go there's a tip yeah me alright so now that that's done you'll need to connect to the SPO service with this one you're going to need to use your own PowerShell right because you need to replace contoso with your office 365 domain so over here I've got I grabbed mine so connect SPO service URL there's my URL and then credentials is the credentials we used min ago so we hit enter and cross your fingers boom everything came out so life is grant so now we're connected and then you know just do something like get SPO site and so there's a list of all the site collections in my tenant so that I know I'm in there now with the SharePoint PowerShell stuff it's worth mentioning that the PowerShell foo that is here is about 56 commandlets it's pretty weak especially if you've ever done anything with SharePoint on-prem powershell for sharepoint you're like hey yeah there's a lot I can do there most of that stuff will not work here so to do that what you're going to do is you need to install the patterns and practices powershell commandlets so it's available for Microsoft I'll put a link down below but the good news is I'll also put a link to I'm going to do a video tomorrow so you know probably after you've already seen the video but I'm gonna do a video tomorrow on how to install those commands because they're also slightly different but they are infinitely better than the powershell commandlets the microsoft gives us through the process we just walk through so have these look at these they can do some core stuff you know creating new site collections that type of stuff but they're not going to do a lot of the fancy stuff that you want to do like edit list items or create lists or that type of stuff and so with the patterns and practices stuff I'll create some videos that show you how to do that but anyway this gets you the core stuff that you thought you were looking for now you want more huh watch a different video alright so that gets the SharePoint stuff done last piece we're almost done folks is we need to connect to exchange so exchange is another one that is a lot like link and that we're going to actually run a remote session from the server in the magical cloud so we'll clear our screen off here and we're going to run just the PowerShell this gave us that URL is the same for all of us so you don't have to worry about updating your URL or adding any of your bits to that right and it's just using our credentials that we said earlier to get that set up so once you've done that now we've created the session and then now we need to import the session and so there you go is pulling all the stuff across the old internet again all right same type of deal you got the whole some of the commandments aren't perfect you'll also notice that once again the module it pulled in is a wierdo temp underscore name that they use the same as the last guys so same type deal if you wanted to see what command what you now have available you do - command module TMP and then tab make sure they match right because if you hadn't gotten rid of the Lync session then there would be a link one that has that same TMP start but I do not so we're good there and there you go all your mailbox management I'll give the exchange guys this there are a lot of command lists there there's a lot of power around creating your mailboxes and such but generally speaking to do any of that you know your script will need two pieces right you'll need the MS unless oh L scripts to create a user license a user and then come in here and create a mailbox for them right that be kind of an automation process so that's why we talked about all the different modules you need because you have to kind of mix and match them along the way to do you know actually solve real world real world problems so there we go and see my exchange stuff is working and so the last thing I'll remind you you know we could do I could get mailbox I guess just to prove that I'm really in there so there's all people with mailboxes in my domain so the last thing I just want to remind you guys about is that you will need to get rid of that session so to get rid of session we're going to do once again we're going to remove PS session and then you just need to use the same variable that you use to create the session the reason I point that out I realize that sounds like Captain Obvious stuff but most of the scripts you see on the internet to remove session always just say remove PS session dollar sign session but you don't have a dollar sign session because using the scripts that you just got from Microsoft there you did remove PS or you created it as exchange change easy for me to say session so you need to remove that session all right so I think that covers everything I wanted to cover right now you know how to get in and manage all the different components of office 365 you've got them installed and you know how to kind of touch them in future videos I'll start solving some real-world problems like I said the next video we'll be installing the patterns and practices the SharePoint stuff and get you some scripts for that and then from there I'll be able to point back to this series and say hey if you have problems getting installed there you go alright so I thank you for watching today hopefully you enjoyed it if you need any help you can always ask down in the comments you can hit me on twitter at chains cows or if you need some consulting with this which it turns out lots of people need help automating this stuff that's one of the things I do with these guys over here bold zebras so hit me up and we can make fun videos together alright thanks have a great day
Info
Channel: Shane Young
Views: 43,587
Rating: 4.9346051 out of 5
Keywords: SharePoint, PowerShell, PowerShell for SharePoint Online, SharePoint online, SharePoint Online PowerShell, Office365 PowerShell, O365 PowerShell, Install PowerShell, PowerShell Office 365, Office 365 PowerShell, Office 365 PowerShell Tutorial, powershell basics, powershell for beginners, microsoft office 365 (software), Bold Zebras, Shane Young, Import-Module LyncOnlineConnector, Import-Module MSOnline, New-CsOnlineSession, Import-Module Microsoft.Online.Sharepoint.PowerShell
Id: rEy2mlFVWa4
Channel Id: undefined
Length: 23min 15sec (1395 seconds)
Published: Wed Nov 02 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.