New to SharePoint? Finding yourself a little overwhelmed? This is the first in a series of posts about the most useful tools for both SharePoint developers and admins. Whether you're completely new to the game or you've been in it since the beginning, these skills are invaluable. I'll guide you through getting set up and point you toward resources that I find extremely helpful.
Today's Tool: PowerShell
Too on the nose? |
Once you have that installed, go ahead and start up an instance of Management Shell by choosing it from your list of programs. You'll notice that when it opens it points to a default destination. If we were going to run a script stored on the file system we would change it, but for now this is fine.
The nuts and bolts
Everything we do in PowerShell starts with what are called cmdlets (pronounced: "Command-lets"). Cmdlets are the building blocks of PowerShell scripts, and each one refers to specific functionality and may take various parameters. Examples of SharePoint Online cmdlets are:- Get-SPOSite
- Add-SPOSiteDesign
- Invoke-SPOSiteSwap
When it comes to SharePoint Online, the first cmdlet we need to use is Connect-SPOService. This is the gate we need to pass through every time we want to work with SPO, and we pass in the SharePoint admin URL as a parameter.
Inside the Management Shell console, type in the cmdlet and your URL as below and press Enter. When prompted, login using SharePoint Online Administrator credentials.
Inside the Management Shell console, type in the cmdlet and your URL as below and press Enter. When prompted, login using SharePoint Online Administrator credentials.
Once connected, the SharePoint world is your oyster! For instance, we can use the Get-SPOSite cmdlet without any parameters to return all the site collections in the tenant.
To return a specific site, use the -Identity parameter and provide the URL of the site. To return more information about the site, use the -detailed parameter.
There are cmdlets available for many basic processes, and PowerShell allows you to handle batch and routine processes quickly and easily. Now that you've gotten your feet wet, go forth and script! For the full reference, review the Microsoft Documentation.
Header Photo by Jo Szczepanska on Unsplash
Body Photo by Aaron Burden on Unsplash
Header Photo by Jo Szczepanska on Unsplash
Body Photo by Aaron Burden on Unsplash
Great information thanks for sharing such a valuable information
ReplyDelete