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

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 ...

1
vote
1answer
15 views

Enable communication site at the root of a tenant

Iam trying to enable Communication Site on the root site level, but without any luck... Step 1 was to follow jimyHang blog, but this approach is not supported anymore, it is not posible anymore... ...
1
vote
1answer
9 views

PowerShell how to use Get-SCTenantEvent

I am trying to pull health data from a SharePoint Tenant using the Get-SCTenantEvent command. I do not have access to view this information on our organisations site, but i can see it on the Tenants ...
1
vote
0answers
15 views

Sharepoint 2013 Powershell: checked out files move ownership or download

I have a large set of files that have not been checked in. Is it possible to move the checked out status to another user (not take control myself)? Or plan b, download the checked out files through ...
1
vote
2answers
24 views

Powershell to update today's date

I am trying to use Powershell to get the item from my sharepoint list and update the Today's date field to remain current. I tried this formula and it did not work, as it gives me the error message ...
2
votes
1answer
18 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
15 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 -...
3
votes
1answer
53 views
+50

Sharepoint online powershell for changing list content type

i need help with readonly content type on list. I have sitecollection ex. "sites/SC". In that sitecollection i have 1000 subwebs ex. "sites/SC/web1". In each subweb i have one document library ex. "...
1
vote
1answer
22 views

What is the StorageQuotaAllocated means in SPO

I have a little confusion about this Storage Quota Allocated property in SharePoint Online. If i ran Get-SPOTenant, I get the StorageQuota : 1304576 & StorageQuotaAllocated : 104962048. ...
1
vote
1answer
24 views

Rename a file in a Document Library - SharePoint 2013

I am wanting to rename a file name in a document library called "RenameAFile". Currently have the following file called "UD-PD-Documentattion.xlsx" and I want add "DN" before the file name "UD-PD-...
0
votes
2answers
27 views

Document Set , setting fields in PS or C#

I am working with document sets in SharePoint Online. Is there a way with Powershell or C# I can set the values of the document set fields? Any examples? It's not clear from what I have seen on the ...
0
votes
0answers
22 views

How to delete a folder from Document library that is generated on adding an attachment to a list item in SharePoint using PowerShell

There is a document library named "RequestDocuments". When I add an attachment to a list item, that corresponding file (for example abc.txt with the item ID as 112) is getting created in the following ...
0
votes
1answer
31 views

SharePoint Online/365 invite external user CSOM PowerShell vs C#

I have a PowerShell script that sends a user an invitation email. Which works. The user I'm testing with gets an email invitation to access the SharePoint site each time I run it. I got the script ...
2
votes
2answers
29 views

Change external sharing options with PowerShell on tenant level

Is it possible to view and change the external sharing options on tenant level with PowerShell? I mean these: https://docs.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off I looked at ...
1
vote
0answers
19 views

How to create a Microsoft Team's General folder programmatically?

When I Team enable an existing Office 365 group via the New-Team cmdlet, the General folder in Shared Documents is not created automatically. I have to open Microsoft Teams and navigate to "Files" ...
0
votes
1answer
17 views

How to migrate Global term store from SharePoint 2013 to SharePoint Online?

We are migrating Global term store from SharePoint 2013 to SharePoint Online. Can i get the scripts to download the term store and then upload that in SharePoint Online? We want to upload/download ...
1
vote
1answer
23 views

How to get client assemblies within a Non SharePoint Machine?

I am running CSOM code in PowerShell to access data of SharePoint 2013 sites. I am adding below lines to load the DLLs in my machine. These lines expect these DLLs to be present in this location. Add-...
1
vote
1answer
34 views

Alternative PnP commands to SharePoint Online Commands

Are there any alternative PnP commands to SharePoint Online Commands such as: Connect-SPOService Disconnect-SPOService Set-SPOUser Set-SPOSite Get-SPOSite Add-SPOSiteCollectionAppCatalog Thank you ...
2
votes
1answer
41 views

How do I delete the attachment folder in which there are attachments using powershell?

I am able to delete the attachments but not the folder associated to that attachment. Each item of the SharePoint list has an attachment attached to it. Each item's attachment is stored in that ...
0
votes
0answers
10 views

User Migration from one Server to another

I'm attempting to migrate the User Information List from one server to another as we're migrating a site from a 2013 server to a 2016 server. Some of the data being transferred requires the users from ...
0
votes
1answer
25 views

Add user to a Group if name is partial match using PowerShell

I have a very large and complex SharePoint 2016 site with hundreds of groups. I'm writing a powershell script to add a specific user to a group if the group's name matches some text. For example, I ...
1
vote
1answer
33 views

Powershell doesn't output contenttype

I have the following script which should output the name of the content type for each list item however it is not, where am I going wrong? The output for both Id and Name is just a blank line, clearly ...
2
votes
1answer
28 views

How do I write a PowerShell script to display the count of each version of the workflow used in the SharePointlist by each item

In the SharePoint list, each item has a workflow of a particular version. How do I display all the workflows and their individual count from that SharePoint list using PowerShell.
0
votes
2answers
47 views

How to write a PowerShell code to get the count of number of items from a SharePoint list based on a condition

In this SharePoint list there is a column named College. How do I retrieve the count of items who have been to that particular college using PowerShell script from that list
1
vote
0answers
21 views

How to resume a paused workflow

I have created a SharePoint 2010 style workflow in SharePoint 2013. It is currently paused till 10 Dec 2018 and says "Paused until 2018/12/10" Is it possible to resume this workflow before that ...
1
vote
3answers
58 views

How to get Field values of a list item using CSOM Powershell?

How to get Field values of a list item using CSOM Powershell? I am using below code: foreach($field in $List.Fields) { write-host $field } I am getting the values as output: Microsoft....
1
vote
2answers
36 views

What is an alternative for New-Object Microsoft.SharePoint.SPFieldUserValue() in CSOM Powershell

I want to get the display name of created by and modified by fields for a user in a SharePoint 2013 List using CSOM in powershell. I know that can be acheived by: New-Object Microsoft.SharePoint....
1
vote
4answers
36 views

How to get lists of all subsites and sites in powershell CSOM for SharePoint 2013

i want to input one site collection and want to get all the lists of that site as well as subsites. but i am unable to iterate through all subsites. Please suggest. I am using csom in powershell for ...
2
votes
1answer
34 views

Restore-SPSite : The Web application at http://site/ could not be found

On my newly created SharePoint 2016 development server, I have one web application which currently stores our production server intranet backup. Now I want to take the backup of this dev WA site and ...
1
vote
2answers
32 views

Last Modified date for site collection

We are working on SP 2013 On Premise Environment. For archival process of old site collections, we are trying to find out site collections which have not been accessed since 1st Jan 2018 in a web ...
1
vote
2answers
37 views

How to set search scope to specific site or subsite using KQL powershell csom

I want to search for content in a specific subsite in sharepoint online. How can I set scope of search to subsite in KQL using powershell csom? I tried the following query: $queryText="createdby:$...
1
vote
2answers
37 views

Powershell script to list all files in subsite with the content type assigned to them

I have a SP 2013 environment with documents uploaded to the sub site Document centre. I need to know which files was uploaded and which content type (also if no content type was selected) was uploaded....
1
vote
2answers
37 views

Setting default associated group via PowerShell not working

In SPO we have a couple of sites that lack a default group for the "Allow members to share this site and individual files and folders". I'm trying to set a SharePoint security group named "OOTB ...
0
votes
1answer
29 views

SPO-PowerShell: Get all groups an external user is member of

I need some help regarding PowerShell and SPO. I want to have a report showing all groups an external user is a member of in a site collection. For internal users, this is simply done that way: Get-...
0
votes
0answers
21 views

How to write a code in powershell to display the workflow Name, StartDate, EndDate and Status of workflow from SharePoint 2013 list to excel

I am able to get all the list items but not able to loop through their workflows. How to write a code in powershell to display the workflow Name, StartDate, EndDate and Status of workflow from ...
1
vote
1answer
47 views

How to disable/ hide delete button for column in list in SharePoint Online?

I have a calculated field in my custom list. I want to disable or hide delete button on this field edit page. I want specific users not able delete this column in a list but still be able to edit/ ...
1
vote
1answer
54 views

how to write a code to get the SharePoint list item fields to excel with the same headings and body

I am facing the following 2 issues: With following code I get the output in excel but not in the form of a table with headings. I just get an output in one column with a colon. I want the headings as ...
0
votes
0answers
12 views

How do I get Popularity stats for a WebApp (multiple site collections)

I have 1 web app that contains many site collections. I would like a Powershell script to gather site metrics (like the top 20 sites). Something similar to this: Add-PSSnapin Microsoft.SharePoint....
1
vote
1answer
38 views

Managed metadata field: Set default value on library by powershell

I am trying to set default values (multiple) on a managed metadata field on a document library, which I manually would do like this in the GUI: Library settings > Column default value settings, and ...
0
votes
0answers
14 views

Powershell script that outputs all workflows,their title and status from sharepoint 2013 site that has workflows attached to every list item [duplicate]

The SharePoint 2013 site has a few subsites and each subsite has further subsites that have lists in it. To every list item there is a workflow attached corresponding to an activity and task. How do ...
1
vote
0answers
31 views

How do I connect to Microsoft Teams via PowerShell through a proxy?

I have issues running the Connect-MicrosoftTeams -Credential $UserCredential command. I get the following error: AADSTS50158: External security challenge not satisfied My PowerShell Profile looks ...
1
vote
1answer
30 views

How can I programmatically set the ID of a list item using powershell?

I'm trying to write a script that will unarchive a list item from a sql database archive. The data is going back to the same list that it was in originally so the fields are all matched up. I'd like ...
1
vote
0answers
28 views

Exception calling “StartWorkflowOnListItem” with “3” argument(s): “subscription”

I can't find anything on Google about this and I've been searching for a while. I'm trying to call a SharePoint 2013 List Workflow on each item within a given list. Add-PSSnapin microsoft.sharepoint....
0
votes
2answers
25 views

Folder Name not showing with powershell

I have the following powershell: $list = $ctx.Web.Lists.GetByTitle("Documents") $ctx.Load($list) $ctx.ExecuteQuery() ## View XML $qCommand = @" <View> <Query> <Where><...
0
votes
0answers
22 views

Powershell outputting type Microsoft.SharePoint.Client.ListItem instead of title

I have adapted/written the following code from a blog I found which deals with lists that are over the list view threshold. However $credential=Get-Credential -Message "Please Enter Credentials" ...
0
votes
1answer
22 views

Export a complete list of sharing created into SharePoint online

I need to export from SharePoint Online (365) a complete list of all links of sharing created in the past. I need it to verify if external users can access to some files on SharePoint. I already ...
0
votes
1answer
80 views

Get Site columns: Unauthorized operation in Powershell script

I'm a newby to both powershell scripting and Sharepoint. I am trying to write the following powershell script that will get all site columns from my Sharepoint 2010 site and put them in a csv file. ...
0
votes
1answer
27 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
2answers
32 views

Powershell script to add default content type to all libraries in a subsite

I have a powershell script (thanks to this link). My environment: SP 2013. Content type created on root, but want to use in only one subsite. It looks like given below and set content type = true (...
0
votes
0answers
15 views

SharePoint Online Management Shell - Using the -NewUrl parameter [duplicate]

Is there any source on the internet regarding the -NewUrl parameter and what its scope is? Looking to change the site url of my SharePoint Site: https://domain/sites/siteA1 to https://domain/sites/...
1
vote
0answers
20 views

Powershell html string get value

I have a decoded html tag value is a string variable like this $Body = [System.Web.HttpUtility]::HtmlDecode($field.GetAttribute("Value")) Output of the Body is like this "<div class="...