Create Document Library In OneDrive For Business

This blog will help you to create the new document library, List or sub site using GUI and Powershell.

This blog will help you to create the new Document Library under your OneDrive for Business account. You can get some basic information about OneDrive for Business at the following URL: Click Here 

Yes, OneDrive for Business is used to store your personal documents using your organization ID. Do you think no one can see your personal data from your OneDrive for Business account? Obviously, NO! Every SharePoint administrator can have access to your OneDrive account for troubleshooting and content recovery.

OK, so where I can store my confidential data in OneDrive? Is there any way to do that?

Yes, OneDrive has been developed using the SharePoint Schema, so obviously we can create another document library, list, and subsites.

But when you click the Gear button on the right top of the screen, you can’t see the site content option to create another document library or List.

SharePoint

Basically, you can access the site content using the below URL. From there, you can create the Document Library, List, or Subsite.

https://tenant-my.sharepoint.com/personal/thivagar_segar_Domain_com/_layouts/15/viewlsts.aspx?view=14

If you cannot access the Site Content using the above URL, we can create using the PowerShell. Before we begin with PowerShell, we require some prerequisite files that need to be downloaded on your system
  • SharePoint Online Management Shell - https://www.microsoft.com/en-in/download/details.aspx?id=35588
  • SharePoint Online Client Components SDK - https://www.microsoft.com/en-in/download/details.aspx?id=42038
    1. #Collect the Tenant URL  
    2. $TenantURL = "https://osspdy-admin.sharepoint.com"  
    3. #Get the User ID  
    4. $LoginName = "thivagar.segar@oss-pdy.com"  
    5. #Get the Password  
    6. $LoginPassword = Read - Host - AsSecureString "password"  
    7. #Mention the Library Name  
    8. $Libraryname = "Hidden1"  
    9. #Login the Admin Center  
    10. $cred = New - Object System.Management.Automation.PSCredential($LoginName, $LoginPassword)  
    11. Connect - SPOService - Url $TenantURL - Credential $cred  
    12. # Connect the OneDrive Account using Client Context  
    13. $Context = New - Object Microsoft.SharePoint.Client.ClientContext("https://osspdy-my.sharepoint.com/personal/thivagar_segar_oss-pdy_com")  
    14. # Copy the credential  
    15. $Credential = New - Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($LoginName, $LoginPassword)  
    16. $Context.Credentials = $Credential  
    17. # Create Library using new - object  
    18. $ListInfo = New - Object Microsoft.SharePoint.Client.ListCreationInformation  
    19. # Apply the library nae  
    20. $ListInfo.Title = $Libraryname  
    21. # mentione the Library Template numner  
    22. $ListInfo.TemplateType = 101  
    23. $List = $Context.Web.Lists.Add($ListInfo)  
    24. # add the Description  
    25. $List.Description = "Hidden Library"  
    26. #Update the list info  
    27. $List.Update()  
    28. "  
    29. $list = $Context.Web.Lists.GetByTitle($Libraryname)  
    30. $Context.Load($list)  
    31. # Execute the query to finalize the creation  
    32. $context.executeQuery()  

Once it is created, you can see it in your site content

SharePoint

So, when you are trying to access the hidden library, you can use the below URL structure like -

 https://osspdy-my.sharepoint.com/personal/thivagar_segar_oss-pdy_com/Hidden .