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
1
vote
1answer
21 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
0answers
16 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
2answers
985 views

I am getting Cannot find an SPSite that contains the following…Error

I have a PowerShell script below: Add-PSSnapin Microsoft.SharePoint.PowerShell function Get-DocInventory([string]$siteUrl) { $web = Get-SPWeb "http://contoso.com/sites/Test10" ...
1
vote
0answers
29 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
3answers
2k views

Uploading Files to Sharepoint Document Library and Updateing Column Fields Using Powershell

I'm a new learner to Powershell and a bit new to SharePoint as well. I'm learning powershell to create a script that uploads files to a sub-site library inside SharePoint. I managed to get it working ...
0
votes
2answers
1k views

How to check permissions per specific user for all sites in SharePoint Online

How can I check (create csv report) all permissions per specific user for ALL SharePoint site collection on SharePoint Online tenant? Is there PowerShell script for that as I'm not aware of a report ...
0
votes
1answer
886 views

$list.RootFolder.Url empty

I get an empty url when I try to retrieve the list root folder url. I use these Powershell commands on a Sharepoint 2010 server. $web = Get-SPWeb -Identity "http://mywebsite" $list = $web.lists["My ...
0
votes
1answer
8 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
28 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/...
0
votes
1answer
33 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 ...
0
votes
2answers
1k views

Same Content Type Display Name, Different Internal name

I know that you can have internal names and display names for columns but can you also do that for Content Types? For example, we have the following with our current powershell script: ...
0
votes
1answer
23 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 ...
0
votes
2answers
29 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 ...
1
vote
1answer
30 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
27 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
1answer
14 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
1answer
17 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
774 views

Import-SPWeb: Document library Import Failed

I am doing document library import by using Import-SPWeb command but it failed with below error. There was no error or warning in Export process. Error: Cannot complete this action. Please try ...
1
vote
2answers
1k views

Changing logo on all SharePoint Online site via PowerShell

Is it possible to create a script that will loop through all the sites in a site tenancy to replace the logo that is attached to each one. I'm unable to locate any useful commands in the SPO ...
1
vote
1answer
4k views

Could not authenticate to SharePoint Online using OAuth 2.0

I am using following commands to connect to my SharePoint Online environment. Connect-SPOService -Url "https://testdomain.sharepoint.com/sites/test1" Connect-PnPOnline -Url "https://testdomain....
1
vote
0answers
14 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
25 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
990 views

How to change text encoding when inserting values inside a sharepoint list using powershell?

I'm using french words with special characters like "é" "à" etc. When I trying to insert text in my list fields using powershell, it does insert the values but the characters aren't well encoded. For ...
0
votes
1answer
975 views

Convert the Powershell script to Python 3

I'm trying to perform an upload files from Linux to SharePoint using Python. However, I tried a lot by googling but nothing help. At last, I got a PowerShell script that is working. So requesting help ...
0
votes
3answers
2k views

How do I run the social timer jobs in powershell?

As title says. I've applied ratings to documents and they, obviously, haven't appeared yet. Is it possible to use powershell to explicitly force these timer jobs to run immediately? I believe the ...
0
votes
1answer
18 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
924 views

get all recursive terms from termstore powershell

I have a requirement where I need to match a string value with all the terms in a given termset ID. My termset contains terms inside terms(recursively) until 5 levels. My Current Code : $...
0
votes
1answer
1k views

Powershell CSOM to retrieve Permission levels tagged for the group

Can any one code me to retrieve the permission levels tagged for the group using Powershell CSOM.Please tell me the property her is my code sample Add-Type -Path "C:\\Microsoft.SharePoint.Client.dll"...
2
votes
2answers
924 views

I can't seem to retrieve SharePoint 2013 list items via Powershell

I have a short script which is going to be part of a larger one but I can't get it to work. It works on every other list I've tried running it against but not this one in particular. The $myList....
0
votes
1answer
2k views

error “The object is used in the context different from the one associated with the object.” while assigning permissions to item in sub site

I am working on assigning permission groups to the list item which is in sub site level. the same code is working fine for top level site.but getting error at sub site level. function ...
1
vote
1answer
1k views

How to delete calendar items from SharePoint online calendar list using PowerShell?

I have a SharePoint calendar having more than 35k items.The Calendar has data from 2011 and onwards. I would like to use PowerShell script to start removing items from 2011 to 2016 from the current ...
2
votes
1answer
791 views

Get Selection from Lookup Table CSOM PowerShell in Project Server

I have a custom field at the project level that is a lookup table (single select). I cannot for the life of me figure out how to get the value of the selection from the lookup table. I can get the ...
0
votes
2answers
912 views

Compare items in 2 lists using Powershell

I want to compare some items in 2 Lists: Update item "Company Name" in List 2 when it not match with item "Existing Company" in List 1. I don't know how to proceed!
0
votes
1answer
30 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" -...
1
vote
1answer
769 views

give permissions to folders o365 powershell csom

Have this code function GetChildFolders($RootFolder) { if($count -ne 1){ $folderName=$folderName+'\'+$RootFolder.Name ...
0
votes
1answer
2k views

Not able to create modern team site with group through PowerShell

I am trying to create office 365 group through PowerShell. I am using New-Unified group function to achieve. Group is creating successfully but unfortunately site is not creating behind the scenes. Is ...
0
votes
1answer
1k views

Can I retrieve SharePoint 2010 workflow steps with PowerShell

I can use powershell to get the names of all SharePoint Designer workflows in my farm - but is there a way to look at the steps of the workflow? Specifically, this farm has the iLoveSharePoint....
0
votes
1answer
1k views

Get size of a ListItem

I've been recently working a lot of scripting with Powershell 2.0 towards SharePoint 2010, tasked with building various scripts that would for example print some information about 10,000 lists, as a ...
0
votes
2answers
22 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
26 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?
0
votes
2answers
29 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
854 views

Update filed values based on conditions

i have document library in sharepoint 2010 and i want to update a field values based on some conditions . I need that every parentid has some documents and i want to update those prosessnos which ...
1
vote
1answer
768 views

SharePoint 2010 enterprise migration to SharePoint 2013 - Test-SPsite FailedErrorCount

I'm in the process of migrating intranet site in SharePoint 2010 to a new SharePoint 2013 farm. I have followed the steps from here. Problem appeared when I ran the PowerShell command Test-SPSITE and ...
1
vote
1answer
821 views

SharePoint 2013 - Export site error

I have a problem by exporting a SharePoint Site by using Export-SPWeb on my SharePoint 2013 server. The error code is: Export-SPWeb: These columns don't currently have unique values. Is it ...
1
vote
1answer
29 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
1answer
780 views

How to give application pool account permissions to search service application

We all probably know how to give application pool account permissions to search service application through central admin. But i want to do this using Powershell. What will be the Powershell script to ...
0
votes
1answer
23 views

Script adding a group as a Onedrive secondary admin

In the Onedrive admin panel, you are able to specify a group when using "Enable My Site Secondary Admin" - this should make that group secondary admin on all newly created Onedrive sites. ...
0
votes
1answer
22 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
vote
1answer
847 views

Creating Result Sources by PowerShell

I want to create a PowerShell script that creates Result Sources in Search Service Application. If it's possible I would like to state the Result Sources in an XML-file with a sourceID. How can this ...
1
vote
1answer
38 views

How to adjust the format of the date in PowerShell?

I need to change the format of a date: ["Date"].ToLocalTime().ToString("dd-MM-yyyy"); In this code where i have specified the columns. One of the is the column Date. $Global:...

1
2 3 4 5
79