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

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 ...
4
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
3answers
2k views

Deploying a site template and instantiate it in the same PowerShell script?

I want to create a PowerShell script that : add a farm solution that only contains a site template deploy the solution globally wait for the deploy job to finish create a site collection based on ...
4
votes
4answers
17k views

Iterating through a SharePoint List and Items with PowerShell

I am trying to iterate over a List and view properties on some items that live within that list, and down one or two levels; this is on a SharePoint 2010 server. So far I have been able to connect to ...
4
votes
3answers
5k views

Use Powershell to iterate through all UserProfile properties

The following script spits out all UserProfile properties for users on Sharepoint 2007: [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") ...
4
votes
2answers
2k views

Powershell Script to Set Quota

We are planning to apply quotas on our site collections of about 60 which are already created in our web application . i thought of achieving that using power shell but we are facing a small problem ...
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
1answer
5k 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 ...
4
votes
2answers
177 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
3answers
5k views

powershell script to add a managed metadata column

I'm looking for a powershell script that allows me add metadata column in SharePoint list. Thanks
4
votes
2answers
1k views

Is there a PowerShell cmdlet to delete a Timer Job?

Is there a PowerShell cmdlet to delete a Timer Job in SharePoint 2010?
4
votes
1answer
821 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).
4
votes
2answers
60 views

Status Script in PowerShell

As a newly SharePoint supporter, I find it difficult to get overview for my company's customers SharePoint Server; e.g. installation, setup, topology. Is there a PowerShell script which can provide ...
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" ...
4
votes
1answer
827 views

powershell not finding shared document library?

There is a document library called "shared documents" in the site I type at the prompt when running this script. The script returns the titles of several document libraries, but not "shared ...
4
votes
2answers
6k views

Error: Access Denied (Including Site Collection Admins) for all users

I have migrated to Sharepoint 2010 successfully but Search service wasn't working every time I get system error when I perform search. Today I have tried following things on server, 1] Application ...
4
votes
2answers
236 views

Uninstalling PowerShell 1.0 before installing SharePoint 2010

While going through the book "Beginning SharePoint 2010 Administration", the author was discussing how to prepare for a SharePoint 2010 server installation on a Windows 2008 R2 server. In that one of ...
4
votes
1answer
4k 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
3answers
4k 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. ...
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
1answer
268 views

Is VS 2010 needed to build a SharePoint 2010 project in Powershell?

Can you build a SharePoint Project without Visual Studio 2010/2012 being installed on the machine you are trying build it on using PowerShell? I have a PowerShell script the is working great. It ...
4
votes
4answers
804 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 ...
4
votes
2answers
8k views

How to use GetItems in Powershell to retrieve list items

I'm having issues with this powershell script below. It does work with SP 2007 but won't work with Sp 2010. My goal as you can see is to filter the list returned using the field Date - 1. But getting ...
4
votes
2answers
856 views

Get the check out file based on users Name

My environment is SharePoint 2007. I have write a Power shell script to get the file names and checked out by username and their email id. I am successfully able to get these details. Now I want to ...
4
votes
1answer
681 views

Schedule the copy of a document to a network location

I'm looking to copy a document to a network location on a scheduled basis. Anyone have a best practice on how to do that? I thought I could write a work flow, but since I want to copy to a ...
4
votes
1answer
62 views

Any way to figure out whether a site was created via Self-Service Site Creation or “regularly”?

Is there any way to figure out whether a site was created by a user, using self-service site creation or by an admin by Central Administration or PowerShell? I tried looking through the ...
4
votes
3answers
1k views

How do I fully automate Restore-SPFarm?

I have heard that it is a best practice to maintain a QA environment for SharePoint. I would like to script a nightly restore from our production SharePoint 2013 farm, which I'm successfully backing ...
4
votes
1answer
410 views

Powershell scripts: Create user profile synchronization service using sharepoint active directory

In sharepoint 2013 I have to create user profile synchronization connection using sharepoint active directory through scripts. I have created the user profile service using powershell after that is ...
4
votes
1answer
113 views

Application DLL replaced sometimes in 14 Hives feature folder

I deploy Infopath forms using powershell script. After deployment, dlls of my deployed application appears in 14 hives/feature/guidfeaturefolder After some modifications when i deploy again the same ...
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
1answer
658 views

Set default value for SharePoint Calendar description field

How can you set the default value for the 'Description' field for a SharePoint 2010 calendar list? There is nothing in the web interface for doing this, so I have tried it with PowerShell. $w = ...
4
votes
1answer
94 views

Unable to delete timer jobs

I have a few timer jobs which I cannot delete. Using Get-SPTimerJob I am able to find the jobs and the GUIDS, but when I try to delete them I receive the following error: PS C:\Windows\system32> ...
3
votes
5answers
27k views

List all Site Collections in a Farm

I want to be able to see the number, names, url of all site collections there are in a given farm. Would there be a powershell command to do that?
3
votes
5answers
15k 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?
3
votes
6answers
7k 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 ...
3
votes
4answers
978 views

What is the recommended way to query data on a Sharepoint site?

Say if I need to retrieve list items for batch processing, how would I be recommended to retrieve the data? Maybe Powershell or a SQL Server query?
3
votes
5answers
11k 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 ...
3
votes
4answers
14k 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 ...
3
votes
3answers
5k views

How can I use PowerShell to upload a list template (stp file)?

I need to script the creation of data in SharePoint, and part of this requires that I upload a slide library list template using PowerShell. Is this possible?
3
votes
1answer
604 views

PowerShell - Save output to a text file with dd-mm-yyyy added to the name of the file

The below script will run daily, task schedule, need help in saving the output to a text file e.g. something like SPContentDatabaseStatus_17-10-2013.txt and saved in a folder named Reports. Running ...
3
votes
2answers
4k views

What's wrong with Uninstall-SPSolution and AllWebApplications parameter?

When I try to uninstall WSP with following line, everything is ok: Uninstall-SPSolution project.wsp # no error - OK When I try to add switch parameter -AllWebApplications, I get error (something ...
3
votes
4answers
2k views

Remote Access to SharePoint Lists with PowerShell

I have a PowerShell script that pulls data from a database. I need to push this data to a SharePoint list on a different server. Would you have tutorial or examples that show how to do this ...
3
votes
4answers
3k views

Trying to delete a column from a sharepoint document library view - SP2010

I'm trying to delete a field (site column bound to managed metadata) in a view with the following powershell script: $spWeb = Get-SPWeb -identity http://servernamehere/docs/test/sitename $spView = ...
3
votes
2answers
5k views

Adding a WSP through the Management Shell?

I have a WSP that I am trying to install on my development SharePoint server. I used the Management Shell to do this: Add-SPSolution -LiteralPath c:\temp\mySolution.wsp and then: ...
3
votes
2answers
5k views

Set default value in a document library column via Powershell?

I'm looking for a powershell script that allows me to set the default value for a column in SharePoint. Thanks
3
votes
2answers
296 views

Powershell regular expression syntax for matching exactly 6 characters that start with two letters at end of url

I have been trying to get a regular expression right for the powershell match command. I am looping through all site collections in a web application (my sites have URLs SC followed by exactly 4 ...
3
votes
3answers
3k views

Powershell to view last login date for users?

I tried Googling this, but had no success. Is there a PowerShell script, or would it be possible to write one to show the last login date of each user into the SharePoint environment?
3
votes
1answer
6k 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 ...
3
votes
2answers
12k views

How to add Add-PSSnapin Microsoft.SharePoint.PowerShell to machine without SharePoint

How I can add Add-PSSnapin Microsoft.SharePoint.PowerShell to machine without SharePoint 2010? I try to run PowerShell script to Backup Farm on Windows Server 2008 R2 without Sharepoint but while I ...
3
votes
1answer
2k views

Possible to set the default page layout for a site using Powershell?

I have a bunch of sites in which I would like to change the default Page Layout. Is there a way to set this to a custom Page Layout using powershell? (The page layout is already on all the sites) ...