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
1answer
4k 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
1k 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
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
1answer
919 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
1answer
3k 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
3answers
4k views

PowerShell and the client object model: “The collection has not been initialized”

I'm trying to grant a user permission to a SharePoint site using PowerShell and the client object model. The code I'm using is as follows: # Setup context $context=New-Object ...
3
votes
1answer
644 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
187 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
132 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 ...
3
votes
1answer
584 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
1k 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
238 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
2k 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
940 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
385 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
313 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
341 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

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
376 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
368 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
2answers
166 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
382 views

Problem with SP2013 solution scope: WebApplication vs GAC

I have a SP2013 solution that contains a custom WCF service, custom Timer Job and a Feature Event Reciever. Because of these the solution Assembly Deploying Target is set to GlobalAssemblyCache. The ...
3
votes
2answers
141 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
712 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
550 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
92 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
2k 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 ...
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
2answers
1k views

PowerShell - Create Search Service App Pools (All 3)

How many App Pools are created when you create the Search Service Application? How can I create all the Search Service Application App Pools using PowerShell and give them all unique names? I've ...
3
votes
2answers
185 views

Migrating changes from development site to staging site without doing a content database backup and restore

I wanted to find out the best practice to migrate changes from a development site to staging or production site. I think there should be a better way than backing up the content database on ...
3
votes
1answer
691 views

Moving list from one environment to another while preserving the GUID

I have a list template (.stp) file. I would like to restore the list and its contents in any given SharePoint environment. The conditions for restoring are listed below: Restore the list to any ...
3
votes
1answer
292 views

Forefront Run Profiles not created when creating user profile service from PowerShell

I'm trying to achieve a full User Profile setup for SharePoint 2010 using PowerShell, including the creation of the Active Directory connection. My PowerShell source code comes mainly from here. // ...
3
votes
1answer
53 views

PassPhrase is not valid in SharePoint 2013. Powershell not connecting to SharePoint farm to reset passphrase

I have removed Project server instance from my SharePoint 2013 farm. After that when I tried to run the configuration wizard, I found that the old passphrase is not valid. When I open powershell, the ...
3
votes
1answer
90 views

Powershell Command builder

I am trying make a c# application which runs sharepoint cmdlets in management shell 2010. I have tried below code: protected void ExecuteCode_Click(object sender, EventArgs e) { ...
3
votes
0answers
157 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
94 views

Identify Started Service App by Powershell

I am using the following Powershell script in hopes of identifying Started service applications by server. Spot checking the results shows something unexpected. For instance, I know Lotus Notes ...
3
votes
1answer
301 views

Import-Spweb is changing the user id if the user does not exist in the organisation anymore

We had to restore a list (which has versionsing enabled) in our PROD enviornment SP 2010 August CU 2012. We used the following command metioned below: Import-SPWeb http://example.com/projects/myList ...
3
votes
0answers
249 views

Filling a External Data field (BCS) in a list trough Powershell [duplicate]

I have a list of which one of the columns is of the "External Data" type, linked to a BCS service. We called this column "Organisation", and when I check the generated fields in powershell (with ...
2
votes
5answers
9k views

How to delete all items in aList 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 ...
2
votes
5answers
2k views

Adding new webparts to an already deployed solution

I have a webpart project built in visual studio 2010 and it has been deployed successfully to my production environment. I recently had to make some changes to the webpart and also needed to add a ...