Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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 ...

0
votes
1answer
9 views

How to create SharePoint online list and Fields Using Power shell Script?

I want to create 7 SharePoint lists and Fields in SharePoint online using a power-shell script. In XML I have mentioned the list names and Field Names with Field Types. How to call this XML file to ...
0
votes
1answer
15 views

Modern Page - Display Powershell Code with corrent visual format

is there a way to display powershell code in a code block with the correct visual elements to it (colour, font, etc)? We are moving to modern pages for our internal how to guides and this would help ...
1
vote
1answer
20 views

SharePoint Permissions Re-provision PowerShell

I've created 2 scripts, one to export SharePoint Online permissions to a .CSV and one to re-provision SharePoint Online access. I've come across a slight problem which is preventing the script from ...
0
votes
1answer
23 views

PnPPowerShell cmdlets throw “The request channel timed out attempting to send after 00:00:30”

Lately, I've noticed that Cmdlets such as Get-PnPListItem, Get-PnPFile and Get-PnPProperty throw the error The request channel timed out attempting to send after 00:00:30. Increase the timeout value ...
1
vote
1answer
37 views

How to generate SharePoint Online site audit report using PowerShell?

I want to generate the audit log report with different activities and download to the local disc from SharePoint Online Site. The functionality is provided by Share Gate tool which I assume to be ...
0
votes
1answer
19 views

Want to delete SharePoint 2003 Site Collections and sites based on Input File

Can you one please provide a sample to script to delete Sitecollection and subsites based on Input file in SharePoint 2003. Thanks in Advance, Phani
-2
votes
1answer
31 views

Add “Everyone except external users” to sharepoint visitors group using powershell CSOM

I want to add "Everyone except external users" group to SharePoint visitors group using powershell CSOM. I googled it but didnt find correct script. Can anyone help me in this. Please respond ASAP. ...
0
votes
0answers
13 views

how to filter List items across a site collection with powershell?

We have a site collection and in it there are over 200 libraries. all of the libraries have the same columns (content types are disabled) our HR wold like to know if we can write a excel file ...
0
votes
1answer
30 views

Extracting SharePoint data on daily basis

I want to export my SharePoint document library data on daily basis and csv file need to be save as naming convention as "Dataname_yyyyMMdd". As per my below script, it need to export data from the ...
1
vote
0answers
12 views

Sharepoint audit reports automation with power bi

I was wondering if this possible. To automate the SharePoint Online Audit log report i.e a user viewing a page of the site from the excel spreadsheet and using powershell (im assuming) to create a ...
1
vote
2answers
44 views

extract data from SharePoint document library to CSV using powershell

i am trying extract data of SharePoint document library to CSV file using powershell. I am getting data correct on CSv file. But one column i.e "Description" have more text data on it.So when run the ...
1
vote
1answer
44 views

Iterate through all Sites using PowerShell

I am trying to disassociate all of my sites with my hub site and then associate them all again so that I can force an update of the styling. I know the code to remove an association and then create an ...
0
votes
0answers
30 views

PowerShell: Retrieving Permissions of a Folder Problem or Limitation?

We're using SharePoint Online and we've been following the PnP solution: Retrieve Permissions at folder and file level in Powershell This works fine to a certain degree and my general question is ...
0
votes
0answers
14 views

Create survey in Sharepoint Online with powershell PnP

I have to create the same survey several times at several websites. I would like to automate this with a PowerShell script preferably with PnP cmdlets. It is possible to create a survey with ...
0
votes
0answers
17 views

sharepoint powershell columns show up blank although they have a value set

I have this weird problem, where powershell only shows blank values for at least lookup and user fields. In AllItems.aspx and with REST I can see that they actually have a value though. For example, ...
1
vote
3answers
39 views

Provisioning a Site template to several SharePoint Group Sites with PowerShell

I am trying to search for site collections which are of the type "Office 365 Group site collections (GROUP#0)" and then want to apply the Provisioning Template to all the group sites returned in the ...
0
votes
0answers
26 views

Hashtags are coming when export data to CSV file while using powershell script

I am running one powershell script for getting data from SharePoint document library. While run the powershell script, data came to csv file, but columns names are coming with ";#" hashtags. for ...
1
vote
1answer
16 views

Get all subsites of 2 levels using Powershell

I have a site collection "IM". In this site collection I have many subsites and in every subsite I have other subsites. How can I get all subsites of the site collection using Powrshell? I started ...
0
votes
1answer
22 views

Cancel a workflow when a item is changed in a list using PowerShell

I found code to cancel all workflows that are completed using powershell. However I was looking for code (using powershell) that will cancel a workflow (in Progress) on a specific workflow for a ...
0
votes
1answer
20 views

Upload new files from local computer to SharePoint online library

I have a script that generated a user report to a csv file. Which work properly. I have added a section to upload all the files from the local computer to the SharePoint library. Which also works fine....
1
vote
2answers
49 views

Unable to get the specific list/library contenttypes csom powershell

I am unable to get the specific list/library contenttypes using csom powershell. Getting error:"The collection has not been initialized. It has not been requested or the request has not been ...
0
votes
1answer
36 views

How to split string condition on array with powershell script. Exporting SharePoint library data on csv file

i am trying export library data into CSV file. i had used string functionality on my script to get content. my script was working fine but i am getting output in single string (or) one column. My ...
0
votes
1answer
28 views

CAML Query to find items with wrong expiry date

I have a library with 65,000 items and for some items the “expiry date“ is not right. The field should actually be calculated automatically from the “creation date“ + 8 years. How can I determine the ...
5
votes
1answer
133 views

Access Site Collection in Powershell with Client Id and Client Secret?

Is there a way to Create a context in powershell using Client Id and Client Secret ? Currently I am using $context.Credentials in my code.
0
votes
1answer
30 views

Copying folder structure to local using recursive function in powershell

How to get folder structure of sharepoint online to local drive using recursive function in powershell. Can anyone please help me with the script. Thank you!
1
vote
1answer
31 views

create remote event receiver without handling app installed

How to deploy a remote event receiver without handling the app installed, I know that this can be done with powershell but I already tried it, the RER is reflecting in the list, but the program itself ...
0
votes
0answers
21 views

How to add remote event receiver using powershell?

How to add event receiver using powershell, I created a remote event receiver that handles the app installed within the solution, now I am trying to deploy that RER to another Document Library, I ...
2
votes
2answers
70 views

How get columns data from SharePoint document library using powershell

I want to export data from document library column into csv file using PowerShell. In document library i had column name "Post Code" under column i had different post codes as "XXXXX-12-AD-2345, ...
1
vote
1answer
29 views

Adding Web Part document library to my site using powershell

I want to add my document library as a web part to my collection site. how is that possible using PowerShell, please ?
1
vote
0answers
33 views

Put an Image webpart (Image/Image gallery) on the top of a Modern SP page with Powershell (PnP)

I need to communicate an important information (picture) on Team Site homepages so I decided to add on the top of every homepages an Image Webpart (to know : homepages already has some webparts). I ...
0
votes
1answer
30 views

How to migrate site collection using powershell (SharePoint Online)?

The requirement is to migrate all the Lists(SharePoint Online to SharePoint Online). I have tried many ways. But Lookups don't work. It creates the lookup column with an empty reference to the other ...
0
votes
1answer
28 views

Sharepoint Online - Powershell to retrieve URL and any full control users assigned to that URL

I have created a power-shell script to list all the subsites and users who have full control to that individual subsite however it's coming up with an error - The collection has not been in itialized. ...
1
vote
0answers
13 views

Create Site Policy in SharePoitn Online with PowerShell/CSOM

I was researching for creating Site Policy in SharePoint Online with PowerShell/SharePoint but with no luck. Is it possible with SharePoint Online?
0
votes
1answer
24 views

Site collection audit settings for Sp online using CSOM

I can set all the audit settings for my site collections using the following powershell script, works great $Site= $ctx.Site; $audit = $site.Audit; $ctx.Load($site); $ctx.Load($...
0
votes
1answer
46 views

Remove specific user permissions from one folder in Sharepoint online with powershell

I am having trouble figuring out how to remove a specific user from a folder. I have sharing the folder with the user working, but cant seem to get it to remove.... below is where i am at... any ...
1
vote
1answer
36 views

Get managed metadata using Powershell

I want to copy the single managed metadata Field [Base currency] Value. $newItem["Base Currency"] = $item["Base currency"] it's wrong because it's a managed metadata.. we don't get the value of ...
0
votes
0answers
12 views

Handling SharePoint Objects inside Powershell workflow

I have a requirement to check the role assignments for all SPListItem of a web using powershell and I am trying to achieve this using foreach -parallel block. In the below code the $wfList returned is ...
0
votes
1answer
44 views

Error :“the given key was not present in the dictionary ” while creating publishing page in Powershell CSOM

I am facing error:"the given key was not present in the dictionary " while i am creating publishing page in sharepoint online using powershell CSOM. Here is my code: $subsiteCtx=New-Object ...
0
votes
0answers
72 views

unable to get all custom list templates from list templates gallery CSOM

I am unable to get all list templates from list templates gallery. I have uploaded all templates but only few are getting fetched... no clue what might be the the reason. Can anyone help me in this? ...
0
votes
0answers
29 views

“ExecuteQuery” with “0” args: "pageInfo.PageLayoutLisItem

I am getting exception while creating publishing page with pagelayout using powershell csom Error: Exception calling "ExecuteQuery" with "0" argument(s): "pageInformation.PageLayoutListItem" No ...
2
votes
1answer
51 views

Get First and last Day of the year using Powershell

I want to get the start date and the Due date for a task which will be repeated Annually using Powershell Please.
0
votes
1answer
152 views

Immediate Redirect page from root to communication site

How do I redirect to a site collection in SPO without ANY lag? The root https://******.sharepoint.com now has a simple javascript redirect: window.location.href = 'https://******.sharepoint....
0
votes
1answer
25 views

Set-PnPListItemPermission and Set-PnPListPermission - Does this send out a notification to the user?

I couldn't find in the docs if this was the case or not, I assume not, but I just want to make sure (and I have no test users to test with): If I use Set-PnPListItemPermission or Set-...
2
votes
2answers
70 views

How to enable Audit setting in SharePoint all Site collections using Power shell script?

How to Enable all the SharePoint site collection Audit setting using power shell script. Can you Please give me some example Script to enable the Audit settings?
0
votes
1answer
31 views

SharePoint User Profile - Populate empty work email field with user name.

I need to create a solution in powershell that iterates through all my user profiles, finds the ones that have empty work email fields, and populates that field with whatever is in the name field (...
0
votes
1answer
36 views

The property 'ContentTypesEnabled' cannot be found on this object. Verify that the property exists and can be set

I am trying to add content type to a list and the following code has worked in the past. This time it is giving me this error: The property 'ContentTypesEnabled' cannot be found on this object. ...
1
vote
2answers
42 views

This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator in SharePoint online

I created Indexed columns for this list but i am still getting this error "This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator". I ...
0
votes
2answers
36 views

Powershell script to deploy/move a wsp/solution file from local drive to SharePoint 2016

I am new to an On-Prem environment. I am trying to automate the deploying or moving of Farm based solution and wsp packages from a local drive to SharePoint 2016 site collection. I am a newbie to ...
0
votes
0answers
14 views

SP2013: Add existing site column to existing page using PowerShell

I'm working with a custom article (publishing) page layout. I'd like to add several existing site columns to an existing (article) page. It's currently set up in a very unpractical way that only ...
0
votes
1answer
43 views

Get Edit Links Created through CSOM

Is there a programmatic way of accessing through PowerShell/CSOM to get the Edit links created for the documents