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
6k 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
4k 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 ...
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 ...
2
votes
4answers
4k 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 ...
6
votes
4answers
9k 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 ...
4
votes
3answers
4k 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 ...
15
votes
5answers
22k 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 ...
4
votes
5answers
16k 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?
4
votes
1answer
6k 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
15k 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
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
5k 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
5k 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
48 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 ...
12
votes
4answers
21k 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 ...
8
votes
4answers
19k 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 ...
7
votes
4answers
4k 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
986 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
837 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
195 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
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 ...
6
votes
1answer
4k 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
13k 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
2answers
7k 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
2answers
186 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
1k 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
3answers
6k 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
2answers
5k 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 ...
3
votes
5answers
12k 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 ...
2
votes
2answers
9k 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
702 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
22 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
392 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
5answers
5k 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 ...
6
votes
3answers
2k views

How can I modify a file stored in SharePoint via PowerShell?

I have some files in SP 2010 that are simply HTML, and I need to modify the contents of those files in a systematic manner. Is there a good way to do this using powershell? Imagine that I want to ...
4
votes
2answers
51 views

Trying to create a template with subsites

I'm trying to create a template that I'm going to need to replicate several times. Unfortunately there are sub-sites beneath the main site on the template that are complicating things. From what I ...
4
votes
4answers
12k views

How to activate feature using powershell script?

I need to activate specific feature to all site collection which is inside the particular web application using powershell script?
4
votes
1answer
5k views

Using PowerShell and the New-SPWeb command, how can I add a site to a site collection with the -UseParentTopNav argument?

Whats the correct format of the New-SPWeb command when using the UseParentTopNav argument? I'm trying to add a new site, I've tried passing in the following New-SPWeb -url "http://server" -Template ...
3
votes
2answers
352 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 ...
3
votes
1answer
979 views

I am trying to rename a site using Set-SPSite command

I have created several host-named site collections and now I have to rename a couple. I used the command New-SPSite to create 'http://test1.domain.com' and was able to get everything going fine, but ...
2
votes
1answer
150 views

How to turn off MDS on all site collections and sites?

We have got a web application with 400 site collections and multiple sites, is there a way to turn off the MDS feature for entire web application?
2
votes
1answer
209 views

SharePoint deployment - Deployed to: GAC (WebURL/Global) / BIN

I know that when we deploy farm solutions then they are available under Central Admin --> System Settings --> Manage farm solutions. In this list of solutions, there are 3 columns. Name, Status and ...
2
votes
1answer
742 views

Powershell: Cannot update taxonomy type column item with multiple values

I'm having a strange problem. I try to populate items' property which is of managed metadata (taxonomy) type and the update method doesn't work. This field has "allow multiple values" property ...
2
votes
1answer
2k views

Need to change the owner of an existing SharePoint group using Powershell

I have succesfully been able to create a SharePoint group and assign it an owner. But now I noticed that it only works if the group has not been created. So now I need to add a way to modify the ...