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

3
votes
4answers
3k views

How to download a sharepoint aspx page from server using powershell

I made some changes to sp aspx pages on a environment. I want to move these changes to my TFS. Usually one takes the pages using designer, save it to the desktop, and save that to TFS. But is there ...
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 ...
3
votes
3answers
8k views

How do I programatically change the content type of an existing file?

Is there some way to change the content type of a file using PowerShell? Ideally I'd like to write a function that one would point at a specific document library and it would pull down an array of ...
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
2answers
6k 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
1answer
2k 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
5k 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
4k 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
6k 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
3answers
3k views

Why are Taxonomy Term Stores always empty?

Using the following code I should be able to access the Taxonomy Term Stores: $site = new-object Microsoft.SharePoint.SPSite("http://localhost") $session = new-object ...
3
votes
2answers
473 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
4k 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
3answers
4k views

What is a user friendly way to run Powershell scripts?

I've made several powershell script for my customers. They have very little knowledge about SharePoint and Powershell. I want to let them run these scripts when they want, but don't want them to ...
3
votes
2answers
13k 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
3k 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) ...
3
votes
1answer
3k views

Get User by loginname using powershell

We have the following script that was running on sharepoint 2010 where we had clasic windows authentication. When we moved to SP 2013, the authentication was changed to Claims. The following code ...
3
votes
2answers
1k views

Powershell to delete checked-out documents with no checked-in version

I have created a script to delete all documents inside a library, including documents in folders and the folders themselves. However, it seems that the script will not remove documents that have no ...
3
votes
1answer
5k views

Powershell to List GUIDs of Lists and Libraries but how to seperate

Working on a script that will dump out all of the lists and libraries in a site, I found the script on Mike Smith's Blog: ...
3
votes
1answer
2k views

How to authenticate when using powershell

I am trying to perform some tasks on user profiles and so, need to connect with different permissions using an account created for that. And, I am doing this with Powershell. Try { $site = ...
3
votes
5answers
2k views

Access Denied Retrieving Sites (Webs) Using PowerShell

My goal is to retrieve all the alerts for a given domain user, in SP 2007, then delete these alerts. I have referenced the following script on this site. In DEV environment, when I run the script I ...
3
votes
2answers
687 views

Updating relative links and images in wiki library

I have a wiki library which contents is automatically copied onto another site. Some of the pages in the library contain images, the links to those images are relative. Example: page: ...
3
votes
2answers
5k views

Powershell Get-SPServiceInstance - The term 'Get-SPServiceInstance' is not recognized as the name of a cmdlet

On a fresh SP2010 install. I run powershell as the admin I have my policy set to unrestricted. I've tried embedding this in a .ps1 file or running in the shell.. but get: Powershell ...
3
votes
1answer
4k views

What does LoadWithPartialName(“Microsoft.SharePoint”) in PowerShell script do?

I'm learning Powershell, I have this line at the top of example script, but it doesnt appear to be necessary. What does it do? Why would it be there? # SharePoint DLL ...
3
votes
3answers
262 views

Slow CSV writing for huge document libraries in powershell

by using below PowerShell script, i get all the items list from the document library including sub folders hierarchy in a CSV file. This script works very fine for small data but for huge data like ...
3
votes
1answer
710 views

How to remove duplicate EventReceiver entries

Lately i had a bug that time-to-time added duplicate event receiver entries in SPEventReceiverDefinitionCollection. So how do i easily enumerate and remove these duplicate entries?
3
votes
2answers
1k views

How to modify a list's template?

I have a list that was created from a Custom List template. Most users have been interacting with it through a calendar view that was created. Now, some users would like to connect this list to their ...
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 ...
3
votes
3answers
3k views

Nulling/clearing/updating Managed Metadata TaxonomyFieldValue?

In my recent adventures populating Managed Metadata values (aka TaxonomyFieldValue), I have encountered either a bug, potential oversight, or a substantial erosion of my sanity. In short, it does not ...
3
votes
1answer
62 views

How to get SharePoint Online list url using Powershell?

I can retrieve a title $list.Title, but a title is not the same as url. In C# I can get list.DefaultViewUrl, which doesn't seem to be an option in Powershell. I found this solution with ...
3
votes
1answer
652 views

SharePoint feature deployment and scope via PowerShell

We use SP2013 and PowerShell to deploy wsps. When installing the wsp via PowerShell: CASE 1: Add-SPSolution -LiteralPath $path install-spsolution -Identity $solution -GACDeployment Above ...
3
votes
2answers
2k views

Is it possible to change an existing list's URL?

Is it possible to change a list's URL from something like /site/Lists/ListName to /site/ListName in SharePoint 2010?
3
votes
1answer
1k views

Access denied after creating site collection by using Powershell

I am using SP2013 single server dev environment. I use following scripts for creating web application and site collection. but when I browse to it, it says this site has not been shared with you. I am ...
3
votes
3answers
2k views

How to import term set with Use this Term Set for Site Navigation property selected using PowerShell?

$session = Get-SPTaxonomySession -Site $sitename $termStore = $session.TermStores[“Managed Metadata Application”] $group = $termstore.CreateGroup(“My New Group”) $group.Description = "My Term Group" ...
3
votes
4answers
2k views

How to programmatically determine which application pool a service application is using?

Is there a way to programmatically determine which application pool a service application is using? Further i would like to get the information about the service account the app pool is using.
3
votes
1answer
263 views

Enumerating Features in a WSP or Deployed Solution using PowerShell

I am creating a build script that will automatically create a Test Site, Deploy all wsp to that site and activate all the features. The problem I have is how do I enumerate the feature Names or GUID's ...
3
votes
2answers
3k views

Sharepoint Master Page Powershell

We have over 80 Site Collections in our Web Application is there a way through power shell that i can set the same master page for all the site collections.
3
votes
1answer
1k 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 ...
3
votes
1answer
2k views

PowerShell Script to execute a console application

Can you please let me know how to run an exe or console application through a powershell script in SharePoint 2010.
3
votes
1answer
324 views

Remove all users from all folders within a Document Library - PowerShell

How to run through all folders in a specific document library to remove inheritance and then remove all users from all folders within a specific Document Library using a Powershell script?
3
votes
1answer
384 views

Get ULS log records programatically

Is it possible to retrieve records from ULS log using C#/SharePoint API without having to manually parse log files? I would like to display logged messages on a custom web page, and I would like to ...
3
votes
2answers
566 views

SharePoint 2010 - Automatically create a new content database when a size is reached

I've been asked a question today regarding the automatic creation of a new content database when the current one reaches a certain size limit. Does anyone know if this is possible? Possibly with a ...
3
votes
1answer
4k views

Uploading a file using powershell and updating column values

I am trying to upload a file from a local drive to a sharepoint doc lib, this much I have been able to find, however, I also want to update a column relative to the file, foe example, I have a company ...
3
votes
1answer
350 views

Add Administrator to User Profile Server via Powershell

I was recently directed to an article that explains how to add a user to the permissions list for the User Profile Service using Powershell, which worked a treat. [My original question] I'm now ...
3
votes
1answer
483 views

How can I update a publishing page's page layout via PowerShell?

I have a few publishing pages that need a page layout change. The layout includes a Content Editor Web Part pointed to an html file in the site assets folder. The layout changes but the Web Part ...
3
votes
1answer
2k views

Create a site using powershell for a custom site definition

I have created a custom site definition which I can see and create a site using my custom definition with the UI. However, if I try to create a site using powershell I get an error saying WARNING: ...
3
votes
1answer
1k views

Update vti_author in SPDocumentLibrary item using PowerShell?

I want to update the property vti_author in an item in a SPDocumentLibrary, but it doesn't work. The items original vti_author is the same even after running this script, why? $spSite = Get-SPSite ...
3
votes
1answer
440 views

How to create a content source of type “web” with the option “Only crawl within the server of each start address” via powershell

I have a requirement to create a content source of type "web" with the option "Only crawl within the server of each start address" via powershell. I am trying the below command : ...
3
votes
1answer
381 views

User not showing on People page although listed when using Powershell

I'm using SharePoint 2010 (14.0.4763.1000) and have a user that is not showing on the People page (_layouts/people.aspx?MembershipGroupId=3). MembershipGroupId=3 is the Owner's Group. When using ...
3
votes
1answer
2k views

Set SPWeb title on a SharePoint site using PowerShell

I'm having problems setting the title of a root web in a site collection when creating it in an other language then English. When i run the script under using 1033, it works fine the site title is set ...