Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

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
vote
1answer
18 views

Powershell to create top link navigation

I want to create top link navigation items via powershell script to multiple sub sites, can anyone help? You may wonder why can't we add it manually via navigation, I'm using SharePoint 2019 ...
0
votes
1answer
18 views

How to get the view of a SP list in PS code

I have this code: $List = $Context.web.Lists.GetByTitle("MyList") $Query = New-Object Microsoft.SharePoint.Client.CamlQuery $ListItems = $List.GetItems($Query) $context.Load($ListItems) $context....
0
votes
1answer
15 views

Get the columns name of a Sharepoint list when the columns name has spaces in it

I have code that gets all the items of a SP list and export it to CSV. In the code below I have specify the column called "00:00 - 07:59". But it doesn't work because the columns name got spaces in it....
1
vote
2answers
17 views

Powershell: When to call Dispose() on SPweb/SPSite variables?

I have been reading and I've found different approaches about when to use Dispose() I want to know if when using SharePoint 2016 Management Shell I will need to call it for the following cases: $...
0
votes
1answer
20 views

SharePoint Online : Powershell get id from document set created

I have created a document set by powershell and I would like to get ID of the document set created to update name with this ID. where Name of the document will be in format Name_ID I m not able to ...
0
votes
1answer
20 views

SharePoint online audit

How to get sharepoint online audit data programatically without using Search-unifiedauditlog commandlet.
1
vote
1answer
30 views

How to display workflow name and workflows in progress count from SharePoint 2013 using PowerShell

I am able to navigate till workflow associations. Can anyone help me to display the workflows in progress count and the workflow name
0
votes
1answer
21 views

create a clientcontext if legacyauth is false

How to create a client context if legacyauthprotocol is set to false.without changing the legacyauthprotocol using csom.
2
votes
2answers
42 views

PowerShell: Generate a report of all items across a site collection where a column has a specific value

I am trying to come up with a script to do the following in my SharePoint 2013 environment, and have not had much luck. I need a script that will generate a report/csv that will list all items in ...
1
vote
1answer
19 views

Export Additional Columns in Version History Export SP 2013

I found this solution on this forum and was able to pull some information but with the workflow we have on the list, we need more information. We have an "Approval Status" column that we can see when ...
1
vote
1answer
15 views

Powershell script to check if the migrated document libraires contain all the on-premises verisons

we want to migrate our sharepoint on-premises 2013 sit e to SharePoint online. and some document libraries contain very important documents to us. where these docuemnt libraries have minor and major ...
0
votes
1answer
26 views

Powershell script to find sites having property bag in sharepoint 2013

We are using SharePoint 2013 and there is one property bag having key as "DATA". i want a powershell script to know in what all sites this "DATA" property is there and what is the value of this in ...
2
votes
1answer
26 views

Issues retrieving SharePoint Online Audit Data

When I try to retrieve the Sharepointonline audit data using search-unifiedauditlog .For an particular site it seems to be getting only pageview where as other events are not able to be fetched Even ...
1
vote
2answers
22 views

The current user is not a tenant-administrator

I have owner right of a teamsite. But I am no tenant administrator. I only want access with PowerShell to my own teamsite not to the whole farm. But I found this code below to logon to sharepoint-...
0
votes
2answers
31 views

Get-PnPListItem Not returning all the Fields

I am new to using PowerShell with regards to pulling data from SharePoint using PnPListItem. I have my code below: Write-Host "Please enter URL of the SharePoint site:" $url = Read-Host Write-Host "...
0
votes
1answer
11 views

Sharepoint script for long path ways and some file types

I have heard that there is a script that we can run on the files and folders before migration and it helps us to not the have errors like "long path way" etc. This script as i know run in powershell ...
2
votes
2answers
28 views

Try to get the snapin “Microsoft.SharePoint.PowerShell” in Powershell but i get an error

I try to get the snapin "Microsoft.SharePoint.PowerShell" in Powershell but i get an error. Add-PSSnaping : no snap-ins have been registered for Windows PowerShell version 5 How can I solve this?
1
vote
1answer
34 views

Retrieve Items in Video Document Library using PowerShell

I'm wanting to retrieve all items within a Video Library on SharePoint and grab the owners/Created By list and all that I haven't been able to target videos only. I'm able to pull in all of the ...
0
votes
2answers
25 views

2010 - Copy user field values containing orphaned users

Good day everyone, I need to copy documents and metadata from a library in site collection A (legacy) to another one in site collection B (brand new) via PowerShell. Lucky me, there's is only the ...
2
votes
3answers
21 views

Managed metadata service creation in SharePoint Online

How to create managed metadata service in SharePoint Online for creating a separate term store. Is there any powershell script as i cant see any out of the box option in admin centre.
0
votes
0answers
22 views

PowerShell: Get List Item's custom field values(List Items are in Recycle Bin)

There are several list items with the same name and author in Recycle bin. I need to retrieve all the fields(not only ID, Title, and other standard fields) before restoring. How I can retrieve custom ...
1
vote
1answer
25 views

Powershell script showing access denied error even though connecting through site collection admin user account

I am facing a weird issue in regards to the PowerShell script I am using to import terms from CSV into a termset called Season. Source:http://www.sharepointdiary.com/2016/11/sharepoint-online-import-...
1
vote
2answers
26 views

Powershell errors about Dtd

I am using PowerShell script listed here: http://www.sharepointdiary.com/2016/11/sharepoint-online-import-terms-to-termset-using-powershell.html to update managed metadata terms but for some reason ...
1
vote
1answer
23 views

Insert LookUp column in list using Sharepoint PNP PowerShell

I've this code bellow OfertaParticulares Connect-PnPOnline -Url https://test.sharepoint.com/sites/test/Negocio/OfertaParticulares -Credentials (Get-Credential) $listName="Páginas" $fieldName="...
1
vote
3answers
46 views

How to hard-code O365 credentials in Powershell script

I am using the PowerShell script mentioned here: http://www.sharepointdiary.com/2016/11/sharepoint-online-import-terms-to-termset-using-powershell.html to update the term store values and its working ...
2
votes
2answers
21 views

Disable Teams Site Creation

My mind is blown here. A regular use just created a Team from within MS Teams client application. This then created an O365 Group with inbox. It also created a new SharePoint site collection and ...
1
vote
3answers
41 views

Configure LookUp field using Sharepoint PNP Powershell

I create a column "TitleLookUp" of type LookUp, how can I access the column and configure the information via PNP PowerShell?
1
vote
2answers
25 views

How to update managed metadata term store terms by leveraging excel file in SPO

In SharePoint Online, I am trying to see if there is a way to update managed metdata term set term values from values stored in an excel file. Basically client would like to automate this process by ...
2
votes
1answer
18 views

Delete Content Organizer Rule with PowerShell

I use this script to create a content organizer rule on my SP2013 site [Microsoft.SharePoint.SPSite]$site = Get-SPSite http://www.mycompany.com [Microsoft.SharePoint.SPWeb]$web = Get-SPWeb http://www....
2
votes
0answers
37 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 ...
0
votes
1answer
25 views

“backup-spsite : You must specify a filename for the backup file” + “You need to have Machine administrator priviliges to run this cmdlet”

I use to run these commands to backup our sharepoint site collections and our farm without any problem:- backup-spsite http://****01/sites/home/ -Path E:\Back\BFH.bak Backup-SPFarm -Directory \\**...
0
votes
2answers
61 views

Move folders along with sub folders and files to another existing folder with metadata

Environment: SharePoint 2010 On-premise My scenario: One of the users has uploaded 32,000+ folders along with files into one folder in SharePoint document library. few of those newly created 32,000 ...
0
votes
1answer
22 views

Migrate Global term store to SharePoint Online

How to migrate global term store of SharePoint 2013 into SharePoint Online. Please specify powershell commands if any.
0
votes
1answer
18 views

How to Import CSV file containg global taxonomy into SharePoint Online Global term Store using powershell

I have csv file containing all the Global term set values of SharePoint 2013 taxonomy. I want to import that in SharePoint Online using powershell script. Please suggest if any powershell script is ...
0
votes
1answer
26 views

How to change the order of Sharepoint Online User Profile Custom Properties efficiently with Powershell?

So, I have managed to create a custom property for user profiles in Sharepoint Online. However, the new property shows up all the way at the bottom of the the list of properties, and the only way in ...
1
vote
2answers
27 views

Export/Import Glabal term store

We are migrating Global term store from SharePoint 2013 to SharePoint Online. Can i get the scripts to export term store from SharePoint 2013 in a text file and then import that in SharePoint Online? ...
0
votes
1answer
22 views

How do I move SharePoint Lists including metadata

on sharepoint 2013 on-prem, I would like to migrate a a few lists in the same site collection to a different subsite using powershell. I tried the following commands: Export-SPWeb "SiteURL" -ItemUrl "...
-1
votes
0answers
14 views

Odata Query on On-Premise SharePoint Project Server Returning No Data, Stale Data or Incorrect Data

Odata data sets from on-premise Project Server 2019 are not gathering the correct data into Power BI Desktop/Server. I'm trying to retrieve a list of a project's issues, but I'm not seeing any of the ...
0
votes
2answers
46 views

Get-PnPList not working correctly with subsite's subsite

I am using below code to get lists of all subsites. But it is failing after one level of sitecollections. i cant connect with each web using Connect-PnPOnline as it takes too much time. Please suggest ...
0
votes
0answers
23 views

Powershell update users from one custom permission level to Full Control

Looking for PowerShell opportunity to find all users in our site collection that are tagged as a custom permission level "Administrator" and change them to "Full Control". If they are added as a user,...
1
vote
2answers
27 views

Pause Event Handler Using Powershell

I am not sure if this is possible. I know there is a way to disable or delete an event handler using Powershell. But is there a way to pause an event handler using Powershell? I have three event ...
1
vote
1answer
21 views

Powershell “Canot index into a null aray”

I have a powershell script which works but at the same time it throws this error. Cannot index into a null array. At D:\PowerShell\Items\Update_a_Field.ps1:10 char:69 + if($list.BaseType -eq "...
0
votes
1answer
20 views

Exception calling “CreateDefaultAssociatedGroups” with 3 arguments: Access denied

Goal: Use PowerShell to create the default permissions groups (Owners, Visitors, Members) after site collection being created with PowerShell. I Logged into the Application server with a farm admin ...
0
votes
1answer
45 views

replace a SharePoint relative URL using powershell

I want to replace /sites/contoso RelativeURL with /teams/Int_Contoso using PowerShell. Is there any regular expression to achieve this as we have changed the destination URLs during migration and now ...
0
votes
1answer
57 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 ...
2
votes
0answers
16 views

I need to replace a Domain Group (Office 365 group) with another Domain Group (Office 365 group) on SharePoint Online

I have an Office 365 group added, for e.g. "ABC" which could be present at any of the below level. Permissions are broken at any level below Site Document Library Pages Page 1 Page 2 ...
1
vote
1answer
52 views

To connect to SharePoint Online Client Context using browser credentials from powershell

I am using below code to connect to SPO from powershell, but we have multi factor authentication in SharePoint. So I want to give credentials from browser instead of script. Please suggest as i ...
1
vote
2answers
33 views

Add-in/App - avoid consent dialog when adding app to a site

Is there a way to "trust" an SharePoint Add-in/App after it has been uploaded to the app catalog? Or eventually before/when it is added. The App is an SharePoint Add-in (.app file) and is hosted on ...
0
votes
2answers
20 views

powershell to disable community template for the sub site in sharepoint 2013?

I have requirement in which, if a user creates a sub-site in a sitecollection then community template feature should not be available to him or he should not be able to see it.
1
vote
0answers
20 views

catch statement does not work SharePoint Online PNP

I have written a powershell script which downloads files from sharepoint using PNP. This works fine however I am trying to do some error catching when the file does not exist add it to a csv however ...