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 (1)

11
votes
5answers
15k views

Restore-SPSite to the same content database

I ran Restore-SPSite on my server from a backup. I then deleted the site collection and did it again but got the following error: Restore-SPSite : The operation that you are attempting to perform ...
1
vote
2answers
663 views

Microsoft.Office.Server.UserProfiles.UserProfileManager.GetEnumerator() what does it return?

I know it returns an array of user profiles but how do I see what fields are on the profile so that I can maniplaute it.
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 ...
0
votes
1answer
2k views

Want to invoke an SSIS package to process an uploaded file - Do I use Workflow and Powershell?

The scenario is that Excel files are uploaded to a folder in SP2010. When a new file is loaded, I would like to use a Workflow to call the SSIS package that processes that file into a Database and ...
4
votes
1answer
1k 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 documents"....
2
votes
1answer
154 views

automatically create metadata properties in the search application

I want to create a number of metadata properties in the search application in sharepoint 2010. I don't want to do this myself. I know it is possible to create a powershell script to create the ...
2
votes
2answers
5k views

use powershell to check whether or not a sharepoint list is a document library

I want to make some changes to all of the document libraries in a site collection, but not make changes to any other lists. In PowerShell, how can I check whether a list is a document library, or a ...
0
votes
2answers
5k views

Restore site collection using powershell : Getting not found error

Restore-SPSite -Identity http:/snk145:60000/ -Path "D:/MS.bak" I am trying to restore a site collection (SharePoint 2010) to other from a backup file, The term 'Restore-SPSite' is not recognized as ...
6
votes
1answer
1k views

Obtain Default Content Access Account via PowerShell

As part of farm configuration audit, I need to obtain the current content access account. While I've found several resources for setting the default content access account for search using PowerShell, ...
0
votes
4answers
2k views

Stopping Powershell script execution on error in SharePoint 2010

I have SharePoint Powershell Script in .ps1 format and it includes 4 commands. When I run this script, it does not stop if any error occurs in middle. For example, if error occurs at 2nd command it ...
1
vote
3answers
2k views

Automated Sharepoint Task Creation with Powershell

This is a cross-post from stackoverflow, upon the suggestion of a user there. My organization is experimenting with new processes to coordinate developers as they integrate their code into our main ...
0
votes
1answer
308 views

Edit SharePoint 2007 Profile PersonalSite by code?

Does anyone know how to programmatically change the Personal Site field in their SharePoint Profile programmatically? I can do it via the GUI on the SSP server, but that takes an unacceptable amount ...
0
votes
2answers
797 views

Feature Upgrade Retract Deploy Power Shell Commands

I have heard that one way that you can upgrade a feature in SharePoint with new files is to do a retract deploy. I believe this is what Visual Studio 2010 does when you do a Deploy. What are the Power ...
2
votes
4answers
9k 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?
1
vote
1answer
621 views

OleDbDataAdapter Powershell Connecting to Sharepoint List

I have a situation where I can retrieve results using this query Select * From myList (myList being Sharepoint list) but cannot get results from this select First From myList Where First=JoeBob ...
2
votes
2answers
6k views

How to read items in a BCS external list with PowerShell?

Is there a way that you get information from an external list (created from SPD for a specific ECT) differently than you do from a "normal" SharePoint list when using PowerShell? I did the following: ...
5
votes
2answers
2k 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 ...
7
votes
1answer
2k views

Adding a list item with PowerShell doesn't trigger event receiver

I have a simple list with an event receiver for the following events: ItemAdded ItemUpdating ItemDeleting I confirmed that the event receiver fires when adding/updating/deleting an item from 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 ...
10
votes
1answer
9k views

All Authenticated Users claim

I'm adding items to my list by powershell script. I need to fine-grain user permissions to added items. Code I'm using now: $claim = New-SPClaimsPrincipal -ClaimValue $role -ClaimType $ROLE_CLAIM -...
0
votes
1answer
641 views

Empty exception using powershell to add a masterpage

When i try to add a masterpage to a web application using the following code : $MasterPage = "C:\test.master" $MasterPageName = [System.IO.Path]::GetFileName($masterpage); $SpWebApp = Get-...
8
votes
4answers
6k views

Problem with HTTP Handler deployed on Sharepoint 2010

I've developed a Visual Web Part for Sharepoint 2010. I've used VS2010 to do that and tested the Webpart in a testing server using VS to do the deployment. But to deploy it on the production server I ...
10
votes
5answers
54k 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?
0
votes
1answer
2k views

PowerShell Attempted to perform an unauthorised operation

I'm trying to add a term store administrator using PowerShell. I'm logged on to one of the farm web servers with a farm administrator account (also happens to be a domain admin account too). I'm ...
2
votes
3answers
4k views

SharePoint 2010 - Enable farm scope feature via powershell

I have deployed a solution with farm scope feature. I am able to activate / deactivate feature via "Manage Farm feature". I want to do this via power shell : When i try to activate feature "Enable-...
1
vote
2answers
778 views

SharePoint 2010 - Find WebPart in WebApplication

I´m searching for an good way to find the ContentQuery WebPart in my WebApplication. My plan is to write a PowerShell script and create a url list. I found the following possible ways: SharePoint ...
4
votes
2answers
4k views

Is there a PowerShell cmdlet to delete a Timer Job?

Is there a PowerShell cmdlet to delete a Timer Job in SharePoint 2010?
1
vote
3answers
1k views

Error while import resource file Business Data Connectivity

I am trying to use powershell for importing a resource file in Business Data Catalog but I keep getting the following error Import-SPBusinessDataCatalogModel : The root element of a valid Metadata ...
7
votes
2answers
7k views

Powershell error when trying to hook into UserProfileConfigManager

I am making the following call new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext) And get the following error: New-Object : Exception calling ".ctor" with ...
1
vote
1answer
513 views

Create new user profile property from powershell

I have been trying to create a new user profile property using powershell, without any luck. I have been reading up about User Profile service cmdlets but I keep getting an error saying the cmdlet is ...
3
votes
1answer
4k 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
5answers
15k 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

Powershell script for adding imported user profiles to SP group?

I've managed to import user profiles from our AD. Now I want to add all the imported user profiles into a specific SharePoint group, let's say Visitors, and doing this by using the People Picker takes ...
6
votes
4answers
18k views

How to fix credential issue?

I tried both default credential and user/pass but keep getting 401 unauthorized error. What's the fix? Here is the error I am getting .... New-WebServiceProxy : The request failed with HTTP status ...
0
votes
1answer
2k views

Turn on anonymous access in SharePoint2010 web application using PowerShell

I try to use the Set-SPWebApplication to turn on anonymous access in SharePoint2010 web application using PowerShell, however it give me the following error (see the screenshot here): Add SharePoint ...
3
votes
2answers
911 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: http://www....
1
vote
1answer
2k views

When would you flush the cache of a SharePoint web application?

I stumbled upon this PowerShell script (source) to flush the cache of all SharePoint web applications. Write-Host -ForegroundColor White " - Enabling SP PowerShell cmdlets..." If ((Get-PsSnapin |?{$...
3
votes
2answers
3k views

Enable feature of SharePoint sandbox solution

I have a .wsp file that is deployed to the remote server by powershell script. The solution is deployed successfully and I can see the solution feature in the site collection features, I can activate ...
3
votes
0answers
250 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
3answers
5k 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 ...
9
votes
5answers
30k 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?
0
votes
1answer
325 views

ITem SharePoint-80 Not Found

I just installed SP2010. There's the default web app named SharePoint-80. I am trying to backup this web app using Power Shell. Here's my command: Backup-SPFarm -Directory C:\Backups -BackupMethod ...
3
votes
4answers
7k views

Restore-SPSite : Access Denied

Restore-SPSite : Access Denied You do not have permission to perform this action or access this resource. This is the error I get when trying to restore a Site Collection backup from the integrated ...
1
vote
2answers
841 views

null valued error in powershell scripting

Im trying to create a userprofile section but when i run the code Im gettiong the following error you cannot cal a method on a null valued expression.please help me out thanks in advance. [System....
0
votes
1answer
7k views

Add users to SP Group

I am using following PS script to add users from a text file. Some of the users in the text file are inactive or gone (basically can't be resolved). The error message from the catch block is executed ...
2
votes
1answer
2k views

Problem retracting a Sharepoint 2010 Foundation solution

I am retracting a globally deployed solution via Central Administration. Here is the info Name: familycareprl.wsp Type: Core Solution Contains Web Application Resource: No Contains Global ...
2
votes
1answer
4k views

Powershell - Update column with managed-metadata

I have used following PS script to update a manage metadata column. Not sure how to go by updating a managed-metadata column. I know I need to only populate with "10;#Wholesale Agreement" in ...
0
votes
2answers
5k views

Enable-SPFeature Fails

I am trying to activate a feature using PowerShell Enable-SPFeature but receive the following error: Enable-SPFeature : The Feature is not a Farm Level Feature and is not found in a Site level ...
1
vote
3answers
2k views

Powershell Deployment - Enable-SPFeature Error

I get the following problem activating a feature in powershell: Enable-SPFeature : The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: ...
0
votes
2answers
1k views

Powershell - Error while exporting Term store

I'm trying to export the terms from the term store using PowerShell but I am receiving following error: This is the directory where you need to export the term set as a .csv file. Please ensure that ...