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

How to set up a single site app catalog?

Can anybody point me in the right direction on how to set up an App catalog for a single site in my tenant (SharePoint online)?
0
votes
1answer
18 views

Disable access request for all SharePoint online Sites

When users create SharePoint sites, By default access requests and Sharing are enabled. I would like to disable this feature globally on my SharePoint online Tenant.
0
votes
1answer
45 views

powershell does not fire “System.Reflection.Assembly.Load” in the event receiver

There is a problem with Enable-SPFeature command in case of having an event receiver in the feature. Feature Activated event is not fired. If I enable the feature manually everything works well. So, ...
0
votes
2answers
18 views

Submit-PnPSearchQuery Finding person or group

We have several Person or Group fields with users in them. We need to write a query that will find all content where that field contains a specific user. The following queries are returning 0 ...
1
vote
3answers
37 views

PowerShell script to unlock documents in SharePoint Online

I've a DocumentLibrary in which documents are required to be checked out but when I create a new document, as Admin, I can't to check it in because required fields are empty and, at the same time, I ...
0
votes
2answers
32 views

Empty Corporate OneDrive Recycle Bins from PowerShell

I am looking for a simple method (possibly a PowerShell script) that will completely empty OneDrive recycle bins (incl. the secondary recycle bins) within a given URL [tenant]-my.sharepoint.com/...
3
votes
3answers
47 views

SharePoint Online credential is not working in PowerShell

I am able to log in to my SharePoint online site using my credential but when I am connecting to the same SharePoint online site using the same credentials using PowerShell CSOM - getting the invalid ...
0
votes
0answers
25 views

Change the “site property” web part via PS

I have hundreds of pages in a site page library. All of them have the "site page" web part and currently shows things like keywords, published date etc. I want to add another field/property to this ...
0
votes
1answer
26 views

Error while Provisioning SPDistributedCacheService

Have run a PowerShell script to provision SPDistributedCacheService after running psconfig.(As I was Patching CU updates to 2016 SP farm) encountered this error: PS C:\Users\***.admin> $...
0
votes
1answer
23 views

Terminate a workflow for an item that no longer exists?

I need to finish a workflow that is still running in a document library that no longer has items (all were deleted, from de Library and the Recycle Bin). Maybe with Powershell, but all the solutions ...
0
votes
1answer
23 views

Getting error while importing managed terms from csv to sp online

I am using a PS script mentioned here: https://www.sharepointdiary.com/2016/11/sharepoint-online-import-terms-to-termset-using-powershell.html to import the terms from a csv file to the term store. #...
0
votes
1answer
30 views

Using PowerShell CSOM how can I get all versions of a 'Multiple lines of text' field from a SharePoint Online list item?

I have written a PowerShell script that queries a SharePoint list, but I am unable to get the previous versions of a 'Multiple lines of text' field. I have append changes checked in the field ...
0
votes
2answers
32 views

Get term value from a listitem and set it to another listitem via PowerShell

I first I get a site/listitem and store it in variable $page. $category = $page.FieldValues["myTermField"]; In above, I get the term-value in the field "myTermField" and store it in $category. I ...
1
vote
1answer
33 views

Add value from a variable to a list via PowerShell

I have a variable that contains column-value (terms) from a page/list $terms = $page.FieldValues["Terms"]; where "$page" is a variable containing the site page. I get another site page as a list ...
1
vote
2answers
27 views

Get specific field from a site page via Powershell

I get all my sites via: $pages = Get-PnPListItem -List Sites I use the variable and get to every site in a foreach-loop: foreach($page in $pages) { Write-Host "Page" $page.FieldValues["...
1
vote
1answer
29 views

Getting all SharePoint sites from root directory

So I am new SharePoint online administrator and working at a small company. I got a task to move my company into SharePoint which before were used minimaly without much of administration. Today I ...
0
votes
0answers
16 views

Cannot publish workflow to scope because it already contains the maximum number of workflows allowed

I'm getting the attached error (IDs hidden) when I'm running Powershell CSOM to delete existing List workflows and create a new workflow from a template.  Googled the error but it no results returned ...
0
votes
1answer
14 views

Copy items from Calendar list in each subsite to Calendar list in root site in SharePoint Online using CSOM PowerShell

I am trying to copy all items from Calendar list in each sub-site to the Calendar list in root site. Here are my thoughts. Is it possible to make a CSOM PowerShell script for this?
2
votes
1answer
33 views

How get ID of modern Site Features

I am using site designs to create new site collections attached to a hub site with the appropriate features enabled, now I seem to have hit a wall between classic and modern features. I have an action ...
1
vote
0answers
61 views

Powershell script to update a column for a given list item/site page

I have a powershell script that uses a variable $pages (containing all my publishing sites in a library) in a foreach, converts them from classic pages to modern pages and export them to a external ...
0
votes
0answers
19 views

How to copy an item which is in the newest folder in one directory to another folder

I am trying to copy a file from the newest folder in on directory to another folder. I have made the code below but it seems that the copy-item command does not work with variables. Does anyone have ...
0
votes
2answers
29 views

Collection was of a fixed size Error when Adding New User to SharePoint object

I encountered the following error when adding a user to a SharePoint folder object: Exception calling "Add" with "1" argument(s): "Collection was of a fixed size." At D:\User\Script1.ps1:...
0
votes
1answer
36 views

SharePoint Online: site url rename error

I have a sub-site in SharePoint Online with a document library containing large numbers of items. I want to rename the URL of the site. I tried multiple ways including site settings & PowerShell ...
0
votes
1answer
49 views

Megamenu and powershell

Is there a way for me to have a SharePoint Online modern list that I can use to make item entries in the SharePoint Megamenu via powershell? SharePoint list has: URL - name of my SharePoint page ...
0
votes
0answers
17 views

Rearranging data in folders

Below I have code where I am moving data (Excel Format) from one folder to another. I would like this code to run every day (once a day). I need help in the proper execution of this code. I would like ...
0
votes
1answer
49 views

Need Help with Powershell

Hi everyone, I need a help with PowerShell. We need to find out all the sites(possibly with lists and libraries and subsites too) a user have permissions to. Can we do this with PowerShell? If not ...
1
vote
2answers
57 views

How to find all Delve Blogs in the tenant

Recently, Microsoft has announced they are retiring Delve blogs So we wanted to know how to find all the Delve Blogs in the tenant. let me know if there is a way to get this information. Thank you
0
votes
2answers
22 views

Creating a content type with a specific ID in SharePoint Online using PowerShell

I had a content type in my default SharePoint Content Type Hub site (https://tenant.sharepoint.com/sites/contenttypehub) which I deleted before it was completely unpublished. As noted in this post, ...
0
votes
1answer
12 views

What are the permissions needed for an account to start a SP2013 Workflow by Powershell?

I need to run a SP2013 workflow on a number of list item as a batch job. I would like to use Powershell to do this as I would be able to selectively run the workflow on items that have specific ...
0
votes
0answers
18 views

SPList returns no result if CAML query is modified or removed

I have a SharePoint PowerShell script which gets items from a list. I am changing the CAML query for different output. However, upon changing or removing the CAML query, the method of list.GetItems()...
0
votes
2answers
19 views

Unable to Get SP List Due with Additional Parameter in Url

I am able to retrieve the List name of a document library with the following Document Library: http://test.com/RecordsDocument/ However, I encountered the following error for the following List: ...
2
votes
2answers
132 views

Write multiple people in multi-value person field using PowerShell (CSOM)

I have a CSV file which contains semicolon-separated Values to a certain field: Reviewer domain\userOne;domain\userTWO In PowerShell (CSOM - executed on my local computer) I am grabbing this data ...
0
votes
3answers
47 views

Add-PnPView - Sort by Ascending order?

# CREATE VIEW QUERY $Query="<OrderBy><FieldRef Name='Name' Ascending='TRUE'/></OrderBy>" # CREATE VIEWS FOR PLAYER BIO Add-PnPView ` -List 'Player Bios' ` -Title 'All Players' ` ...
0
votes
0answers
26 views

Don't move document library when running Invoke-SPOSiteSwap

Background: My company has a years-old Sharepoint site created as a Classic Team Site and we'd like to swap it with our new Communication Site. We successfully followed Microsoft's steps to modernize ...
0
votes
1answer
25 views

p1 script not running with schedule job

I have SP2010 in WIN2008R2, i have script(datemodifier.ps1) to update the diff of 2 dates in SP list daily, When I run the script manually its updating the list, but when i schedule it with a task on ...
0
votes
1answer
32 views

SharePoint Powershell Script - Update or Add List Item Conditional

I came across this script and it works great. But I need it to check to see if the list item exists first and do an update if it does. If not, then add the list item as new. Right now, it only keeps ...
0
votes
1answer
73 views

need help-SharePoint online powershell to copy choice to managed metadata column

can anyone please help me out with the PowerShell or any-other solution here. I have a SharePoint library with 4000 documents and it has a choice column called "test". and each document is set with ...
0
votes
1answer
22 views

Updating SharePoint Online List Hyperlinks - Multiple lines of text

We recently migrated domains and have a Sharepoint list with hundreds of hyperlinks. There are a handful of scripts out there for updating list items with URL fields, but am having issues ...
0
votes
1answer
35 views

SharePoint 2013: Add Second Domain to PP and Move User

Background: I am fairly new to administering SharePoint and have inherited this environment, but we are currently migrating to a new domain (domain B) and SP exists in the old domain (domain A). ...
0
votes
0answers
16 views

Generate a thousand team sites from a spreadsheet and associate them to a hub site

As a part of testing out some functionality on my local SharePoint Online tenant, I would like to provision the creation of about 2,000+ modern Team Sites (not attached to a group) based on a list of ...
0
votes
1answer
30 views

How to fetch a SharePoint site information (Report)

I'm trying to fetch a SharePoint site information (Report) i.e. Get No.of SharePoint Subsites, Lists, documents or SitePages under a site. List all the SharePoint Subsites, Lists, documents or ...
0
votes
0answers
14 views

Set-PnPDefaultColumnValues Error applying default column values

I am trying to set a default value for a taxonomy field on a SharePoint document library using a PowerShell script. The GUID is the guid of a term copied from the Term Store Set-...
0
votes
1answer
24 views

How to remove RoleAssignments from SPListItem/SPFolder correctly in SharePoint

In the library, I have ParentFolder which contains SubFolder. I have broken role inheritance in both ParentFolder and SubFolder (via a web interface). But when I remove role assignment for the user ...
0
votes
0answers
20 views

Get recurrence exception data using powershell

I need to be able to get data about the exceptions to a recurring appointment in a SharePoint Online calendar. Simplest would be to use SharePoint/PNP PowerShell. Right now on my test case, if I use ...
2
votes
1answer
83 views

Attempted Operation is prohibited because it exceeds the list view threshold enforced by the administrator

I am copying list items from one list to other list using powershell script.I am getting below error - Exception calling Execute query with zero arguments. The attempted operation is prohibited ...
0
votes
1answer
35 views

Microsoft SharePoint Online Management Shell issue

I have SharePoint Online Power Management Shell version 16.0.8316.1200 installed on my laptop. Now I want to install latest version of it, but previous version of the shell is not overwriting neither ...
0
votes
1answer
62 views

How to copy Content Type from one site collection to another (Both site collection having different template) SharePoint Online

We are looking for copy a content type from one site collection to another. Both site collection having different site template. How to copy content Type from one site collection to another in ...
1
vote
1answer
35 views

Search settings changed in PowerShell not applied

We created a search center in our intranet. We configured the root web of each site collection so that the search uses the search center. We also configured search navigation. Then we made a ...
0
votes
2answers
44 views

Log on to SharePoint with Powershell using the Credential Manager

What I would like is to logon to sharepoint with powershell using the CSOM-module and using the Credential Manager where I have safely stored the password. This is a working code to logon to ...
0
votes
1answer
42 views

Powershell Script to Remove Sharing Links After 90 Days

I'd like to know if it's possible to create a script to check a library for all guest access links (authenticated, not anonymous) and if they are older than 90 days, remove them. So for each folder ...