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
255 views

Powershell script to transfer folders from local folder to document library

I am new to Sharepoint and would like to write a PowerShell script to transfer folders from a local folder to a document library (Sharepoint 2016). May I know if it's possible, and the way to do it? ...
dexter 's user avatar
0 votes
2 answers
190 views

SPO multiple subsite renaming - powershell

Excel played a little trick on me removing 0 and 00 in front of subsites URL for a migration I did. I migrated subsites from on premise farm to online using a CSV, but without noticing, excel removed ...
Mathieu's user avatar
0 votes
1 answer
98 views

Need to delete unique permission at site level only

I am using SharePoint Online, having 1200+ site in the organzation's default site collection companyname.sharepoint.com/sitenames. All the current 1200+ sites are having a unique permission on site ...
cjs's user avatar
  • 1,204
1 vote
1 answer
859 views

Get-SPSite vs Get-MgSite Powershell queries

What's the difference between the Get-SPSite vs Get-MgSite Powershell queries? I read the documentation but am not able to see what's the difference between those.
Spammy McSpamface's user avatar
0 votes
1 answer
201 views

SharePoint Online Managed Path

Does anyone know how to get this information through rest API or PowerShell? I wanted to know if the tenant I am working with is using "/teams/" or "/sites/". I am creating an ...
Billy P's user avatar
  • 236
0 votes
1 answer
389 views

Add/Change image on a SharePoint List image column for Gallery view

I have a SharePoint Online list column that accepts an image called Image. I would like to populate this content using PowerShell, specifically using the PnP module, as the rest of the script I'm ...
Tim 's user avatar
  • 103
4 votes
2 answers
9k views

400 Bad Request connecting with SPOService using PowerShell 7.2

I have beat my head against the wall and read MANY posts around the Internet. I am using PowerShell 7.2 and have installed and updated Microsoft.Online.SharePoint.PowerShell. Using a simple Connect-...
Randall Everett's user avatar
0 votes
1 answer
2k views

SharePoint Permissions Report

I want to create a SharePoint permissions report using PowerShell. I have looked for multiple options but not getting what I want. Please see the below format I am looking for. Please help. And it ...
user105443's user avatar
0 votes
1 answer
75 views

Site Import Error

I am currently getting the error below when importing a site and I have no idea what is causing it, can anyone help? [FatalError][-2146231999][System.Xml.Schema.XmlSchemaValidationException][The ...
Ben Cooper's user avatar
0 votes
0 answers
595 views

Error :: Add-PnPCustomAction : Attempted to perform an unauthorized operation

Getting this error: Add-PnPCustomAction : Attempted to perform an unauthorized operation. User has Admin level access on SharePoint Online. PnP PowerShell throws error. Please advice solution here.
Parth Shah's user avatar
2 votes
2 answers
371 views

Trying to add an AD security group as site collection admin with PowerShell

I am trying to create a new SharePoint site and then add an AD security group as an additional site collection admin to that newly created site. The only way I found to make this work is to use import-...
Tim Mattheson's user avatar
0 votes
1 answer
552 views

Get number capital letters in a string using PowerShell

I have a string. For now lets go with $string="mFN6jTPx?!". I would like to be able to count how many capital letters there are. I have tried using ($string -cmatch '[A-Z]').length but that ...
hellothere's user avatar
0 votes
1 answer
380 views

Copy PnP provisioning template without users

I'm copying PnP provisioning template with PowerShell using Get-PnPSiteTemplate command. I need to copy all site permissions but I don't need to add users into it. Which properties for Get-...
Ann's user avatar
  • 51
0 votes
0 answers
241 views

How to get SharePoint Web details without site collection administrator access

I have a scenario in which I have the SharePoint role but am not a site collection admin. I can use SPOService (Get-SPOSite) but it doesn't contain the web information I'm looking for (web creation ...
Tiago Duarte's user avatar
  • 5,477
0 votes
1 answer
491 views

PNP Powershell Updating Choice field

I have written a powershell script which reads off of a CSV and creates records in a list. There are duplicate customer names within the CSV but they will have a different 'interested system' field. ...
Adz127's user avatar
  • 3
0 votes
0 answers
307 views

Power Automate Flow that retrieves the name of a column in a sharepoint list

I'm creating a flow that alerts users whenever they have an expired certification inside a SharePoint list. When it comes to the part where I need to send the email to let the user know I can't find ...
Strykermmoak's user avatar
1 vote
1 answer
451 views

Power Shell script which runs on all the root folders of a document library and set unique permsion to all users to have read-only

We have an online document library which contains around 1000 root folders, and we want to run a Power Shell script which runs on the 1000 root folders ONLY (without the sub-folders) >> then set ...
John John's user avatar
0 votes
1 answer
229 views

Move particular year files from one document library to another using powershell script

I have two document library.in one document library no folders are there.2021-2022,2022-2023 documents are there.One year(date and time) column is there.Using group by i separated documents(2021-2022,...
BHARATHI PAULRAJ'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
2 answers
3k views

How to allow application to have write access to a specific SharePoint folder?

I want to upload a file into a folder in the SharePoint document library using PowerShell. For this, I am using the following link to setup the app: /_layouts/15/AppRegNew.aspx Followed by ...
variable's user avatar
  • 4,457
0 votes
0 answers
35 views

I want to send an email to all the users who has access to my SharePoint site collection including subsite and its users it's for SP 2010

I am using SharePoint 2010. I want to send an email to all the users who has access to my site collection including subsites and users who has access to subsites. Please provide me a solution.
Siva Kumar's user avatar
0 votes
1 answer
198 views

How to delete files that are older then 7 years in a sharepoint site

I have a site that has files created before 7 years(before 2015). I need to delete all of them by applying filters (Filename has the file created date on it Example:20130204.PDF). Could anyone please ...
sanjeev kumar's user avatar
1 vote
1 answer
106 views

-ExemptFromBlockDownloadOfNonViewableFiles $true not running on SharePoint online

I am trying to set this value true on my entire tenant for the ClientSideAssets library. I would like to have -ExemptFromBlockDownloadOfNonViewableFiles set to true on entire tenant if possible if not ...
Newb's user avatar
  • 41
0 votes
1 answer
61 views

SharePoint Online Pre-Pend Number column with PowerShell

Through the UI its possible to pre-pend a number column - See screenshot below: How can this pre-pended text be changed or added with PowerShell?
Orange Juice Jones's user avatar
1 vote
1 answer
2k views

Connect-SPOService : The sign-in name or password does not match one in the Microsoft account system

I am running this power shell command: $username = 'admin***@M*****.onmicrosoft.com' $password = '******@@' $cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $...
John John's user avatar
0 votes
1 answer
808 views

Connect-SPOService ... Error "The underlying connection was closed: An unexpected error occurred on a send"

I want to connect to SharePoint online SharePoint admin center using this code: Connect-SPOService -url $TenantAdminUrl -Credential $SPCredential but I keep getting this error: Message: The ...
John John's user avatar
0 votes
1 answer
605 views

PnP PowerShell: Copy existing Modern page into new Template

I've recently converted a 400 page classic wiki into modern pages on SPO, but I need them to all follow a template I've created. Is there a way (in PnP Powershell) in the script I follow to convert ...
JimJams2022's user avatar
0 votes
3 answers
3k views

How to get LastAccessed For SharePoint Site in SharePoint Online?

I want do some analysis of a rather large Site Collection in SharePoint Online. I want to figure out what has value and could be considered for migration vs old data that is not used. I have been ...
Andrew Gaskell's user avatar
0 votes
1 answer
89 views

SP Online site collection ID

I need to create an SP online Team site (with Office 365 group) with PowerShell. Can you please help me find the Template ID for the Team site (with Office 365 group)?
Harris's user avatar
  • 593
0 votes
0 answers
195 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
1 answer
50 views

Importing Data from Excel to Sharepoint (External Data field)

I have a list containing external data columns. I have an excel file that has values for external data columns. I want to bulk update via Powershell. When I try to update the value from excel to ...
Mark Antony's user avatar
0 votes
1 answer
648 views

Get the Folder GUID using Power Shell

I am trying to get the folder GUID using its URL, i tried this power shell:- #Variables $SiteURL = "https://*****.sharepoint.com" $ServerRelativeUrl= "/Shared Documents/FolderA" ...
John John's user avatar
0 votes
1 answer
1k views

The collection has not been initialized - SharePoint Online - Powershell

I'm wondering if someone can help. So I am trying to get a list of users from a SharePoint Online site using Powershell but get the following message. The collection has not been initialized. It has ...
JeffreyJ's user avatar
1 vote
1 answer
3k views

How do I get files' and folders' size and last modified time in PnP PowerShell?

I found a code snippet that loops through the files and folders in SharePoint, using PnP PowerShell, and retrieves the count. When I modify the code to also retrieve the last modified date and size ...
igarry's user avatar
  • 11
0 votes
1 answer
38 views

Hard deleted items in SharePoint 2010

recently I make a powershell script which compare date of create item in sharepoint and delete if it is equal or less. But, my bad and I didnt check some data and they are gone. Recycle bin in ...
jck4real's user avatar
0 votes
2 answers
373 views

How to filter in PowerShell

I can get all of the webs listed out but when I try to add Where-Object, nothing is returned. How do I get this where object working? This is SharePoint 2013. $WepApp = "http://mywebapp.com/"...
tnk479's user avatar
  • 133
0 votes
1 answer
434 views

How do I get Powershell SharePoint Cmdlets installed to my SharePoint 2013 server?

I want to run some powershell commands on a SharePoint 2013 server. Unfortunately, I can't even seem to step up to the plate at all. Are the cmdlets not installed? I am running this powershell window ...
tnk479's user avatar
  • 133
1 vote
2 answers
529 views

PowerShell to determine where a specific column has been used

I am trying to come up with a script to find out in which document libraries under the site collection, a specific column (Company name) has been used. I am using SharePoint online. Is this something ...
Harris's user avatar
  • 593
1 vote
1 answer
57 views

Deleting the newest folders from the SharePoint Library

Morning Everyone, I'm new in scripting so I'm looking for the small help. I have one case where I need to delete newest folders with the subfolders and the subfolders... and so on in the Library. I ...
marek -'s user avatar
  • 11
0 votes
1 answer
762 views

Unable to download files via powershell from Sharepoint Online?

I used to be able to download files from Sharepoint Online by logging in with Connect-PnPOnline and then running the following command; but today it put a real kink in my productivity and it didn't ...
leeand00's user avatar
  • 101
0 votes
1 answer
325 views

Get data from SharePoint List and SQL Table - compare them - PowerShell

I want to make a script which will get data from SharePoint list (from a specific column) and also get data from SQL table (from a specific column) and compare them. If the comparison value is true ...
jck4real's user avatar
0 votes
1 answer
2k views

PowerShell to get any Custom lists and Libraries in a site

Looking to obtain a list of any generic lists or libraries that have been created by users in a Site (exclude any OOTB, hidden or system lists.) have tried filtering on various list properties via ...
Mark's user avatar
  • 1
0 votes
1 answer
74 views

How do you find where an SharePoint auto notification came from?

My issue is trying to locate where an auto notification is coming from that was sent out but ran out of ideas on other ways to try. So I have a couple users that received an auto notification from ...
SPSN00B's user avatar
  • 43
0 votes
1 answer
137 views

SharePoint and Power Automate trigger overide - When an item is created

A PowerAutomate workflow as been created that triggers when a SharePoint item (list) is created which works ('When an item is created'). The problem is that an item has already been created in the ...
Orange Juice Jones's user avatar
1 vote
1 answer
813 views

Downloading library files options as external user

I'm a member of a SharePoint site as an external user and have access to a document library with lots of files/folders. I want all of this content downloaded for offline usage and sharing. I'm unable ...
Jason Eades's user avatar
0 votes
0 answers
108 views

How to find all the empty sites?

I am using SharePoint 2013 on-premises. There are so many empty sites. Is there a PowerShell way to identify these sites? I need a list of these sites so they can be deleted. I searched all over ...
shannon roth's user avatar
0 votes
1 answer
139 views

Reverse SharePoint Command

Get-SPWOPIBinding -Action "MobileView" -Application "WordPDF" | Remove-SPWOPIBinding -Confirm:$false Get-SPWOPIBinding -Application "WordPDF" | Remove-SPWOPIBinding -...
Ben Cooper's user avatar
0 votes
1 answer
354 views

How to retrieve all managed properties using csom or powershell in SharePoint online?

I want get a list of all custom managed properties from the SharePoint online site. Is there any way to get it using managed csom(c#) or powershell? Thanks in advance..
Akshay Belure's user avatar
1 vote
1 answer
240 views

Delete SharePoint Modern Page comments using PowerShell

I have a Site Pages library in Communication Site. I have to delete comments posted by 2 users on all the pages using PowerShell. There are many solutions available which use REST but I prefer to use ...
SBP's user avatar
  • 337
0 votes
1 answer
165 views

How to delete the last 20 rows of a Sharepoint list with Powershell?

Is it possible to delete the last 20 rows of a sharepoint list with a powershell script? I use the module pnppowershell. Gr. P
user1903995's user avatar

1 2
3
4 5
83