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
7
votes
2answers
68k views

Powershell to list all sites and subsites in SharePoint Online

I know about "Get-SPWebApplication" but it's not available in Online. How can I get a list of all sites and subsites in SPO?
14
votes
4answers
12k views

How to automate entry of external column data in BCS?

I have a document library, Resumes, that has a large number of resumes in it. There is a regular column on that library, called EmployeeID, that is already populated. I have an external content type (...
15
votes
5answers
38k views

Editing property bag values using powershell

What is property bag in SharePoint 2010? How do I retrieve values from a property bag and get/set the values using powershell?
15
votes
2answers
56k views

Powershell script to find permissions for a specific user

what am i doing wrong user.ps1 $user = "sp2010\systemsacct" $site = $gc | Get-SPSite sp2010 $site | Get-SPWeb -Limit All | Get-SPUserEffectivePermissions $user Out-GridView -Title "Web ...
11
votes
3answers
17k views

Download and delete documents using Powershell

I'm looking to build a Powershell script that does the following to all documents in a SharePoint 2010 document library: Downloads the document to a network file share Deletes the original document ...
4
votes
3answers
15k views

powershell to delete items from a list where created date < “1/1/2011”

Is there a quick powershell script to delete items from a list where created date is less than some date? Also, would the deleted items be in the recycle bin (in the event business team wants to ...
14
votes
3answers
22k views

Add group to Library permissions using powershell

I have written a script that created a document library called "Audit Logs" for every site collection in our environment. I then wanted to ensure that only Site Collection administrators and the ...
5
votes
3answers
9k views

List item with specific ID value

I want to copy a list items one by one to another list using PowerShell. Some items in source list are misssing. I don't want to create and delete empty items for missing ID values in source list. I ...
5
votes
2answers
2k views

Using Powershell to create wiki pages from an xml file

I'm trying to batch create wiki pages from an xml file, and have found a few posts that I'm trying to combine, such as this one. There's some problem with my code (Sharepoint isn't creating the pages),...
11
votes
4answers
15k views

Update-SPSolution does not Deploy Solution

I am trying to deploy or update a WSP solution to SharePoint in a script using Update-SPSolution. The problem I have is that if this is the initial install I need to use Add-SPSolution and then ...
11
votes
2answers
45k views

Powershell command to find active features for site collection

Im trying to find active futures for my site from below script but im prompt with error ( cannot call a method on a null-valued expression) Appreciate your help $activeFeatures = Get-SPFeature -...
9
votes
2answers
18k views

Move files between document libraries in the same Site Collection (#2)

Quick note: First and foremost - this is somewhat in line with a previous post of mine found here: https://stackoverflow.com/questions/11514833/move-files-between-document-libraries-in-the-same-site-...
6
votes
2answers
9k views

Moving a Discussion from a Discussion Board to another?

I have a SharePoint 2010 Discussion Board and it has many Discussions. Would like to move a discussion from the discussion board to another in the same location (under same site collection). I ...
5
votes
1answer
6k views

Powershell for downloading documents with versions

is there any PowerShell script which downloads all the documents with folder structure from document library maintaining version of each file?
5
votes
6answers
19k views

Detecting Solution Deploying Status

I am Looking for a way to detect if the a solution is deploying the following code does not seem to return "Deploying" like I see in central admin. $wspID = Get-SPSolution -Identity 'mysolution.wsp'; ...
10
votes
4answers
16k views

Sharepoint 2010 powershell add-spsolution access denied

I'm trying to do a test deployment to a client server. The site collection backup completed without error. When trying to add a spsolution I get an 'Access Denied' error. I'm adding it with the ...
10
votes
1answer
13k views

Remove a single user from all site collections in a web application using powershell

Is there a way I can choose to remove a single user from all site collections within a single web application using powershell. There are number of user profiles whose domain account has been blocked ...
3
votes
5answers
14k views

How to set columns visible only in Display Form on a Column used by a Content Type

I have a column that we will call C. This Column is associated to a Content Type (CT). If I go to the properties of the CT -> Column C I can set the column to be Facoltative or Hidden: If I put it ...
3
votes
1answer
22k views

Updating Sharepoint List items

I got a custom Sharepoint list which has the following list items Hostname - IP - OS - CPUs - RAM - Disk Server 1.1.1.1 Server 2003 3 8 Disk C: 20gb If i then ...
3
votes
2answers
12k views

best appraoch to modify a site collection url inside sharepoint 2013

I have a site collection (of type enterprise KB) under the following URL http//servername/customer/questions where the customer is a wildcard managed path. now I want to change the site collection URL ...
1
vote
3answers
32k views

Powershell get permission on SPSite/SPweb (and all list)

Do you know how to get, in powershell, all permission for a SPSite/SPWeb and all list? Thanks.
0
votes
2answers
7k views

List all Pages Libraries using PowerShell and SPSiteDataQuery?

I use foreach in my scripting to make sure I get every web in every site in a specific webapp to, in this case, list (and eventually update) all Pages libraries in the SiteCollection. I've been ...
31
votes
7answers
63k views

Suddenly getting “The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.”

This morning all the development machines at the company I work at, couldn't manage SharePoint through Powershell. We were all getting the annoying "The local farm is not accessible. Cmdlets with ...
13
votes
1answer
22k views

PowerShell - create list from list template in list template gallery

Using PowerShell on a SharePoint 2010 site, how can you create a new list from a list template found in the list template gallery?. I want to be able to add several lists at once (just in numerically ...
26
votes
7answers
68k views

Powershell: cannot access the local farm

Yes, I am logged into the machine as an administrator, and my domain account id a farm admin as well. The site is running properly, and nothing seems wrong in SP Central Administration. But when I ...
9
votes
1answer
18k views

How to update a deployed content-type?

I created a content-type and applied it inside a document library. Now, if I go to the conent-type gallery and delete one of the fields, and then go back to the library and view the available columns,...
7
votes
1answer
12k views

How to retrieve workflows in powershell?

I'm trying to write a script to check the status of workflows in a list. I have tried a couple different ways but I never get anything to return. foreach($item in $list.Items){ $item.Workflows ...
5
votes
4answers
10k views

SharePoint 2010: What is the difference between backing up a Site Collection and exporting a Site Collection?

Lectori salutem, I am reading into backup and restore operations in SharePoint 2010. I have noticed that in Central Administration > Backup and Restore > Granular Backup there is the possibility to ...
2
votes
3answers
19k views

Powershell script to transfer files from local folder to document library

I have following code which allows me to transfer automatically one file to sharepoint. Is it possible to modify it the way it will upload every file from Temp to DL ? Thank you: # Set the ...
2
votes
2answers
4k views

How to save a list in a csv file via Powershell

I have a SharePoint online list with more than 9000 items and 22 column. The list is being populated on daily basis. I am taking backup manually every morning by saving the list as excel file in the ...
10
votes
10answers
45k views

How to delete all items in a List using PowerShell

I am using following PowerShell script to delete all items of the List. It's working fine but take too long for huge lists. Is there any efficient way of clearing list items, something like truncate ...
7
votes
2answers
14k views

Powershell and checking for Site existence

I am an nube to Powershell, so I think I have a pretty basic question here.... How do I determine if a SPWeb exists? I want to perform some operations on a site based on a URL passed in as a ...
6
votes
1answer
3k views

How to import term sets to Managed Metadata Service using PowerShell and CSV file

How do I import a CSV file to metadata service using PowerShell? The CSV file has 500 rows and seven levels in it (Importing of term store).
6
votes
5answers
14k views

SPSite.allwebs returns error

First of all sorry if this is an obvious question, I searched a lot but can't find the solution. When I open an spsite in powershell like this: $spsite = Get-SPSite "https://adress" And then I ...
5
votes
1answer
12k views

Traverse through List of Documents using PowerShell

I am new to PowerShell and would like to achieve the following tasks on a SharePoint 2010 Document library: 1) Using PowerShell, how can I display the List of Documents in a simple Document Library. ...
4
votes
2answers
4k views

Office 365: Publish and deploy .app through PowerShell

Can we deploy a SharePoint hosted app in Office 365 (SharePoint online) using PowerShell? Like in SharePoint 2013 apps, we will import the .app file and then install it. Can this be done in Office ...
4
votes
1answer
8k views

how to iterate through all folders inside subfolders of root level folders

below is the code to iterate through root level folders which downloads folder starts with "a" and download sub folders from it starting with any letter. I want to download all the folder levels and ...
3
votes
3answers
18k views

How to get running workflow instances on listitems in powershell?

I have craeted a powershell script to terminate all the corrupted workflows which are older than 4 hours. But I think it is not looking only for the running workflows. It is looking for all the ...
2
votes
2answers
12k views

Get all document from all folder and subfolder from document library sharepoint powershell

I'm making a script in Powershell for get all the documents within a document library and its folders and subfolders, I'm doing something like this: $DocumentLibary = "TestDocuments" $LibLists = "...
2
votes
3answers
4k views

How do I migrate a document library (and just the documents) with PowerShell

I need to migrate the documents of an existing library to a new library. The requirements of the migration is that I maintain versions and audit data (who/when created the document and last modified ...
7
votes
4answers
7k views

SPO Retrieve HasUniqueRoleAssignements property using Powershell

I am trying to retrieve HasUniqueRoleAssignements property for multiple SharePoint Online lists using Powershell. I can do it for each one in SharePoint on-premises: $ctx.Load($list....
6
votes
4answers
18k views

Possible to checkout a file using PowerShell?

I have a powershell script that inserts webparts onto a page. The problem is that if I don't have the page checked out it will throw the following error: Exception calling "AddWebPart" with "3" ...
6
votes
4answers
57k views

How do I update an already existing wsp on farm? [duplicate]

Possible Duplicate: Update-SPSolution does not Deploy Solution I have a wsp that is already deployed on the farm. I made some code changes. I cannot use the Add-SPSolution command because I ...
6
votes
3answers
17k views

How to export a list in SharePoint 2010 and import it into 2013

Is there a good free way of exporting a list in SharePoint 2010 and importing it into 2013. Need to keep structure, data, attachments and other data but revisions, permissions etc not necessary. I'...
5
votes
2answers
19k views

SharePoint 2013 - Multiple domains in People picker

We have a farm that's setup on Domain A and it has trust to Domain B. By default we can find the users for Domain A in the People Picker, but we would like to add the users for Domain B as well in the ...
4
votes
2answers
4k views

Hide column from Edit form in SharePoint Online

I would like to hide a site column from appearing in the EditForm on SharePoint online. I have been able to achieve this on SharePoint server 2010 by running the following PowerShell. This will not ...
4
votes
1answer
575 views

upper/lower case naming convention for Document name in SPO Doc Lib

I have a situation where users have uploaded several files but without any naming convention. So some of the file names are in upper case while some are in lower case . So Now I have to build a script ...
3
votes
1answer
35k views

Retrieve all fields from a list using Powershell (CSOM)

I need to write a script which I can launch (for example) at specific time and which will make a save of all lists on the SharePoint. For now, the script is able to connect to SharePoint and retrieve ...
3
votes
1answer
5k views

Does Update-SPSolution trigger a SPFeature.Upgrade()?

I'm looking into Feature versioning and upgrading in SharePoint 2010 and I don't know exactly if the Update-SPSolution cmdlet triggers a SPFeature.Upgrade(). Are <UpgradeActions> elements ...
2
votes
2answers
12k views

Sharepoint Online All User Access/Permissions Report

Is there a powershell script for SharePoint online that can create a csv report listing permission/access details for all users of a SharePoint site? We have licenses to Offices 365 E3 which includes ...

1
2 3 4 5
7