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
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
195 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
1k 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
322 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
967 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
123 views

Change displayed username for Google claims based users

I have set up a SharePoint 2013 environment and am using Azure ACS to authenticate users via Google. This is working really well, however in the top right corner where my user is logged in, it's ...
3
votes
1answer
825 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
113 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 ...
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
191 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
768 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
2answers
2k views

Restoring SPSite not working with different versions

I'm having issues with restoring my .bak files to my own sharepoint environment due to version difference. My version is currently: Sharepoint Server with Enterprise Client Access License Ms ...
3
votes
1answer
303 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
2answers
56 views

Can I suppress Import-SPWeb log created message

Using the SharePoint Administrator PowerShell command Import-SPWeb, I loop through many backup files, each generates the output: Log file generated: C:\somepath\backup.cmp.import.log With the ...
3
votes
0answers
81 views

Can I use Set-SPOUser to set an O365 security group as a secondary site collection administrator?

Is there a way to use Set-SPOUser to add a security group I created in Office 365 as a secondary site collection administrator? I have the security group's Login Name which begins with "s-1-5-21-..." ...
3
votes
1answer
155 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
111 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
2answers
145 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
0answers
237 views

Update Custom Forms with Powershell

I'm trying to update custom forms of SharePoint lists in a large amount of SharePoint 2010 subsites with powershell. I'm not quite sure what the correct approach is. The form itself can be found as ...
3
votes
1answer
389 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
4answers
5k 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 ...
2
votes
4answers
4k views

How to set columns visible only in Display Form on a Column used by a Content Type

I have a column that we will call C. This Column is associated to a Content Type (CT). If I go to the properties of the CT -> Column C I can set the column to be Facoltative or Hidden: If I put it ...
2
votes
5answers
3k 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 ...
2
votes
4answers
5k views

Delete a large number of documents from a site

Can anyone tell me the quickest way to delete a large number of documents from a site library if you are an administrator for the site? Any powershell commands?
2
votes
3answers
12k views

Install-SPSolution : This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application

I have a powershell script that deploys about 12 web parts. They have all been created in the manner through visual studio 2010 and are being deployed to sharepoint 2010. I am getting the following ...
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 ...
2
votes
2answers
3k views

Powershell to list all sites and subsites in SharePoint Online

I know about "Get-SPWebApplication" but it's not available in Online. Anyone? Thanks,
2
votes
3answers
2k views

Make timerjob runs on specific server?

I have an already developed timer job that is running on front end servers, but I want to set it to run on application servers only. Can I do this with PowerShell without modifying any code of the ...
2
votes
3answers
6k views

Programatically, how do I change the default document content type of a Document Library in SP2007?

I have 40 document library lists and I have to change the default document content type for these document libraries. In UI, this is possible by On the document library, go to Settings > Document ...
2
votes
1answer
4k views

How can I get an SPList's URL?

Say I have a list named Links. Is there a way, through .NET and Powershell, to retrieve the URL for this list? In this case, the URL I'm looking for would be "/Lists/Links".
2
votes
1answer
552 views

How to check user has visited site collection first time?

I want to know which users have visited the site first time from the added users. For ex, I have added 40 users in the sharepoint but only 10 users have logged in and 30 have never logged in the site. ...
2
votes
3answers
5k views

Retrieve All Lists With Specific Name Using Powershell

I have a powershell script that I am trying to use to add a column (Created) to a specific view in a specific list in multiple webs. The list exists in every sub web. The view exists in every list. ...
2
votes
3answers
483 views

Recreate a List in many subsites of a site collection using powershell

I have to recreate the same List in several subsites within a site collection. I saved my List as a template but it will be very time consuming to add the List manually to all of my subsites using the ...
2
votes
2answers
2k views

Powershell backup/restore or import/export to keep all document versions?

I need to move a test SharePoint 2010 site collection and database to a new server (and new database). I want to make sure that I keep user security and all document versions. Does backup/restore keep ...
2
votes
3answers
4k views

How to apply new page layout to all existing pages in a site?

I really need your help. I've created a new page layout in SharePoint Designer 2010 and I want to apply it to all existing pages in a site. Another thing to note, some subsites and pages use ...
2
votes
9answers
2k views

“Specified Cast is Not Valid” in PowerShell When Getting a Display Group for Search

When run, this code returns an error on the last line "Error Calling GetDisplayGroup with 2 arguments, Specified cast is not valid". $site=get-spsite http://xxx/sites/xxx ...
2
votes
4answers
2k views

Executing powershell script from a timer job

Is it possible to call a powershell script from a sharepoint timer job ? or are there any security issues involved in doing so? Regards, Jeevan
2
votes
2answers
2k views

Fetch list item properties using Powershell

I have document library. I want to replace some document properties using powershell. There are multiple properties associated with each document. First I'll need to check for all documents if that ...
2
votes
3answers
579 views

How can I create a new RoleDefinition in powershell

I need to create a new RoleDefinition and apply it to a group. Is that possible? How can I do that?
2
votes
1answer
706 views

Broken Lists Cannot Be Deleted

There are a few lists in a SharePoint Server 2010 development environment that are broken. Due to this situation, clicking the lists in the SharePoint Web interface throw .NET exceptions, and viewing ...
2
votes
2answers
679 views

Can You Add a WebPart to a Wiki Home Page via Powershell?

Salvete! Is it possible to add a webpart to a Wiki Home Page via Powershell? I have 100 sites for which I need to add a web-part to their home-pages. I know this is easily possible with normal ...
2
votes
2answers
1k views

PowerShell Scripts

Does anybody know if there's some way to delete items from an SPList using PowerShell scripting? If is this possible, has anybody any good tutorial? Thanks!!!
2
votes
1answer
1k views

STSADM.exe, PowerShell v2.0 and Management Shell

What is the difference between the three? STSADM.exe PowerShell v2.0 Management Shell I understand you can run powershell scripts in the management shell, but I thought I remember reading that ...
2
votes
5answers
11k views

Enable-SPFeature not working

I am using PowerShell script to deploy and activate a feature in the same script. Everything works fine and I can see my feature in the Sharepoint Root folder (14 hive). I run it using Farm Admin. ...
2
votes
1answer
1k views

How do you determine the Consumers for a given Content Type?

Is there a quick powershell script to find out all the consumers who are consuming a given content type? If yes, how do you do this with powershell?
2
votes
4answers
2k views

SharePoint 2010 - Add WebPart to a Web with PowerShell

I want to add a webpart to a great number of existing pages. Is there any PowerShell command to add a webpart to a webpart page?