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)

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) ...
1
vote
4answers
4k views

How do i get the url for the mysite host from powershell?

I need the url of the mysite in SharePoint 2010 server. In my farm i only have one MySite host (and one corresponding user profile service) configured. I need the information on one of the farm ...
1
vote
2answers
744 views

turn off alerts on an announcement list

How can I disable email alerts for an announcement list (that is, prevent users from signing up for alerts on this list)? I looked at the list settings in the UI, but did not see a way to do this. I ...
4
votes
4answers
7k views

Possible to checkout a file using PowerShell?

I have a powershell script that inserts webparts onto a page. The problem is that if I don't have the page checked out it will throw the following error: Exception calling "AddWebPart" with "3" ...
0
votes
0answers
722 views

How to set custom Web Part values through powershell?

I am using a powershell script to initialize several values of a custom webpart and then insert that webpart onto a page. I have been partially successful using the method below: ...
0
votes
1answer
1k views

How to add an instance of a custom webpart to a web page using PowerShell?

I found this article which does a very good job explaining how to add built in web parts (like the content editor webpart). Unfortunately when I tried to add my own I couldn't get it to work. I have ...
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 ...
0
votes
1answer
69 views

Searching Site Farm / Collections for instance of URL

I am looking into a way to search for a specific URL within SharePoint. I have seen the solution that searches with PowerShell script for searching lists for specific links? and ...
0
votes
1answer
670 views

Remove a Policy Resource with Powershell

I am having trouble deploying a Custom Retention Policy, and have ended up with a hanging policy resource that is keeping me from activating the retention policy. I was wondering if there was a way ...
1
vote
1answer
538 views

move my site profile information from one server to another

I used central administration site collection backup to back up a My Site, and then used PowerShell restore-spsite to restore it on another server. All of the content moved, but the profile ...
1
vote
1answer
6k views

Updating Sharepoint List items

I got a custom Sharepoint list which has the following list items Hostname - IP - OS - CPUs - RAM - Disk Server 1.1.1.1 Server 2003 3 8 Disk C: 20gb If i then ...
2
votes
1answer
658 views

Connect all SSRS Reports in SharePoint library to DataSource using Powershell

We are migrating MOSS to SP2010 and have a library with hundreds of SSRS reports that use a Shared DataSource (in SharePoint Integrated mode.) Since the ReportServer database location has also ...
1
vote
1answer
288 views

Updating Sharepoint List items

I got a custom Sharepoint list which has the following list items Hostname - IP - OS - CPUs - RAM - Disk Server 1.1.1.1 Server 2003 3 8 Disk C: 20gb If i then ...
0
votes
3answers
1k views

error when running Set-SPProfileLeader in PowerShell

I want to manually set my organization's leader in SharePoint, using the following script from TechNet. I modified the script to have the correct user profile service application proxy ID, and the ...
3
votes
1answer
3k 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.
2
votes
2answers
650 views

Office 365 SharePoint, can you script (powershell) or code provisioning of the site?

I am trying to figure out if you can use Powershell with Commandlets to provision a new site. Basically if a customer calls for our solution can I write script that sets it all up? (Creating the site ...
1
vote
3answers
2k views

How to restore Site Collection from one environment to another

I am developing my intranet portal in office and created the same environment at home even the domain name and the users I am working with. I have taken the backup of site collection through central ...
4
votes
1answer
897 views

Schedule the copy of a document to a network location

I'm looking to copy a document to a network location on a scheduled basis. Anyone have a best practice on how to do that? I thought I could write a work flow, but since I want to copy to a ...
0
votes
1answer
496 views

Change a list item's “Manage Copies” destination URL programmatically

I'm trying to write a PowerShell script that goes through every item in a document library and updates the "Manage Copies" destination URL to a new location. Is there any way to achieve this ...
4
votes
3answers
4k views

Enable versioning on all lists and libraries

Is it possible to enable versioning on all lists and libraries across all web sites of a site collection? Thanks.
1
vote
2answers
753 views

Get list of items awaiting publishing in web site

Is it possible to get a list of all items (list items, publishing pages, library items) that are checked out and not published yet? We've noticed that if we use the content deployment feature in ...
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 ...
11
votes
4answers
11k 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
597 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
1k 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 ...
2
votes
1answer
151 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 ...
1
vote
2answers
3k 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
4k 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
960 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
1k 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
1k 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
292 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
769 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
6k 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
495 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
5k 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: ...
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 ...
6
votes
1answer
1k 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 ...
9
votes
1answer
6k 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
582 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 = ...
8
votes
4answers
5k 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 ...
4
votes
5answers
37k 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
1k 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 ...
1
vote
3answers
3k 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 ...
1
vote
2answers
699 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
2k 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 ...