Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [powershell]

Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.[except from WikiPedia]

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Connect-SPOService broken Popup: The remote server returned an error: (403) Forbidden

when I run Connect-SPOService -Url https://xxx-admin.sharepoint.com I get a dialog box asking me to pick an account I click on + use another account and then I enter my admin email address It shows ...
Doug P's user avatar
  • 1
0 votes
0 answers
16 views

Using Powershell to copy content type columns from one site to root site collection in Sharepoint Online

I have created a powershell script that takes a sourceSiteURL and sourceContentTypeId and then copies all of the columns from the sourceContentTypeId into the provided destinationContentTypeID located ...
Scott B's user avatar
0 votes
0 answers
15 views

SharePoint 2019 - List Contents of a subsites

I'm a beginner in PowerShell. Is there a way to list all contents (library, word, excel, ppt, list, calendar,...) of a sub site SharePoint 2019 with PowerShell please?
Poule's user avatar
  • 3
1 vote
1 answer
46 views

Add-SPOOrgAssetsLibrary : Attempted to perform an unauthorized operation

I need your help. I am trying to create an assets library and always get the following error: Add-SPOOrgAssetsLibrary : Attempted to perform an unauthorized operation. I am already registered as ...
Nicolas's user avatar
  • 11
0 votes
0 answers
19 views

Power Automate Trigger Condition Action rate limit is exceeded;

I have a column named "Tracking Number" in my SharePoint library, and I want to run a flow only when the Tracking Number contains a semicolon. The issue is that I built a flow to replace ...
Harris's user avatar
  • 595
0 votes
0 answers
26 views

List all user's of all group of all sub_sites

I search help about a pws script on sharepoint 2019 (not Sharepoint online) I want to list all sub-sites of a collection with all the groups associated (with kind of the groups) and all members in ...
PoulePouilleuse's user avatar
0 votes
0 answers
8 views

How do I insert SharePoint metadata into PowerPoint presentation?

I use custom metadata in several libraries for Word documents. Using QuickParts and then Document Properties I can insert those metadata tags directly into the document. Now, some of our documents ...
Jay Babcock's user avatar
0 votes
0 answers
8 views

how to go through each field

Is there anyway to go through each field in the target list (both source and target list is identical) and update? so i have this code but i dont want to program fields manually. # Load SharePoint ...
Susan Howard's user avatar
0 votes
1 answer
30 views

Restrict PnPSearchQuery to just site and subsites not all tenant sites

I had a request from some co-workers to build them a PowerShell to search sites for instances of text that is not accessible so they can replace it. Specifically NA or N/A. I have a PowerShell working ...
OMGDrAcula's user avatar
0 votes
0 answers
37 views

PnP PowerShell - Update list fields from CSV file

I have the following code and it has been working. Now our company merged and my computer is with the new company domain. New company don't have access to our SharePoint and it seems like it also want ...
maria's user avatar
  • 1
0 votes
1 answer
57 views

what's the best way to get all Teams owners and members

Is there a way from admin center to export all teams owners and members to a CSV file? I can't run the following code b/c I think it depends on graph api and it might be blocked. # PowerShell script ...
maria's user avatar
  • 1
0 votes
1 answer
38 views

Programmatically get shareable link to updated folder (PowerShell)

My goal is to upload approximately 10,000 folders to a SharePoint library (call it T2) and create a list in SharePoint (say T1) that lists these folders along with other details and their ...
user1375452's user avatar
1 vote
2 answers
118 views

How can I use PnP Powershell to enable custom script in a subsite?

My problem is enabling custom script with DenyAddAndCustomizePages. A two-line script can describe my problem. Background: I was using Set-SPOSite to enable it like this: Set-SPOSite $SiteURL -...
IshRashad's user avatar
0 votes
1 answer
27 views

Copy site root libraries and sub libraries with all permission using Get-PnPSiteTemplate

Our SharePoint sites have yearly structure like 2024->subfolders. When I use below PowerShell code to copy existing site template to new site then I am getting only root folders created. Each root ...
Max's user avatar
  • 1
1 vote
0 answers
17 views

How to reference mapping file in SharePoint to sgus [closed]

In ShareGate, anyone knows how to map users to a file instead of writing out each user mapping in the PowerShell script? Found the answer. pls delete.
manny's user avatar
  • 11
0 votes
1 answer
25 views

SharePoint online default templates

I created 50 pages using the SharePoint online template called Blank. This has a header / title webpart at the top which we do not want. Does anyone know of a way to remove this webpart from all the ...
Scots_nerd's user avatar
0 votes
0 answers
12 views

Creating a List Column with SharePoint Online Management Shell

I need to create a few columns on a SharePoint Online List, I've been following this guide and with the following basic script I get no error, but also no column is created: $FieldID = New-Guid $...
Danyx's user avatar
  • 151
0 votes
1 answer
119 views

how to upload a file to a document library using OData in PowerShell with curl or Invoke-RestMethod

As I cannot use Pnp.PowerShell with a SharePoint-2019 on premise, AFAIK, I've been trying workd with OData instead, using curl (or PowerShell Invoke-RestMethod or falling back to JavaScript fetch if ...
jgran's user avatar
  • 13
0 votes
0 answers
26 views

How to Restrict Default User Permissions for New Public Sites in SharePoint Online?

SharePoint Online admin here. In our organization there are several thousand users and even more SPO sites. We are trying to tackle challenges with site permissions that potentially expose us to risks ...
Mike K.'s user avatar
0 votes
1 answer
49 views

Is it possible to remove/hide/remove the "Stock Images" in SharePoint Online webpart?

I have a requirement to hide or not show "Stock Images" and "Web Search" etc when selecting an image to a web part. Is it possible to do that using PowerShell or some command? I ...
naijacoder's user avatar
  • 4,282
1 vote
1 answer
29 views

How to recognise the differance between a "News Post" and a "Page" programmatically with PowerShell?

I have an intranet and try to get the statistics of News Posts. I have now this PowerShell script below where I do a search query and get some metadata. Is there some attribute where I can recognize ...
KEM's user avatar
  • 13
0 votes
0 answers
52 views

Import and overwrite SharePoint list with Powershell

I'm using Export-SPWeb to export list from one Sharepoint site collection and Import-SPWeb to import this list to another site collection. I need to do it regularly and that the list and all data in ...
Katia's user avatar
  • 3
1 vote
1 answer
109 views

Issue Creating Org Assets Library (CDN)

I'm attempting to create an organizational assets library for use with company branded templates and copilot features. I have successfully run this code on my development tenant, but when attempting ...
Michael Colbs's user avatar
0 votes
0 answers
11 views

powershell add a group to all spo sites but authentication error

I am receiving authentication error. I have pim and access to admin center. any idea? I figured it out. my privilege access expired. it's working now.
debra's user avatar
  • 1
1 vote
1 answer
40 views

Add-PnPView group by secondary field

I have created a script to create number of views in SharePoint, but I am unable to work out the CAML to group by more than one field if it's possible. 1 field being: <GroupBy Collapse="TRUE&...
Bob 's user avatar
  • 13
0 votes
1 answer
68 views

Get-PnPProperty -ClientObject with "invalid ID"

After I successfully call $f=Get-PnpFile -Url $Url if I invoke Get-PnPProperty -ClientObject $f -Property Versions I get an error that the object ID is invalid. Any clue?
Stéphane BARIZIEN's user avatar
0 votes
1 answer
85 views

How to disable Social media bar for site collection without global admin rights?

A. Context of Access I do not have acces to the central sharepoint admin center but I am the owner of a site collection and I am site collection administrator: I am able to connect to my site ...
Stefan's user avatar
  • 141
0 votes
1 answer
25 views

How to add site template into Organizations template library with lists and data?

I am trying to build a site template which will contains few lists and data within the list. I am aware that I can create site script and add all lists and libraries, but that site scripts doesn't ...
Aakash Maurya's user avatar
0 votes
2 answers
49 views

SharePoint Online List Form PowerApp zip file difference between PS5 and PS7

We have several SharePoint Online List form Power Apps. We export and import them to different site collections in our tenant [DEV/TEST/ACCEPTANCE/PROD]. This requires to change the datasources.json ...
Danny's user avatar
  • 478
0 votes
0 answers
55 views

Apply Site Policy to Multiple Site Collections with PnP Powershell

Over time, a lot of SPO site collections have accumulated in my tenant. Therefore, I want to use Site Collection Feature called Site Policy to automatically close and delete sites after a defined ...
VeleMilosavljevic's user avatar
0 votes
0 answers
116 views

Add-PnPPageWebPart: Object reference not set to an instance of an object

I'm trying to add Quick Links to my SharePoint site using the PnP Module. However, when trying to run the command: Add-PnPPageWebPart -Page $page -DefaultWebPartType "QuickLinks" -Section 2 -...
Semper's user avatar
  • 1
0 votes
1 answer
60 views

Get-PnPAzureACSPrincipal - is this cmdlet deprecated?

Is Get-PnPAzureACSPrincipal cmdlet deprecated? I was able to use this cmdlet successfully 3 months before, but now ,running this cmdlet displays error that's this is not available. when I run Get-...
George's user avatar
  • 1,522
0 votes
1 answer
70 views

Listing groups with the users in them using PowerShell - SharePoint Online

Is it possible to list all groups on the SPO website along with the users who belong to a given group and export the results to Excel? I would like to add that 2FA is enabled on the website. Unless ...
Maro's user avatar
  • 1
0 votes
1 answer
38 views

How can I quickly Delete the contents of a SharePoint List View

I've got a SharePoint with a view called Retention that has around half a million entries, I want to delete the entries in the view from SharePoint as they are no longer required but I've not been ...
Daniel C's user avatar
0 votes
0 answers
12 views

Export 2013 User Profiles from UPSA -Multi Value - Managed MetaData

I am using the following script from GitHub to export user profile properties from SharePoint 2013 into a .csv file. Unfortunately, I'm only getting the first value for properties where multiple ...
Curious's user avatar
0 votes
1 answer
432 views

Find all users that have any level of permissions for a specific Sharepoint Site

I am having trouble with what I thought would be a very simple task, and I was hoping to ask for any assistance. I have a task to very simply collect a list of all users that have any level of access ...
BrandonW's user avatar
0 votes
0 answers
22 views

How to get a Video Thumbnail using PowerShell on SharePoint SE version?

I have a SharePoint (Subscription Edition) document library that is hosting some videos I uploaded. How can I get the video thumbnails using PowerShell? Again, the SharePoint version I am targeting is ...
Jean Paul Larach's user avatar
0 votes
0 answers
75 views

Intermittent Unauthorized Additional claims required errors when calling /user/chats endpoint

I am experiencing intermittent errors when querying the graph api endpoint for teams chat. I am using powershell and delegated access. Here is a code snippet: $tenantId = "my_tenant_id" $...
Andrew Gaskell's user avatar
0 votes
1 answer
233 views

How I can change Sender email in "Send an email (V2)" action for more than 80 Power Automate Flows?

I know I can do this by editing flow and finding "Send an email (V2)" action and changing email id from "From (Send as)" property, but to edit more than 80 flows and find "...
Dinesh Gawde's user avatar
0 votes
1 answer
173 views

SharePoint Online’s Block Download File Policy - Does it involve some user licensing?

I have a requirement where they don't want users to download files. There are 2 options I have been reading about. Using Conditional Access Policy Using a PowerShell command. My question is there ...
naijacoder's user avatar
  • 4,282
0 votes
1 answer
42 views

Get script output to CSV

Please help me to export the output of the script as a CSV. $siteUrl = "https://webapplication" $daysThreshold = 30 # Number of days to consider as "active" # Load SharePoint ...
Karnati Reddy's user avatar
0 votes
1 answer
231 views

Can we hide the Sync on all the current sites and future sites using UI or using PowerShell

I know that we can hide the Sync button for a document library or for all the document libraries inside a site as mentioned in this link https://www.sharepointdiary.com/2017/08/disable-sync-button-in-...
microsoftdeveloperdesigner's user avatar
0 votes
1 answer
948 views

List folder structure in SharePoint Site COllection

I have a SharePoint online site collection with 17 subsites and a lot of document libraries, folders and sub folders in each subsite. Is there a powershell script that will list all the subsites, ...
Heste's user avatar
  • 318
0 votes
0 answers
66 views

Exception calling "Update" with "0" argument(s): "To add an item to a document library, use SPFileCollection.Add()

I have an PopCorn Ketentuan Library, where i need to populate it with some old data we have on csv file. so i did the following:- Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction ...
Ramadhan Putra Setiadharma's user avatar
0 votes
2 answers
119 views

SharePoint Online - unused content report

I would like to review the usage of my SPO site and extract a report with the following details: Title, Created Date, Last Modified Date, Number of hits last 6 months, Last modified by, Created by I ...
Lukas's user avatar
  • 65
0 votes
0 answers
17 views

Project 2019 on-prem security mapping with PowerShell

I am building a script for automated deployment of SharePoint Farm with Project 2019 service application and a Project Web Application. I used to manage Sharepoint online site collections several ...
Grigory Sergeev's user avatar
0 votes
0 answers
27 views

Adding User to Site group fails for form based authentication using Powershell

When attempting to add a user using PowerShell to a SP2016, which has Form Base Authentication active, New-SPUser fails with user not found. The following works for Domain users. $web = Get-SpWeb $...
Fredrick Campbell's user avatar
0 votes
1 answer
18 views

Removing database snapshop from failed backup

When trying to create a backup using a command like this: Backup-SPSite https://server_name/sites/site_name -Path C:\Backup\site_name.bak -UseSqlSnapshot Source I ran into an issue where the target ...
Danyx's user avatar
  • 151
0 votes
0 answers
50 views

Powershell to read excel and update metadata in different document library based on a cell value by matching the unique file name

I have multiple libraries storing only document with unique name, site wise. I need to update metadata for these uploaded documents based by reading an excel sheet. The twist is that it updates ...
cjs's user avatar
  • 1,214
0 votes
1 answer
511 views

Why Get-AdminFlow failed to return all the flows

I have Power Platform administrator permission and recently I used Get-AdminFlow cmdlet to list all the flows under our tenants. The cmdlet is working and listed a lot of flows. However I found about ...
Mark L's user avatar
  • 4,065

1
2 3 4 5
83