Questions tagged [powershell-script]

The tag has no usage guidance.

40 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
1 answer
3k views

Get users who have permission through a sharing link Powershell sharepoint Online

I want to generate a report of every document and permissions on it. Permissions contains General Permission and Users who have permission through a sharing link/ or external sharing link. When I run ...
Pratik Hajare's user avatar
2 votes
2 answers
13k views

Conversion of csv file to xlsx via Flow or SharePoint

I have a Flow to store email attachments (in .csv format) to SharePoint. Now, I want to use the file in Power-BI from SharePoint. However, I want the file in .xlsx format. Could you please suggest how ...
user11726782's user avatar
1 vote
1 answer
2k views

Get-PnPList cmdlet not returning anything

I'm trying to retrieve information from two columns on a sharepoint list in order to use them in powershell. Here's my code so far: $SiteURL = "https://xxxx.sharepoint.com/sites/xxxxx/" ...
Ress's user avatar
  • 85
1 vote
1 answer
95 views

How to Sync Exclude from Internet Search Engines with Internal Search using Powershell

I am using SharePoint 2013 On Premises. I am trying modify the values Exclude from Internet Search Engines( Present in Edit SEO Properties of a page, RobotsNoIndex field) with respect to Include/...
Purushottam.Prasad's user avatar
1 vote
1 answer
2k views

SharePoint online ExecuteQuery command giving exception

I am writing a powershell script to copy the sharepoint online list items from one sharepoint online list to another while that list consist of 77 fields. I am getting below error. While the same copy ...
Niranjan Kulkarni's user avatar
1 vote
0 answers
75 views

SharePoint Content Inventory Using PowerShedll Script

I have a script, where it loops through the whole site collection and starts calculating the size of each list in the site, and calculates each document size (PDF or word document) to determine the ...
Mohammad Akilan's user avatar
1 vote
0 answers
59 views

Finding Unghosted page using PowerShell Script in SharePoint 2010

I've a requirement to find out the unghosted page means page which are created using SharePoint designer using powershell script in SharePoint 2007. It should include the custom list forms as well. ...
Suren's user avatar
  • 31
1 vote
0 answers
130 views

How do I get the name and version of the list item workflow from SharePoint 2013 using PowerShell script

How can I get the name and version of the list item workflow as encircled in the image? I have written the below code to obtain the Workflow ID, Title ,Status, Item Name. I got the ID, STatus and ...
sushma manne's user avatar
0 votes
1 answer
13 views

Get-Team cmdlet runs but returns no data

I attempting to create a PowerShell script which will return a complete list of Teams in an M365 Tenancy as a csv file. My script appears to run successfully but it does not return the expected data. ...
JonS's user avatar
  • 764
0 votes
0 answers
17 views

Bulk file move same file extension

I need to move files with from user. Sharepoint.com to user.onedrive.com. I tried using the SharePoint Migration Tool but it’s giving an error. Can someone help me with the easiest way to code this?
Lisa Jefferson's user avatar
0 votes
1 answer
304 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
25 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
0 votes
0 answers
128 views

Bulk add owner to all Teams using PnP PowerShell?

I need some help in adding my admin account as one of the owners of all my Teams group using the Powershell https://pnp.github.io/powershell/cmdlets/Add-PnPMicrosoft365GroupOwner.html Because without ...
Senior Systems Engineer's user avatar
0 votes
1 answer
2k views

Converting DOC to DOCX within SharePoint Online

Based on this solution to convert .xls to .xlsx, is there a way to convert .doc to docx within SharePoint Online? We migrated a lot of files and folders from NTFS folders to SharePoint online but did ...
Andrew Wright's user avatar
0 votes
0 answers
193 views

Finding and Deleting All Instances of Files Matching a Specific Name

Is there a way of being able to find files within multiple Document Libraries matching a specific name and deleting all of them? I have written a script using the Find-PnPFile and Remove-PnPFile ...
EverGrateful's user avatar
0 votes
2 answers
683 views

Get service account details and their usages in SharePoint Environment

We have lots of service accounts in our SharePoint environment, now we are planning to delete the unwanted service accounts from our environment to keep the environment clean. So, I was checking ...
SP 2022's user avatar
  • 4,064
0 votes
1 answer
29 views

Can anyone provide automate script to add/deploy/update solution in SharePoint 2016

Can anyone provide automate script to add/deploy/update solution in SharePoint 2016. So that developers can run this batch file without help from SharePoint Administrators. And please suggest me best ...
Srinu Dasari's user avatar
0 votes
0 answers
35 views

PowerShell script to change SharePoint Designer workflow status

I want to change the status of workflow using PowerShell script. If you go into workflow settings in a library in SharePoint, and click on Remove a workflow, you see the 3 settings I'm referring to: &...
user99500's user avatar
0 votes
1 answer
1k views

Delete unique permissions of a File or Folder in a document library

I have a document library which has 3 folders in it and inside each folder there is a document (docx, xls, ppt). My objective is to iterate every file inside my document library and check if It has ...
G.F's user avatar
  • 1
0 votes
1 answer
681 views

Q. SharePoint Online - Setting LockState property via PowerShell not successful and no error reported

I have been attempting to Unlock a ReadOnly site in SharePoint Online. I have tried with PNP Connect-PnPOnline $SiteURL -Credential $Cred Set-PnpSite -LockState "Unlock" I have tried with ...
EFighter's user avatar
0 votes
1 answer
464 views

How to verify retention labels at site level?

In our SharePoint Online, we have n number of sites where retention labels are being assigned for the contents. Though, we are not sure if we have labeled everything and would like to verify what has ...
Jag's user avatar
  • 1
0 votes
1 answer
24 views

Workflow to be run for every specific document or content type?

I will need to look for the solution to implement the manual script initiation for specific file type in the document library (ex. force unlocking a document). Idea is that I will add additional ...
Marko Farkas's user avatar
0 votes
0 answers
326 views

Getting Forbidden error while connecting to SP Online using CSOM Powershell

I have one powershell script where I am connecting to SP 2013 Library to download a file using Server side powershell script. After That in the same script file I am trying to connect to SP Online ...
Kailash Sahoo's user avatar
0 votes
1 answer
847 views

How to update "Lookup column" values from csv to Sharepoint Online using Powershell Script?

I have a Parent list called country and the child list where I want my values updated is call Continents. the lookup filed name in Continents is "Country". Any help will be greatly ...
Prachi Vijayvargiya's user avatar
0 votes
1 answer
135 views

How to get last crawl duration in SP 2013 using power-shell

I'm using the below PowerShell commands to get the last crawl duration. when the Crawl In-progress the 'Crawl Completed' field is empty, I the output as duration in negative values. Could you please ...
taruki_MS's user avatar
0 votes
1 answer
952 views

powershell script to replace a user Identity with a different identity

I'm having SharePoint 2016 On-premise environment, now we have a requirement as follows. we have nearly 100 SharePoint Groups, where we had already have many user's identity added as DOMAIN\username ,...
Jegan Baskaran's user avatar
0 votes
1 answer
348 views

SharePoint site is lock

I ran below script to unlock SP site. $admin = new-object Microsoft.SharePoint.Administration.SPSiteAdministration (“Site-Collection-URL”) $admin.ClearMaintenanceMode() Getting below error message ...
user3210176's user avatar
0 votes
0 answers
724 views

Powershell Convertto-HTML from list items also outputs raw objects before the actual HTML

I am writing a Powershell Script to read SPListItems, create a PSObject for each, add it to the PS Array and after the loop ends I use the following to convertto-html myArray | convertto-html -path .....
Ali's user avatar
  • 1
0 votes
2 answers
716 views

How to count number of lines and words in a SharePoint online Page

I am requested to generate a report that illustrates the number of pages and plus the count of words on each page, and the number of files in that site (word, PDF, images..etc.). Is there any custom ...
Dreamer09's user avatar
0 votes
1 answer
1k views

Powershell script to get workflow tasks for each list item

I have a lot of number of webs (sub-sites) within a site collection that have lists that have list items with Approval workflows running on them. How would I get all tasks for each list item in ...
frnorke's user avatar
  • 31
0 votes
1 answer
158 views

How to pick up data using PowerShell from SharePoint Web Parts

We have a manual process at the moment where we have assigned "Content Owners" to out Sites/Sub-Sites. Content Owners, essentially have no greater permissions than regular users, but our Governance ...
Quasam Amanat's user avatar
0 votes
2 answers
914 views

Not getting All FieldValues in Powershell CSOM Sharepoint 2016

I have created powershell script to get File/Folder Size details of Sharepoint site. However, I am not able to get all fieldValues of listItems. I am getting values for $listItem.FieldValues["...
Vishal_chorghe's user avatar
0 votes
1 answer
329 views

get list of al users on farm level on SharePoint 2010 application

I am trying run below script on SP 2010 environment for getting list users on farm level. But i am getting error. Can someone please correct me. Powershell script Add-PSSnapin Microsoft.SharePoint....
murali kuruva's user avatar
0 votes
2 answers
51 views

Need help on running PowerShell command related to Sharepoint Client ID

By referring i see that i need to run the command but when i try to run i am getting below error PowerShell Command When i run i am getting below error i am new to powershell and i dont know what ...
Abdul Azeez's user avatar
0 votes
1 answer
462 views

Set People picker field with sharepoint group

Is it possible to set a People picker field with SharePoint Group using powershell script ?. Thank you.
user1514428's user avatar
0 votes
0 answers
29 views

Restore/change text/background colors in sharepoint online management shell

I changed colors under properties > colors to improve readability but: 1/ the colors don't reflect the changes I made 2/ I can't restore defaults or make any other changes. I uninstalled and ...
matt's user avatar
  • 589
0 votes
1 answer
35 views

Change contenttype of all site collection libraries with Powershell

Change contenttype of all site collection libraries with Powershell Hello everyone. I am an apprentice of powershell and SharePoint and I came across the following scenario: I have a collection of ...
Rafael Araujo's user avatar
0 votes
2 answers
201 views

Add Azure AD users to SharePoints groups and document library permissions in bulk

I need to create Azure AD users in bulk (about 90), in order to add each of them: To a SharePoint group present in 90 sub-sites Authorizations from two libraries in each of these sub-sites Example : ...
NonoCHÉ's user avatar
0 votes
2 answers
265 views

Powershell Pulling matching strings

I need help pulling every word that contains certain strings(more than one) from particular site and exporting to a file. My code is as follows: Add-PSSnapin Microsoft.SharePoint.PowerShell -...
Vusi85's user avatar
  • 67
0 votes
1 answer
1k views

Powershell script that outputs all workflows,their title and status from sharepoint 2013 site that has workflows attached to every list

The SharePoint 2013 site has a few subsites and each subsite has further subsites that have lists in it. To these lists there is a workflow attached. How do I write a powershell script to retrieve ...
sushma manne's user avatar