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

learn more… | top users | synonyms

5
votes
3answers
9k 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 ...
11
votes
4answers
7k 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 ...
5
votes
4answers
6k 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 ...
6
votes
5answers
18k 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?
2
votes
4answers
5k 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 ...
3
votes
2answers
4k 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 ...
6
votes
4answers
10k 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 ...
5
votes
3answers
6k 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 ...
16
votes
5answers
26k 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 ...
6
votes
2answers
11k 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 ...
4
votes
1answer
7k views

Adding a site column and add it to a content type from PowerShell issue

Within a PS script, I'm trying to add a site column and add this column to a custom content type. Here is my script : add-pssnapin Microsoft.SharePoint.PowerShell -EA 0 function ...
3
votes
4answers
18k 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 ...
2
votes
2answers
14k 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 ...
2
votes
1answer
3k 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 ...
1
vote
4answers
6k 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'; ...
4
votes
4answers
6k 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" ...
3
votes
6answers
8k views

Backup and Restore SharePoint 2010 SiteCollections

I am getting an error "Backup version is different" while restoring SiteCollections from one web application to another on the same SharePoint server farm. Following are the steps I was executing when ...
0
votes
1answer
52 views

How to retreive last 10 users who have logged in a site using Power shell script?

I need to retreive last 10 users who have logged in a site.(I need to chek in each site under a webapp who are the last 10 users to log in). and export it to a csv file.Require code in powershell.
0
votes
1answer
1k views

User profile Audience Using Power shell

#Add SharePoint PowerShell SnapIn if not already added if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin ...
0
votes
4answers
2k views

how to keep two sharepoint list in sync when located in 2 different servers

I two lists one is on site A which is on server A and the second one on site B on server B So i decided to use Powershell to export the list on site A and then grab the export and load it to the list ...
10
votes
4answers
22k 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 ...
12
votes
4answers
24k views

PowerShell: Script to check feature status (enabled/disabled) before activating

I am developing a script to refresh my custom features. Earlier i was just looping through the features and calling Disable-SPFeature and Enable-SPFeature on each items. The issue is when the ...
1
vote
1answer
4k 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 ...
7
votes
4answers
5k views

Automatically add pssnapin Microsoft.Sharepoint.Powershell

I am developing in Sharepoint and I like more Windows Powershell than Sharepoint Management Shell. Every time I restart the development machine, I have to run Add-PSSnapin ...
6
votes
2answers
1k views

How to reproduce Visual Studio “Deploy” action?

It seems like whenever I am developing a web part and I "Deploy" it from Visual Studio, everything gets deployed and works exactly as I would expect. When I take my WSP and try to install it to a ...
4
votes
4answers
925 views

Add a Web Part Zone to “My Newsfeed” Page via PowerShell

I've done a fair amount of looking into this idea without promising leads. Let me define my problem: I need to add a third column (as a Web Part Zone) to the "My Newsfeed" page in My Sites. The ...
3
votes
1answer
3k views

export / import spweb problem with DataConnectionLibrary feature

I'm attempting to export a subsite from staging to production using powershell and export-spweb and import-spweb. This worked just fine from staging to development. When we try to run this on ...
1
vote
2answers
631 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 ...
1
vote
2answers
965 views

how to know Exact Document Library size

How to know exact document library size. any PowerShell code required? I used http://XYZ:4444/_layouts/15/storman.aspx but it doesn't show true size. I have Just Modified Nikhil's Script which ...
1
vote
1answer
1k views

Setting the top level navigation sort order with PowerShell

I've created a few sites using this command, > New-SPWeb -url "http://server" -Template "STS#0" -Name "test99" -Description "test99" -UseParentTopNav The sites are appearing in the navigation ...
0
votes
2answers
505 views

create wiki pages in site pages library using powershell

Create Wiki Pages in site pages library using Power shell in sharepoint 2010. Please help.
0
votes
1answer
1k 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?
6
votes
1answer
5k 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 ...
5
votes
5answers
15k views

List of databases used for a sharepoint 2010 farm?

How to find the list of databases are used by a SharePoint 2010 Farm, including content databases, service application databases and configuration database.
4
votes
1answer
650 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 ...
4
votes
2answers
198 views

What are the cmdlets for SharePoint 2013 that have no GUI equivalent?

I've not found a comprehensive list on anywhere of the PowerShell cmdlets for SharePoint 2013 whose function or output cannot be achieved via the GUI (Central Admin, Site Settings, etc). I would ...
4
votes
2answers
2k views

Using PowerShell how do I change the column ordering for a SharePoint List

Been trying to search for the answer to this, what I need to do is re-order the fields of a SharePoint list and propagate that change down to 300+ sites (should have used a content type, but oh well) ...
4
votes
2answers
3k views

Removing Orphaned WebParts via PowerShell - CheckIn/CheckOut Requirement Loop

A client migrated from 2007 to 2010 doing a database detach/reattach without checking the database for orphaned objects first. I whipped up a PowerShell script to programmatically remove orphaned ...
4
votes
7answers
11k 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 ...
4
votes
3answers
7k 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 ...
4
votes
6answers
14k views

Error - Get-SPWeb in Powershell

I am running this simple command from powershell under a user context, who has db_owner and SharePoint_shell rights to the SharePoint_config database. I get the following error: PS ...
4
votes
2answers
6k 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 ...
2
votes
1answer
1k views

updating multivalues lookup column using PowerShell in SharePoint 2013

I have a multi values lookup column. I'm trying to update another column on another list from a lookup column. So let say I have values in a lookup column like so: 1;#Open 2;#Close 3;#Closed I want ...
2
votes
1answer
793 views

Hide Listtemplate from Create Dialog in PowerShell

I want to set the "Hidden" attribute for a listtemplate to hide it from the create list dialog. I need a solution where I can switch visibility of listtemplates on a per web basis. First I tried this: ...
1
vote
2answers
33 views

Delete the defualt folder in sharepoint 2013

i have used the below scripts to delete the folder in sharepoint 2013 This folder is generated by while creating my site which always creates the same folder name in the "Documents" Document ...
1
vote
1answer
1k views

PowerShell: Get all items where column equals a certain value

I have a SharePoint site which I want to search all document libraries where column1 = 'hello' and then print out the columns title, scope and column1. Then output the result to a file. I want to do ...
1
vote
1answer
620 views

SharePoint Doc Library Batch Delete

I am trying to write a batch Powershell script to delete the items from Sharepoint Document Library. I could not delete them because I have to reference owsfileRef field in batch command as per the ...
1
vote
1answer
623 views

PowerShell script that would display the security of SharePoint Site

I'm looking for a PowerShell script that would display or create a report of the security configuration of a site collection. Any help would be appreciated. It would list: Site Collection Owners ...
1
vote
6answers
6k views

PowerShell - Restore-SPSite Error

Restore-SPSite "http://dev.sharepoint2010/websites/0001" -path d:\temp\mybackup.bak -force I want to restore a SiteCollection. 2 Days ago the same command works fine. First I want to restore the ...
0
votes
1answer
70 views

Get-SPUser and a Person field

What is the correct powershell syntax for finding all list items in a given list where a Person field matches a user retrieved from Get-SPUser? I.e. $user = Get-SPUser -web *web* -Identity ...