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
1 answer
18 views

How to apply OneColumnFullWidth section in SharePoint site template

I have created a site template using PnP framework: <pnp:Section Order="3" Type="OneColumnFullWidth"> <pnp:Controls> <pnp:CanvasControl ...
Alias Varghese's user avatar
0 votes
1 answer
16 views

Cant register HUB again after changing Site URL

Goal was to rename URL for SharePoint Online HUB Site. I tested on DEV tenant to unregister HUB Site, Change the URL and Register again. it was working, all sites get connected again back to the Site ...
Popkornak's user avatar
1 vote
1 answer
32 views

SPO PowerShell to get App Display name and App Identifier from "Site App Permissions" Page

In SPO, how to get the App Display Name and App Identifier details which are displayed in _layouts/15/appprincipals.aspx?Scope=Web page using PowerShell? Get-PnPApp command displays the app details ...
George's user avatar
  • 1,492
0 votes
0 answers
27 views

How to update SPFx web part property pane values using PowerShell scripts?

How to update SPFx web part configuration property pane values in SharePoint 2019 on premises site using PowerShell?
Kaniksha Lakshmi Priya's user avatar
0 votes
1 answer
27 views

Downloading SharePoint 2019 monthly patches using a PowerShell

I would like to download SharePoint 2019 patches (on-premise) using PowerShell Script. The Microsoft Update Catalog only has core patches but I want to download language patch as well. Please let me ...
san k's user avatar
  • 1
0 votes
0 answers
15 views

Is it possible to change the "Indexing Site Content" Setting in Sharepoint Online via powershell?

I've spent hours looking at solutions to this high priority issue, using PNPOnline, Sharepoint Online Management Shell, and CSOM, and whenever I try anything using nocrawl, it tells me the property ...
IDontKnowHowToCode's user avatar
1 vote
1 answer
50 views

Using single Connect-PnPOnline connection for different SharePoint sites

I need to get a list of all files, older then 5 years, from few thousands sharepoint online sites and I am trying to do it with powershell script. The problem I am having is that I have to reconnect ...
user3195616's user avatar
0 votes
1 answer
158 views

Connect-SPOService: Could not load type 'Microsoft.SharePoint.Client.SharePointOnlineCredentials' from assembly 'Microsoft.SharePoint.Client.Runtime,

I am trying to run this command inside Windows PowerShell 7 :- Connect-SPOService -Url https://***-admin.sharepoint.com But i got this error:- Connect-SPOService: Could not load type 'Microsoft....
microsoftdeveloperdesigner's user avatar
0 votes
1 answer
28 views

Create a SharePoint Modern Team Site with PNP PowerShell

I tried to create a new Modern SharePoint Site with the PNP Framework. I ran in the following error. I want to store the Url in a variable. Everytime I store it in a variabel I get an error message: ...
Matthias's user avatar
1 vote
2 answers
57 views

How to extract department from page properties using Powershell's PnP and set it?

I have the following page: test.aspx But when I run Get-PnPClientSidePage, I do not see it as a value, even if I expand any of the items listed. Additionally, I don't see a description either. Once ...
Me Myself's user avatar
0 votes
2 answers
32 views

Delete a managed metadata site column from a library only

In SPO, i am trying to delete a Managed Metadata Site Column from a library. I'm using the below script to delete: $SiteURL = "https://Abc.sharepoint.com/sites/SiteName" $ListName = "...
George's user avatar
  • 1,492
0 votes
1 answer
41 views

Set default page template on Communication site with PowerShell

Is there a way to tick the "Set default selection" property of a page template, so that it will be use as the default page template? I'm trying to find a way of doing this programmatically, ...
Robert Lindgren's user avatar
0 votes
1 answer
103 views

Activate Modern Audience targeting on Site pages with PowerShell

I'm trying to find a way to enable modern audience targeting on the Site Pages library of a Communication site with PowerShell. Activating the hidden feature does not have any effect. Is this possible?...
Robert Lindgren's user avatar
0 votes
2 answers
68 views

Get group members of a site if the group name is unknown

I'm trying to get all members of SharePoint 'Owners' and 'Members' groups across sites in my tenant. When I loop through the list of sites and use the following command for each site: Get-SPOUser -...
Mubashir's user avatar
0 votes
1 answer
55 views

How to backup the SharePoint pages in the Site pages library with PnP Powershell

How can I backup my SharePoint pages resided in the Site pages library of my Communication site using PnP PowerShell?
user1903995's user avatar
1 vote
1 answer
167 views

Automate clearing SharePoint Recycle Bin and Second Stage Recycle Bin

Does anyone know of a way to automate clearing recycle bin and second stage recycle bin for SharePoint? I use my SharePoint strictly for scheduled backups of my OS and the items in the recycle bins ...
CntrlAltDel's user avatar
0 votes
1 answer
32 views

How to add multiple read-only columns to Sharepoint List

I am creating a Sharepoint List in Sharepoint Online. I am uploading from an excel file and I want all the columns to be read-only except for something like 'Status' or 'Notes.' When I upload from ...
amchugh89's user avatar
  • 101
0 votes
0 answers
50 views

Provisioning a Teams Template with a specific folder structure with the PNP provisioning engine in PowerShell

I try to create a template for Teams with a specific folder structure, e.g. General -Folder 1 -Folder11 -Folder12 -Folder 2 I managed to create a Team with PNP so far, but I'm struggeling to connect ...
Matthias's user avatar
0 votes
1 answer
58 views

How to access a List View's custom formatter?

While doing some custom formatting for a List View, invalid JSON was checked-in and now, the List View will not render and I can't find a way to access the custom formatter without rendering the list ...
ChiefTwoPencils's user avatar
1 vote
1 answer
18 views

SharePoint 2010 Migration to SharePoint 2019

My company is migrating to SharePoint 2019 (on-premise) from SharePoint 2010. We migrated the content over, but when I click a link in the top navigation, some pages go to the classic view, while ...
Michelle's user avatar
0 votes
1 answer
108 views

.Replace() will return empty string inside my Powershell script

I have the following PnP PowerShell to get the URL of a file and remove the ".lock" string from the file name using Replace:- $url = $item.File.ServerRelativeUrl Write-Host "$(Get-Date) ...
John John's user avatar
0 votes
0 answers
18 views

PnP Script which work on file modified on 10 March 2023 >> restore previous version >> rename the restored file

We have someone who have modified many files on 10 March by adding .lock extension to the files so Test.xlsx become Test.xlsx.lock. so can i write a power shell script which do the following:- ...
John John's user avatar
1 vote
1 answer
23 views

How to set data in custom Web Property SharePoint online?

Could you help me please, how can I set a value to custom web property in SharePoint and then get this property later? Now, I only can get all default properties using [web url]/_api/web.
Propool's user avatar
  • 37
0 votes
2 answers
334 views

Connect-PnPOnline stopped working

we have a powershell script wich suddenly stopped working. The first get method after logging in: Connect-PnPOnline -Url $url -ClientId $AppId -ClientSecret $AppSecret -verbose started to throw error:...
Bálint's user avatar
  • 331
1 vote
2 answers
56 views

Set index on a column in a large list programmatically

I can manually set an index on a column in a large SharePoint list (10000+ items) but I'm not able to do it programmatically. With (PnP) PowerShell I've tried: # get context $Context = Get-PnPContext ...
Betelgeuse's user avatar
0 votes
1 answer
250 views

CSOM PowerShell script - moving to modern authentication

I have a complex CSOM script that I need to get working for a Tenant that uses Modern Authentication. This works fine using Basic Authentication. Its not an automated script so an interactive login ...
user3844416's user avatar
0 votes
1 answer
401 views

Remove-SPOSite : The label that's applied to this item prevents it from being edited or deleted. Check the item's label for more details

trying to delete a site but it simply does not work, from the UI, from powershell, etc. Remove-SPOSite : The label that's applied to this item prevents it from being edited or deleted. Check the item'...
Tiago Duarte's user avatar
  • 5,399
0 votes
0 answers
20 views

Powerhellscript for powershell 5.1 sharepoint

How to create a script in powershell 5.1 that gets list of site collections , Url, admin, size in MB, Title, number of Share Point Lists, number of share Point document libraries, number of SharePoint ...
Tej's user avatar
  • 1
0 votes
0 answers
51 views

PowerShell to remove SharePoint subsite permission levels alone

Looking for a help in getting a PowerShell script to remove SharePoint subsite permissions alone. The groups should exist and users under the groups also. The script should only remove the permission ...
Madhu's user avatar
  • 1
0 votes
1 answer
68 views

Unable to read Sharepoint List

I setup new Sharepoint list, customized the form using Power App and able to view it and add new data. Now trying to setup a connection to this list to extract items that were added and unable to see ...
Alla's user avatar
  • 11
0 votes
0 answers
21 views

Unknown hard error when executing SP-Mount Database in SharePoint 2016 using PowerShell

I am getting Unknown hard error when executing SP-Mount Database in SharePoint 2016 using PowerShell causing the upgrade to stop. We have below VM's with Windows 2019 and 32 GB of RAM: 1 Application ...
BizApps's user avatar
  • 723
0 votes
2 answers
77 views

Parameter 'Web' is obsolete. The -Web parameter will be removed in a future release. Use Connect-PnPOnline -Url [subweburl] instead to connect

I have this PnP Power-shell to loop through all sites >> then all libraries >> then list all the main folders inside the libraries. $AdminUrl = "https://****-admin.sharepoint.com/&...
John John's user avatar
0 votes
1 answer
425 views

How I can ONLY get the first level folders (main folders) inside document library, seems "Get-PnPFolder -List $Library" retrieve all the sub-folders

I have this script to loop through all site collections >> and all document libraries >> then list the folders in this format "Site Name >> List Name >> Folder Name":...
John John's user avatar
0 votes
0 answers
21 views

PowerShell script to get the ShowInEditForm property for a site column. i do not want to use PnP PowerShell [duplicate]

I am trying this script to get the ShowInEditForm property of a site column and then set it to False:- Connect-SPOService -Url https://****-admin.sharepoint.com/ Get-SPOSite -Identity https://***....
John John's user avatar
0 votes
0 answers
29 views

Get the field schema inside our sharepoint online site

I have the following 2 powershell commnds, to cohhect to a site:- PS C:\WINDOWS\system32> $ctx = Connect-SPOService -Url https://****-admin.sharepoint.com PS C:\WINDOWS\system32> $s = Get-...
John John's user avatar
0 votes
1 answer
55 views

Looking for a PowerShell Script to "Display this document library on the Quick Launch?"

We are doing bulk network share drive migrations into SharePoint. The SPO Migration tool automatically creates the document library, but does not automatically add it to the Quick Launch. There does ...
Scott's user avatar
  • 25
0 votes
1 answer
117 views

Sharepoint Online - Powershell Script to add permission to folders for eeach AAD group from CSV

This is my first post at stackexchange, so hello everyone. I have issue. I created a script but its doesnt work. I would like to add access to each folder at sharepoint for each group mapped from CSV ...
Marcin Mielnicki's user avatar
0 votes
1 answer
133 views

Export SharePoint List with Managed Metadata column as CSV using PowerShell

I am using the script below to export a 6000+ item Sharepoint list to CSV. It works great, however, 1 of the columns on the list is a Managed Metadata column. When exported with the script below, the ...
B4N3's user avatar
  • 17
0 votes
1 answer
61 views

Update lookup column via CSV. Powershell Erro

Using SharePoint 2016 I am trying to update lookup column in a document library via CSV using below PowerShell: it only updating few and giving below error on rest of the items. The CSV and Doc ...
cjs's user avatar
  • 1,204
0 votes
0 answers
55 views

Find/Export all Site Collections a group of users have access to

I am struggling to find a way, using powershell, to find/export all site collection a group of users have access to. What I have is a *.csv file with roughly 30 users listed. I need to loop through ...
stacy mcmillan's user avatar
0 votes
0 answers
18 views

PowerShell to run on a document library, loop through all folders and grab users from security groups applied to folders

I am new to learning PowerShell and was wondering how one is able to grab names of users within a certain security group that is applied to folders in a document library. All folders listed within the ...
SPSN00B's user avatar
  • 43
0 votes
0 answers
29 views

Calling "Get-PnPUser | ? Email -eq $Email" from another function is not working

I have this function, to return a user from SharePoint based on the email address : Function GetUser([string]$Email) { try{ write-host "Getting User" $Email $SPuser = (Get-PnPUser | ? Email -...
John John's user avatar
0 votes
2 answers
230 views

How can I know the Powershell credential request username and password?

I've been trying to run different PowerShell scripts to get all or subsites that are into a site collection, however when I run this ask for the Windows PowerShell credential that haven't able to ...
Priscilla's user avatar
0 votes
1 answer
153 views

How can I pass parameter to (Get-PnPUser | ? Email -eq ($SPUserEmail));

I have the following PnP PowerShell script: $conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=$DBServer;Integrated Security=True;Initial Catalog=$DBName") ...
John John's user avatar
0 votes
1 answer
49 views

The term Get-PnPAzureADUser is not recognized as the name of a Cmdlet

I have a PnP Power shell script, but it is raising this error:- The term Get-PnPAzureADUser is not recognized as the name of a Cmdlet any advice? Thanks
John John's user avatar
0 votes
0 answers
199 views

PowerShell script to Open, Refresh and close excel file via web excel in SharePoint then download the file

I am using windows server 2016 and it does not have an MS-excel application. But I have to Open refresh and close the excel file (The file is in SharePoint) via web excel in SharePoint and then ...
Vivaan Vasu's user avatar
0 votes
1 answer
35 views

Can we define Bcc using Send-PnPMail

Can we define Bcc using Send-PnPMail cmdlet in PnP PowerShell?
John John's user avatar
0 votes
0 answers
45 views

Retrieve permissions of only first level folders in a SharePoint online Document Library

We have a request from our auditors to provide a csv file, that contains for each document library in a site, unique permissions applied on only the first level of folders within the document library, ...
Berdj Boyadjian's user avatar
0 votes
1 answer
9 views

Can we define NOT IN inside CAML Query

I have this Power Shell script which work on SharePoint 2013 on-premises: $NewHireList = $spSourceWeb.Lists["ONB New Hire"] $NewHireItem = $NewHireList.Items | Where {$_["Candidate ID&...
John John's user avatar
0 votes
1 answer
46 views

Get storage used by a SharePoint site day to day

Is there way to get SharePoint storage used by each sites on day today basics? I can get break down for SharePoint storage for all sites in total but I would like to see it see break down for each ...
hello007's user avatar

1
2 3 4 5
83