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
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
2answers
440 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
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
2k 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
869 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
651 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
4k 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
3k 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
213 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
4k views

Powershell to list specific user profiles

Is there a way to list specific user profiles instead all the users? Ex: List all the accounts starting with IT. It should list all the users with ITUser1,ITUser2, ect.... The following script ...
3
votes
1answer
688 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
417 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
1answer
251 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?
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
836 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
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
256 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
2answers
518 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
338 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
439 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
1k 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
420 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
374 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 ...
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 ...
3
votes
1answer
2k views

Creating the secure store service master key fails

I have some powershell to create a farm including the secure store service. The code is pretty straight forward: Update-SPSecureStoreMasterKey -ServiceApplicationProxy $id -Passphrase $passphrase ...
3
votes
1answer
1k views

How to remove the builtin “Item” Content Type from a list using powershell?

I have a custom content type and I added this content type to a list. I now want this list to only use the custom content type and I want to remove the built-in "Item" content type. I tried ...
3
votes
3answers
101 views

How do I create a list from a template and create all views with Powershell?

I am trying to imitate the process of creating a list from a template in the UI by using a Powershell script. When you create a list from a template with the UI, all of the original list's views are ...
3
votes
2answers
809 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
2answers
261 views

Deploying and Installing Sharepoint apps into App catalog using CSOM

Can anyone suggest me on how to use SP.AppCatalog() in JSOM or CSOM and get the all apps in AppCatalog, Not AppInstances..
3
votes
2answers
246 views

Access Denied from Migrated SP2010 -> 2013 Web App

I've migrated a web application's content database from SP2010 to SP2013. After the migration was complete, I am completely locked out of the web application. Navigating to the root site collection ...
3
votes
2answers
864 views

How to disable anonymous access for SharePoint WebApplication with powershell

I need to create a PowerShell script that will disable anonymous access to the given SharePoint web application. However, I have thus far been unsuccessful. All scripts have been run under the ...
3
votes
1answer
685 views

GetListItems Exception

I am trying to get the contents of a Sharepoint 2007 list using Powershell. I'm able to connect to the web service but receive an exception whenever I try to call the GetListItems method. # Create ...
3
votes
1answer
107 views

Hide SPContenType in use

I'm trying to hide (or remove it from the new button drop) a SPContentType that is already in use via Powershell scripting. Even if before: $SPContentType.Hidden = $true $SPContentType.Update() I ...
3
votes
1answer
3k views

creating site collections using SharePoint management shell 2013

I am creating Site Collections for Testing SharePoint. I am using Host Named Site Collection to do that instead of the path based site collection addressing. For that Got a reference to the HNSC ...