powershell
860 Topicsadd user to SharePoint group via PowerShell error
Hi, I'm trying to use PowerShell to add a user to an existing SharePoint group. I ran the following to connect to the SharePoint site: Connect-SPOService -Url https://site1-admin.sharepoint.com This prompts me to login, password and MFA code. Afterwards I type in the following to add a user: Add-SPOUser -Site https://site1-admin.sharepoint.com/sites/company -Group "Company Info Members" -LoginName mailto:email address removed for privacy reasons There is a SharePoint group with the name "Company Info Members", which I want to add mailto:email address removed for privacy reasons to. But I get the following error: Add-SPOUser : Unknown Error At line:1 char:1 + Add-SPOUser -Site https://site1-admin.sharepoint.com/s ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Add-SPOUser], ServerException + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.AddSP OUser I was wondering what could be causing this error. I searched for the error on Copilot and it suggested I use "PnP.PowerShell". But I'm having some issues installing this app. I was wondering if there are any suggestions I could do? Thanks! Jason79Views0likes3CommentsAutomate "Run Report" in Setting > Site usage on Multiple Sharepoint Sites
Hi How can I automate the "Run report" across multiple SharePoint sites? Idea: Run the report on multiple SharePoint sites Collect the reports Preferably using Service Principal or Managed Identity Generate them automatically at the end of each month Has anyone done something like this before? Many thanks71Views2likes2CommentsIs it possible to disconnect a site from an O365 group?
I'm interested in keeping a site collection that is connected to an Office 365 group, but I want to delete the group and "disconnect" it from the site (basically the opposite of what is possible when you "groupify" a team site). Does anyone know if this is a PowerShell command?40KViews0likes12Comments- 44Views0likes1Comment
How to grant access to SharePoint subsite with no Owners
Hello! Can someone advise how I can add a user to a SharePoint site with no Owners/Members or Admins? It is a Classic SharePoint subsite so I cannot modify any settings using the SharePoint Admin Centre so I need to find a script or a method of some sort to allow me to add a user account to the site to then be able to review it/decommission it etc.? TIA!Solved80Views1like2CommentsMaking Home Page a Template to Be Used Across Sites
Our team is looking for help with reusing a customized SharePoint page. I created a home page on a SharePoint Teams site (not a Communication site) and would like to save it as a template so we can apply it to other sites across the tenant. The page includes layout sections and various web parts, and ideally we want to replicate the same setup on other SharePoint sites. What’s the best and supported way to export or save this page as a reusable template and apply it to other modern SharePoint sites? We are open to using PnP PowerShell or other supported tools, but we’ve run into authentication issues when trying to connect via app registration. Would appreciate step-by-step guidance or a recommended approach. Thank you!229Views1like5CommentsSharepoint Online Templates / Provisioning.
Hello everyone, I have a SharePoint online site that is as close as possible to being a template for my tenant. I'd like to save this site and make it available to me when I need to create a standard site for my tenant. Do you know if there is a possibility to save it and then pick it in the SharePoint list of templates in the creation phase in SharePoint? I know there is a PnP solution; however, after trying it I've had some bad results when trying to use a script with Get-PnPSiteTemplate many times it doesn't replicate the site correctly. I essentially need to take one SharePoint site, and just replicate the structure, DLs, Lists, Views, pages, designs, colours and thumbnails, no files needed. Possibly saving it as a template, but if not possible, just provision it via PnP PowerShell would be enough. Do you have any suggestions or scripts to recommend, or can you point me to any resources?220Views1like7CommentsSharePoint PnP Search Results
Hi! Does anybody know how to use the Query Template and Refinement Filters part in PnP Search Results to exlude pages from the search? I have a Knowledge Hub and created a search page. The Search Result webpart (before i do a search) shows everything in the Site - and i don't want that. Idealy i will have it blank till a Search word is entered on the Search Box, but has not been able to do that, so i was thinking if maybe using the Refinement Filters i can exlud pages that are just templates. I do have "FileType:equal("aspx") but i don't know how to say Title does not contain "Main" i tried so many different things i found online and nothing seems to work. Any clues? thanks2.9KViews0likes3CommentsSharePoint Template Copying
Hello Community! I am working to copy over a Site Page Template upon a list form request! Users will fill out the name of the item they're looking to create a Notice template for, and then power automate copy's the template and updates the metadata. When I update the metadata, it still shows with the name of the template page I originally copied. The following shows this happening with a template page created by copying 'CarrierNoticeTemplate' The first image shows the template titled "Test Notice", when being selected within the Page Gallery. Second image shows the template titled "Test Notice", within Site Pages. Any help would be very much appreciated.134Views0likes2CommentsClarification on StorageQuota and BonusStorageQuotaMb in SharePoint Online (CSOM / PowerShell)
I’ve been using CSOM and the Get-SPOTenant PowerShell cmdlet to retrieve storage-related data for my SharePoint Online tenant. I noticed that the StorageQuota property accurately reflects the total storage available. However, I plan to purchase additional SharePoint Online storage and would like to clarify: Will the newly purchased additional storage be included in the value returned by the StorageQuota property? I also came across another property called BonusStorageQuotaMB which does not have any documention and seems like new one too— could someone please explain its purpose and how it differs from StorageQuota? Understanding how these properties behave is important for me to monitor and report tenant storage accurately. Thanks in advance for your insights!58Views0likes0Comments