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]

1,080 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
2k views

New-SPSite gives ERROR: Failed to OpenThreadToken, LastError=1008 in Timer job

I have a timer job that is running some powershell. The script creates a content database and then attempts to create a site collection. If run from powershell prompt the script works fine. If I ...
2
votes
1answer
20 views

Office 365 permission list of a single user in different collections

I want to see all various site permissions which user has in all site collections - globally within my organization. Office 365. My idea is a Powershell script which would make a report about all/...
2
votes
3answers
668 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 ...
2
votes
1answer
223 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 ...
2
votes
1answer
1k views

PnP PowerShell - Get-PnPFile error checking if file exists

I'm trying to check if file already exists in a SPO document library using PnP PowerShell command. This is part of my PowerShell script: Try { #Get all Files from the source folder $...
2
votes
0answers
110 views

Configure SSRS Report Data Source Link programmatically via PowerShell or Console Application

I require to set the data source link of SSRS reports. The SSRS Reports and the Data Source reside in a document library. I want to set the shared data source for all the SSRS reports of the ...
2
votes
0answers
36 views

How to migrate SharePoint Workflows using PowerShell?

I am migrating subsites to a different site collection using Export-SPWeb and Import-SPWeb. However, I am losing all OOTB workflows as well as SPD workflows via this means. The SPD workflows exists ...
2
votes
0answers
90 views

Migrating the Rating for our discussion board list from on-premises to online

I have a team site inside our sharepoint farm 2013. and the team site contain a Discussion board list which have rating enabled. now using a third party tool named share-gate i migrated the team site ...
2
votes
0answers
419 views

The following exception occurred while trying to enumerate the collection: “<nativehr>0x80070003</nativehr><nativestack></nativestack>”

We are running a PowerShell script on our farm at the moment to pull all the users and their permissions. The script is working fine on all of our sites, but one is giving us the following error: The ...
2
votes
1answer
1k views

How do I delete the folders in a subfolder of a folder using powershell

There is a document library folder named "Request Documents". There are folders in this folder Library. Again under each folder there is an other folder in it. I need to delete this folder. But I'm ...
2
votes
1answer
362 views

Application pool already exists error or Access denied

I have a problem with creating a web application and application pool. I use this code: New-SPWebApplication -Name $Name -Port $port -HostHeader $header -URL $url -ApplicationPool $ppn -...
2
votes
2answers
787 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....
2
votes
0answers
430 views

Create Top navigation Node using PowerShell

I'm trying to automate the process of creating a subsite using PowerShell, but I can't figure out how to create TopNavigaiton link. The problem is that SPWeb.Navigation.TopNavigationBar is null when I'...
2
votes
1answer
765 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 ...
2
votes
0answers
176 views

Can I use PowerShell to import .XOML file for SharePoint Designer 2010 Workflows?

I have created a PowerShell script for downloading .XOML file for SharePoint Designer 2010 Workflows. (Below is the snippet for downloading .XOML file) Can I use PowerShell to import .XOML file for ...
2
votes
0answers
216 views

Microsoft flow and sending emails

At my Organization, we use g-mail as a our email provider. I have a basic Microsoft flow approval process with a SharePoint list. The process works like this One person from help desk puts a request ...
2
votes
1answer
110 views

Delete SharePoint Calendar Overlay

I am trying to delete the calendar overlay but I am not able to delete it. The overlay is from the other site collection, but that site collection is deleted. When I try to delete the overlay, it is ...
2
votes
1answer
979 views

SharePoint migration. Error: Object reference not set to an instance of an object

I try to migrate my sharepoint library from on-premise SharePoint 2013 to SharePoint online. I do this by folowing SharePoint Online deployment advisor instructions. I did this successfully: Export-...
2
votes
0answers
39 views

SharePoint 2010 User Custom properties

Here is my question. I saw in a previous post about getting when a user last logged in to SharePoint. My understanding is that you can find this in the audit logs or you can add a custom property ...
2
votes
0answers
122 views

which SPRoleDefinition.BasePermissions responsible to mark discussion board list's items as featured. if i want to create a cusotm permission level

I have the following inside my sharepoint on-premises 2013 farm:- Team site collection, which have the publishing featured enabled. Inside the Team site collection, i added a Discussion Board list. ...
2
votes
1answer
188 views

Unable to install SharePoint 2016 patches via Remote PowerShell with Windows Update

I am trying to install a patch to SharePoint 2016 Farm using Remote PowerShell. I have administrator rights on the remote SharePoint machines and Windows Update COM Objects are created successfully as ...
2
votes
1answer
72 views

Get all site collection users properties

I'm trying to list user information from the whole site collection but lot of the properties are just blank: Get-SPUser -Web https://sp.contoso.com/sites/test -Limit All | Select UserLogin, ...
2
votes
0answers
1k views

Querying List Item Field Values with PowerShell Problem

I have googled this a lot and have found trouble finding an instance of someone having similar issues with a resolution. I am currently working on querying a medium sized list on a sharepoint farm so ...
2
votes
1answer
38 views

Power Shell script does not return result of Library

I have written a below PowerShell script to get items of a library for SharePoint 2013 $spData = $web.Lists["EmployeeDocument"] -as [Microsoft.SharePoint.SPDocumentLibrary] $fieldsItems = $spData....
2
votes
0answers
179 views

Read excel file in library1 and update excel file in library2/list using powershell in sharepoint online

If user enters/updates raw data in excel file in document library1 which resides in SharePoint online site updated data should be reflected automatically in excel file in other document library2 or ...
2
votes
0answers
1k views

powershell script get permissions for the user in sharepoint online

in the below PowerShell script I want to get the permissions assigned to the users. $spgroup.roles is not displaying anything. Can any one help me on this, #Add - PSSnapin Microsoft.SharePoint....
2
votes
0answers
27 views

How to uncheck the userprofile picture property display setting options using powershell?

I need to hide the user profile picture property in edit your profile dialog, I tried $userProfileConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($...
2
votes
0answers
425 views

Change SharePoint 2013 web part search query using Powershell

I need to edit the query of a Search Results web part on multiple pages of the same site collection (with no subsites). With the following code, I've been able to change the web part's title, but I ...
2
votes
2answers
2k views

How to export SharePoint list data to xls or xlsx format using poweshell

I want to export SharePoint2013 list data into .xlsx or xls using PowerShell. In my server, there is no Excel installed.
2
votes
0answers
175 views

Adding Custom Webpart To SharePoint 2010 Site using Powershell

I am trying to add a custom webpart to a SharePoint site but I keep getting an error saying it cannot deserialize the web part. Any idea why? My google-fu is failing me. if ( (Get-PSSnapin -...
2
votes
0answers
591 views

Unable to execute: Add-PSSnapin Microsoft.SharePoint.PowerShell on Windows 2016

I have SharePoint 2016 November CU running on Windows 2016. I try and execute Add-PSSnapin Microsoft.SharePoint.PowerShell in an administrator PowerShell command shell and it Hangs. I cannot break in ...
2
votes
0answers
1k views

How to get workflow with powershell?

In SharePoint 2013 on-prem I provision custom workflows (.xaml - definitions) to SharePoint sites by using office dev-PnP. I add the workflow to a spesific list in all sites, and the workflow works ...
2
votes
1answer
85 views

Make Project web app site a Template site in another Project server web app

I have one test WA on which I have Project web app. Each project site has own SharePoint site where we created several custom lists/libraries and we created custom reports in dashboard designer (there ...
2
votes
0answers
75 views

Create list Item and add versioning using Powershell

I have export list item data inducing version in CSV file in above picture item ID 1 has version 1, 2 and 3. I have enable version in list. so I'm trying to create list item with first version ...
2
votes
1answer
1k views

Deploy and install a SharePoint Hosted Add-in to all site collections (sites and subsites) at once in SharePoint Online(Office 365)

I have many site collections that use a SharePoint Add-in common for most of the pages in sites and subsites. Each time when I create a new version of add-in and upload in appcatalog, I have to ...
2
votes
1answer
129 views

How to get user specific information from content database in SharePoint 2010

I am using SharePoint 2010. I want to know the user specific details i.e. when and by whom a specific user was given permission to the site. My audit logs are disabled in CA.Is it possible to get the ...
2
votes
0answers
94 views

Powershell script returning Libraries that do not exist in the error log

I had created a powerShell script to get a list of all the documents added to document libraries across the entire Web Application. But it somehow returned some libraries that did not exist in the ...
2
votes
0answers
429 views

What's the c# equivalent of New-SPClaimsPrincipal in powershell

I am using following powershell command to get AD group claim from FQDN of AD grp $ADclaim = New-SPClaimsPrincipal -TrustedIdentityTokenIssuer "trustedIdentifierName" -ClaimValue "cn=adGrpame,ou=xxx,...
2
votes
1answer
695 views

PowerShell Script to assign Default Content (folders/files) to SP 2013 Document Set Content Type

I am using SharePoint 2013 on premises to build an application which utilizes a Document Set Content Type. I have used the GUI to: Create Site Columns for the website; Create a Document Set Content ...
2
votes
1answer
554 views

Iterate through subfolder in list via CAML & Powershell

I have a need to remove unique permissions on documents in a list, however, the list is over 5000 items so the following won't work, and its SharePoint Online so I can't change the threshold. $ctx=...
2
votes
1answer
1k views

How to remove duplicate list items (keep higher version ) using powershell script?

I am working with SP 2010 Sharepoint Lists where the list items is having unique column " Document No" and each items are having "version". Each time the list items are getting updated/New items are ...
2
votes
0answers
286 views

How I Export some managed meta data column of sharepoint Document Library using PowerShell

I am getting the value for my text field as i need but for my taxonamy column it also give guid id and my taxonomy column are multivalued so i want to export like as store in sharepoint document ...
2
votes
0answers
301 views

Save a SharePoint 2013 workflow as template using code behind

We have around 100 SharePoint 2013 workflows in our Farm. We need to save these workflows. It is tedious to manually open Sites in Designer and go to each workflow and store it as a template. Is there ...
2
votes
2answers
2k views

Setting SharePoint Group as SPGroup Owner using PowerShell

How can i set existing SharePoint Group as Group Owner (instead of SPUser, set SPGroup as owner) using PowerShell at the time of creation of new Group?
2
votes
2answers
3k views

How to install app from app catalog using PowerShell?

Does anybody know a way of installing app from app catalog using PowerShell? There is an article on MSDN about adding apps: Add apps for SharePoint to a SharePoint 2013 site. It describes the way of ...
2
votes
1answer
148 views

PowerShell Cmdlet Not Recognised

While researching the timer job App State Update I was wondering if I could find the URL it accesses so I could retain its functionality by whitelisting that single URL and blocking all other internet ...
2
votes
0answers
285 views

CheckIn large amount Items in overloaded Library

I have a O365 client that has 85,000 items in a folder structure in a library in their SharePoint online. Also they have hundreds of items that were never checked in and invisible for other users. I ...
2
votes
0answers
338 views

Adding a custom lookup field to new list doesnt add it to all associated content types

Ive searched for answers to this, and cant seem to pinpoint my problem here elsewhere. Basically what Im doing is that I have a PowerShell script which that, 1) creates a Content Type (ContentTypeX)...
2
votes
1answer
509 views

Delete major version powershell csom

I have a document library where i have uploaded documents it has 2 major versions and i want to delete the first major version. Is there powershell csom code i can used to do this
2
votes
0answers
6k views

Find out where the content type is still in use

I have deleted the content types from the libraries/lists using powershell, but now when I go to delete them at the site level it tells me the content type(s) is still in use. I have checked the ...

1
2
3 4 5
22