People who code: we want your input. Take the 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
1answer
16 views

RowLimit not working in PowerShell Get-PnPListitem

I am trying to get few items from SharePoint list so I am using RowLimit in a query, but it doesn't seem to work. $query = "<View><Query> <Where><Eq> <FieldRef Name='...
0
votes
1answer
7 views

Get-PnPListitem with query filtered by number, converted to string, not working

I have a powershell script where I need to get some items from SharePoint online list, filtered by one value in string column, and it only works if I put value in quotes. $Number=123 # NOT working, no ...
0
votes
2answers
26 views

Authenticate via Graph API without an app secret or an app certificate?

Sorry for the lazy and not well formulated question. Is it possible to authenticate via Graph API without an app secret or an app certificate via PowerShell withiut being a tenant admin? I was on a ...
0
votes
1answer
13 views

Set SiteDefinedSharingCapability property

Does anyone know how to set the SiteDefinedSharingCapability property for a OneDrive site? This is what I am trying to do: Set-SPOSite -Identity https://contoso-my.sharepoint.com/personal/site_name -...
0
votes
1answer
35 views

SP2016 Copy specific records from big list to anther list with PowerShell

I was able to copy all records from a big list to another list but not able to copy specific records form source list to the destination list using PowerShell as below, Any Help Please. $web = Get-...
0
votes
1answer
15 views

Restore all permissions on a sharepoint site Sharepoint Online

Restore all permissions on a sharepoint site, we have a sharepoint site that I have deleted several permissions at random and so I will need to restore the permissions (go back to the 05/29/2021 ...
0
votes
0answers
10 views

Check if content editor or script editor web part is present in the list forms (New/Display/Edit form) using PowerShell (CSOM/PnP)

I am trying to check if the content editor or script editor web part is present on the list forms (NewForm, EditForm, DisplayForm) in SharePoint 2013. I can get the web part type from web part page ...
0
votes
2answers
24 views

Is there a way to get report on IRM enabled Libraries and lists?

I am not able to find right PowerShell or a way to get a report on IRM enabled libraries and lists. What I am looking for is to get list of Libraries and Lists that has been enabled with "IRM ...
0
votes
1answer
40 views

Is the SharePoint Online PowerShell module compatible with PowerShell 7.1.3 (core)?

I have two versions of PowerShell installed on my Windows 10 desktop - Windows PowerShell (5.1) and PowerShell core (7.1.3). I've installed the Microsoft.Online.SharePoint.Powershell module (version ...
0
votes
2answers
28 views

Get-PnPView : Object reference not set to an instance of an object

I need PnP command to check if view exist on list before creating view. Get-PnPView -List "list1"-Identity "view1" However, I am getting below error if view doesn't exists. If ...
0
votes
1answer
29 views

SharePoint Retention Policies List

I am currently using SP 2010. I have get the list of retention policies enabled sites and Document library / List in my site collection along with my retention period. Can someone help me with a ...
0
votes
1answer
56 views

PnP Powershell - Export list of folders

I need to export a list of all the folders, sitting under all the sites associated with a HUB Site, which are modified between a specific date range into a CSV file. Could I please get some help?
0
votes
0answers
15 views

Connect to Compliance Center with certificate based authentication or secret

I am trying to set a retention policy using powershell and new modern certificate based authentication as basic is being retired i have registered an app and added a certificate and i can connect to ...
0
votes
1answer
37 views

Sharepoint Online - powershell cmdlet update-usertype - Exception

when I run this command: update-usertype -LoginName *username* I get the following error message. However, I do not know what this means. Exception has been thrown by the target of an invocation I ...
0
votes
0answers
24 views

Optimizing Connections

I have a script that makes multiple actions (create site, add users, tweak permissions, copy homepage, etc) and I'm using several cmdlets (maybe not the right definition...) to achieve this. We begin ...
0
votes
1answer
37 views

How to copy a SharePoint Online Document Library from one site to another via PowerShell

I can easily see that from the UI, there are "copy to" and "move to" options for Libraries. But I would like to use PowerShell to copy an entire library from one site to another ...
0
votes
1answer
30 views

How to add app from SharePoint store?

This is only on SharePoint online. I am trying to add app from the SharePoint store online but when I request the app I get a message ‘ Your tenant administrator has to approve this app’. (not sure ...
0
votes
1answer
21 views

Cannot see all SharePoint Libraries using PowerShell

This is my first time attempting something like this, so I'm hoping this will be a simple question to answer for some of you. I have a client site where I'm trying to iterate through a collection of ...
0
votes
1answer
36 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 ...
0
votes
1answer
20 views

can any one provide complete script to compare csv file and SharePoint list column(People) and extract records not exist in SharePoint list

I have one excel file and a SharePoint list(Employee master). I want to extract the user in csv file who is not in the SharePoint list(Employee Master). If the employee not exists in SharePoint list ...
0
votes
0answers
65 views

Escaping strings containing single quotes in PowerShell

How can i replace/escape the single quote in the name cai.o'dowd as its causing errors string is i:0#.f|membership|cai.o'dowd_hod.com#ext#@xyz.onmicrosoft.com Currently i'm doing the below and ...
1
vote
1answer
51 views

How to get the list item ID of a nested library folder using PnP PowerShell?

I am trying to add metadata to document library folders created using the Add-PnPFolder command. I've been using the Set-PnPListItem command to do this, which requires the folder's list item ID. ...
3
votes
1answer
39 views

SharePoint Online - limit apps / lists available

My customer wants to limit the Apps (basically list templates, libraries, etc.) available in a site. So after you create a team site or communication site, when the owner goes to add an app, how to ...
0
votes
1answer
34 views

Export Security group using PowerShell

I have SharePoint 2013 sites. I want to export all the security group in Csv file. I want the security group name and the principle type of the group. Also, it is located in site level or subsite ...
1
vote
3answers
62 views

Generate a List of External Users for SharePoint Online

Is there a way to generate a list of all External Users for the Entire SharePoint Online Tenant?
1
vote
1answer
30 views

How to change the column names of a hashtable before it gets exported to Excel?

I have a powershell function that reads a Sharepoint list and puts it into a hashtable and then export it to Excel. In the code the InternalName of all the Sharepoint list columns are specified: $...
0
votes
2answers
22 views

Is Custom Script Enabling required for PNP PowerShell?

We are generating a PNP PowerShell to copy any document library files to file share. The issue we are facing is with "Get-PnPListItem" command. When we try with a tenant that has custom ...
1
vote
1answer
40 views

SharePoint Online: View on Document Library Subfolder Does not Display Folder Files

I'm using the PowerShell script below to create views on a SharePoint Online document library with subfolders. The script creates the view, but does not display the files contained in the subfolder. ...
1
vote
1answer
14 views

Fetch an image from OneDrive Business by ID using Graph API using PowerShell

I'm attempting to retrieve an image from my OneDrive via the Microsoft Graph API. I made sure to have all the necessary permissions to do so. This has worked in the past, but now it's returning error ...
1
vote
0answers
68 views

SharePoint 2019: filter users and groups in People Picker with ActiveDirectoryCustomFilter

We are currently trying to filter the People Picker in SharePoint 2019 for users and groups, but we have a little bit of trouble. Currently, we have the following filter: (&(objectCategory=person)(...
0
votes
0answers
22 views

SharePoint Custom Timer Job GAC and DLL Problem

One of my collegaues has developed a custom timer job and our custom dll has been referenced in that timer job project and packages. I deployed the solution and everthing was working fine until next ...
0
votes
1answer
21 views

web URL variable doesn't like spaces in Powershell

I'm relatively new to PowerShell and getting my head around a script i am modifying for my environment. Simply put, I need to add a URL as a variable to my script, but there is a space in it. I have ...
1
vote
1answer
30 views

Web parts are not displayed on the new PnPClientSidePage

I'm trying to get "webParts" from the client's site to see which ones are present and then delete the selected ones. The problem is that when the page is new the script does not find any ...
0
votes
1answer
55 views

SPOSiteSwap : Errors: [1]; Warnings: [0]; Details: The Site is not a communications site or it has the classic publishing feature enabled

SPOSiteSwap: Errors: [1]; Warnings: [0]; Details: The Site is not a communications site or it has the classic publishing feature enabled. Trying to replace the communication site with modern team ...
1
vote
1answer
38 views

How can I speed-up list item migration between two Sharepoint sites?

I have two Sharepoint sites, let's call them Business and Party for example. The Business site has a list with 1000+ items. I want to copy the list items to the Party site. I want to do this in a ...
1
vote
1answer
32 views

Problem with compare two String in powershell

I want to identify the type of web part by its name, in this case "news". If the title of the web part was the same as "string2" I would like to delete this web part. I don't ...
0
votes
2answers
43 views

How to remove Quick links, news with json

I would like to remove default team site components such as: Quick links and news. So far I have been using Site design JSON schema to change navigation(remove, add new) on the left side. Can this be ...
0
votes
1answer
42 views

How to update the value of a choice/multichoice column in Sharepoint online through coding

Is there a way through using a piece of code to update all the specific values of a column of SharePoint online to something else? I am looking for an equivalent of the below SQL code for Sharepoint ...
1
vote
1answer
33 views

How to modify the same attribute of multiple lists with exact schemas in Sharepoint online through coding or ms flow

I have several lists with the same exact schemas in SharePoint Online. How can I do the following? 1- How to add/remove a column to/from all of them? 2- How to add/remove an option to a choice/...
1
vote
1answer
31 views

SPO CSOM Powershell manage folders with # and % in the name

I'm writing a CSOM PS script to create folders in a doclib, and set permissions on them. Anything works fine except when the folder name contains a % I am able to create the folder using ResourcePath, ...
0
votes
1answer
26 views

SharePoint Online - Trying to change page layouts of all pages of a publishing site through PowerShell

I am on SharePoint Online environment and am trying to change page layouts of all pages with in a Publishing site. By default the page layout is basic and am trying to change all pages to use a custom ...
1
vote
0answers
15 views

Auditing PowerShell Activity

I can see changes made to SharePoint Online using the available audit logs etc. But I don't see PowerShell activity by admins or others. Most like a person who is going to hack the platform is going ...
0
votes
1answer
39 views

Add/Change image on a SharePoint List image column

I have a SharePoint list with a column that only accepts images called Photo (SharePoint Online environment). I'm trying to add a new image to each row programmatically, but so far I've had no luck. ...
0
votes
1answer
35 views

Copy a Sharepoint Listitem from one list to another using PnpPowershell

I want to copy a list item from one list to the other using PnP PowerShell. To copy a list item from one List: Get-PnPListItem ??? And to paste the copied item to the other List: Set-PnPListItem -...
0
votes
1answer
52 views

How to change the value of a column “Modified By” of a Sharepoint List with Powershell?

I have this code below but it doesn't work. Is it possible to change a value of the column "Modified By" in a Sharepoint list with Powershell? Set-PnPListItem -List "mylist" -...
0
votes
1answer
28 views

Powershell: Check if page has unpublished version?

How can I use PowerShell to check if the latest version of a publishing page has been published?
1
vote
1answer
36 views

SPO PowerShell - Add AD Group to SharePoint Group on Document Library with Broken Inheritance

I'm fairly new to SharePoint scripting and after much searching I'm reaching out to see if someone can help me with the commands needed to complete this task. I'm have a SharePoint Online site that ...
0
votes
2answers
31 views

The name used for this field is already used by another field in the list. Select another name and try again

I am adding a content type to a library using powershell. But it is throwing me this error: Exception calling "Add" with "1" argument(s): "Field name already exists. The name ...
0
votes
2answers
24 views

I need to copy values from a Sharepoint list to another in different site collection. Both site collections are on-premise. Many thanks

I need to copy certain fields i.e Title , Description values from a Sharepoint doc library to a List in different site collection. Both site collections are on-premise. Many thanks
0
votes
1answer
24 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 ...

1
2 3 4 5
79