Friday, 7 April 2017

Create a sub-site in SharePoint online

Creating subsite in SharePoint, it's a common need. Say we are creating a site structure for an organization where there would be a root level site and inside this different dedicated site for each department say HR, Finance, Admin etc.

Step 1: Login to the site where you want to create a subsite.

Step 2: Now go to the all site contents by clicking on the gear icon in top ribbon and click on "Site contents".




















Step 3: In the all site content page you would be able to a "New" button as shown below. Click on it and select "Subsite".













Step 4: This would bring below form and you need to fill:

  • Title and Description - Name of the site and short description
  • Web Site Address - provide the url address
  • Template - Choose correct template as per your need, for me I have selected team site template.




















Once done click on "Create". Here you go, your subsite is ready !!!

Restore deleted SharePoint online site collection using PowerShell

Have you deleted a SharePoint online site collection by mistake ? You are in worry now !!! Please follow the below steps to restore it.

Open SharePoint online management shell(check here for help) and follow below steps.
  • Type below command replacing the url with your SharePoint admin center url. Please note word -admin in the url, you can place it by typing or copy the url directly from browser by navigating to SharePoint admin center. To know how to navigate to SharePoint admin center you can check here.
          Connect-SPOService -Url https://companyname-admin.sharepoint.com
          
         After hitting enter it will ask for credentials. Provide the credentials and click OK. This user
        must be a member of the tenant’s Global Admin or SharePoint Administrator role.
  • Then type below command by placing correct url of your site collection.
        Restore-SPODeletedSite "https://companyname.sharepoint.com/sites/yoursitecol" 

You can also check how to restore SharePoint online site collection manually.

Restore deleted SharePoint online site collection


Step 1:
Login to Microsoft portal and navigate to SharePoint admin center.(check here for help)

Step 2:
Click on the "Recycle Bin" and you would be able to see your deleted site collections. Now you need to select the site collections you want to restore and click on the "Restore Deleted Items" in ribbon menu.



Thats it, site collection restored !!! You can also check how to restore deleted SharePoint online site collection using PowerShell.

Sunday, 2 April 2017

Delete SharePoint online site collection using PowerShell

Sometimes we come across a situation that we need delete a SharePoint online site collection, might because it was created by mistake or later decided it needs to be removed.

Open SharePoint online management shell(check here for help) and follow below steps.
  • Type below command replacing the url with your SharePoint admin center url. Please note word -admin in the url, you can place it by typing or copy the url directly from browser by navigating to SharePoint admin center. To know how to navigate to SharePoint admin center you can check here.
          Connect-SPOService -Url https://companyname-admin.sharepoint.com
          
         After hitting enter it will ask for credentials. Provide the credentials and click OK. This user
        must be a member of the tenant’s Global Admin or SharePoint Administrator role.
  • Then type below command by placing correct url of your site collection.
        Remove-SPOSite "https://companyname.sharepoint.com/sites/yoursitecol" 

You can also check how to delete SharePoint online site collection manually.

Delete SharePoint online site collection


Step 1:
Login to Microsoft portal and navigate to SharePoint admin center.(check here for help)

Step 2:
It would list all site collection those were created already. You can select the one that you want to delete and click "Delete" on ribbon menu as displayed in below screenshot.



Sunday, 19 March 2017

Generate a report based on allocated storage and current usage of SharePoint online site collection

This is a common requirement often we come across to generate a report on how much storage allocated to each SharePoint online site collection and currently how much it consumed. This helps to in organizing the site collection, allocating storage and planning for the near future growth of the site collection size.

I had explained how to export Title and Url details of all SharePoint Online site collections present your tenant in my previous post Export SharePoint online site collection lists to file using PowerShell.

So you can execute till Connect-SPOService command as per my previous post. After that we would do a small modifications in the "select" to include StorageQuota, StorageQuotaWarningLevel,
StorageUsageCurrent as below.

$siteCollList = Get-SPOSite | select Title,Url,StorageQuota,StorageQuotaWarningLevel,StorageUsageCurrent
$siteCollList > D:\SPOSiteCollExport\SPOSiteCollDetails.txt

After successful execution it would generate the file with all properties mentioned in select.

We can also extend our scripting to export it to CSV so that it can be used in excel to prepare further representation in graph or so. Or even we can generate a html file with some formatting and color coding based on StorageQuota or StorageUsageCurrent etc.

Export SharePoint online site collection lists to file using PowerShell

Sometimes we come across this requirement to provide a list with all SharePoint online site collection details with name and url. This is basically used for report or information purpose.

So we need to extract this information to a file so that can be sent through an email or uploaded to a SharePoint library and shared easily with someone.

To do this we will use SharePoint Online Management Shell. I have mentioned how you can open SharePoint Online Management Shell in this post.

Now open SharePoint Online Management Shell and do the following:
  • Type below command replacing the url with your SharePoint admin center url. Please note word -admin in the url, you can place it by typing or copy the url directly from browser by navigating to SharePoint admin center. To know how to navigate to SharePoint admin center you can check here.
          Connect-SPOService -Url https://companyname-admin.sharepoint.com
          
         After hitting enter it will ask for credentials. Provide the credentials and click OK. This user
        must be a member of the tenant’s Global Admin or SharePoint Administrator role.
  • Then type below 2 lines of script by replacing the folder path with the one where you want to generate the file "SPOSiteCollDetails.txt"
        $siteCollList = Get-SPOSite | select Title,Url 
        $siteCollList > D:\SPOSiteCollExport\SPOSiteCollDetails.txt

After successful execution it would generate the file with Title and Url that looks like:












In my next post we will see how to generate a report based on allocated storage and current usage of SharePoint online site collection.