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
vote
1answer
671 views

Values in SPSite.UsageInfo are always zero

I am trying to retrieve information about site usage via SPSite.UsageInfo programatically or via PowerShell. Here is simple PowerShell code: $site = Get-SPSite "http://intranet" $site.Usage And it ...
1
vote
1answer
4k views

powershell to delete items from a list where created date < “1/1/2011”

Is there a quick powershell script to delete items from a list where created date is less than some date? Also, would the deleted items be in the recycle bin (in the event business team wants to ...
1
vote
1answer
2k views

Import-SPWeb throws exception “A duplicate field named [guid here] was found”

From the SharePoint 2010 Powershell console, I'm importing a site collection into the same parent site collection as the source. (ie. http://parent/sites/sourcesite has been exported with Export-SPWeb ...
0
votes
1answer
94 views

is there a powershell to see all the site collection for a given conent db

Get-SpSite I am trying to find powershell syntax to list all the site collection for a given content database. Is there 1 line syntax for this? Thanks
4
votes
1answer
7k views

Adding a site column and add it to a content type from PowerShell issue

Within a PS script, I'm trying to add a site column and add this column to a custom content type. Here is my script : add-pssnapin Microsoft.SharePoint.PowerShell -EA 0 function ...
1
vote
2answers
2k views

Remove an Application Pool in SharePoint 2010 that contain a hyphen in title

As the subject says - i'm trying to remove an application pool using the SP Management Shell (using Administrator). I have a pool named SharePoint - User Profiles I try to remove this app pool by ...
1
vote
0answers
47 views

Powershell that sends email but stops after 400 [closed]

I am left with a power-shell script that read a sharepoint list (about 2500 email addresses in it) and sends email. However, ps stops after 400 emails. Could be a limitation by firewall or system IT, ...
2
votes
1answer
352 views

How to access the web-application hosted on the another Farm using SharePoint 2010 Management Shell?

I am trying to access the web-application that is hosted on the another SharePoint 2010 Farm using SharePoint 2010 Management Shell cmdlets but it is failing with the below error message $spsite = ...
0
votes
1answer
628 views

Powershell command for Excel Services?

Is there a powershell to restart the excel services? If yes, what is the syntax to restart the excel services.
0
votes
1answer
828 views

Export all subsites

I am looking for a quick way to export all sub-sites from a web application and exclude the root url, is there a quick way to accomplish this?
3
votes
3answers
5k views

How can I use PowerShell to upload a list template (stp file)?

I need to script the creation of data in SharePoint, and part of this requires that I upload a slide library list template using PowerShell. Is this possible?
0
votes
1answer
2k views

How do I create a new content source using powershell?

I am new to Shell Script. I would like to write a script to generate new content source for search. I wrote the following code to create a content source. $searchapp = ...
7
votes
4answers
5k views

Automatically add pssnapin Microsoft.Sharepoint.Powershell

I am developing in Sharepoint and I like more Windows Powershell than Sharepoint Management Shell. Every time I restart the development machine, I have to run Add-PSSnapin ...
2
votes
1answer
3k views

How do I export site security groups and memberships with PowerShell?

I'm looking for a PowerShell script (or tool) to export a site's groups and group memberships to a text file. These files would be used as backup for the current security configuration in case the ...
0
votes
2answers
182 views

Powershell (or sts command) for moving SC databases

I have 5 sc in 1 database (Database1). (Databases have been created for each sc). Now the task is to move 4 of the sc database from Database1 and put them into different database (where they belong). ...
2
votes
3answers
6k views

SharePoint 2010 - Install Site Template using Powershell script

I want to install site template in SharePoint 2010. Basically i want to know how use install-spwebtemplate wsp name : SPT_SiteTemplate.wsp Name : SPT_SiteTemplate
1
vote
2answers
351 views

Powershell calling custom code has SPWeb.CurrentUser = null (in certain cases)

I have a custom assembly which contains code to setup Variations for a SharePoint 2010 Publishing site. This code is based off a blog post from Waldek I have a PowerShell script in which I create a ...
2
votes
3answers
639 views

How to view what a user has access to with PowerShell?

A user has limited access but I don't know what for. How can I view what this user has access to? I'm on WSS 3. Does anyone know of a PowerShell script to perform this method?
1
vote
3answers
1k views

Powershell creating Page fails with “No parameterless constructor defined for this object.”

I wrote a Powershell script that creates SharePoint sites and pages based on an XML file to generate about 200 sites and more pages to build a specific structure. The basic steps it does repeatedly ...
0
votes
2answers
504 views

Want to run Sharepoint/Powershell tools on local machine - what do I need?

My local machine is not a SP server, but i want to be able to run powershell and connect to a SP 2010 server to administer it. What do I need to install locally?
3
votes
1answer
381 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 ...
0
votes
1answer
1k views

Running powershell within a SharePoint application page (C#)

I have a feature that deploys an application page to the layouts directory. I am attempting to update the content (or config?) database by executing a powershell command from c#. The following code ...
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 ...
10
votes
4answers
22k views

Powershell: cannot access the local farm

Yes, I am logged into the machine as an administrator, and my domain account id a farm admin as well. The site is running properly, and nothing seems wrong in SP Central Administration. But when I ...
6
votes
1answer
2k views

Script to find all items that do not inherit permissions

I would like a SP 2010 Powershell script which searches all folders in a library and finds the ones that do not inherit permissions from their parent. Does anyone have one handy? I'm new to the ...
0
votes
2answers
141 views

Getting started with Powershell

I am just getting started with a basic tutorial to Sharepoint and Powershell, following the following commands while in Powershell on my SP server: ...
4
votes
3answers
2k views

Deploying a site template and instantiate it in the same PowerShell script?

I want to create a PowerShell script that : add a farm solution that only contains a site template deploy the solution globally wait for the deploy job to finish create a site collection based on ...
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 ...
2
votes
3answers
1k views

Object Reference Not Set Error in SPImport.Run()

I'm trying to move my site from a server to another. I exported my site using Export-SPWeb, moved the data to destination server and ran the function below: (Taken from here.) function ...
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 ...
4
votes
1answer
708 views

Set default value for SharePoint Calendar description field

How can you set the default value for the 'Description' field for a SharePoint 2010 calendar list? There is nothing in the web interface for doing this, so I have tried it with PowerShell. $w = ...
0
votes
4answers
5k views

Different Version Problems in Restoring Sharepoint Sİte [closed]

I'm trying to move a Sharepoint site from one Sharepoint 2010 server to another. I used the Backup-SPSite cmdlet to create a backup file. It gives the error below after I try to restore with the ...
12
votes
4answers
24k views

PowerShell: Script to check feature status (enabled/disabled) before activating

I am developing a script to refresh my custom features. Earlier i was just looping through the features and calling Disable-SPFeature and Enable-SPFeature on each items. The issue is when the ...
2
votes
3answers
4k views

How to find the SiteCollection created date in Sharepoint 2010?

I want to find the sitecollection created and last content modified date in Sharepoint 2010, found a SPSite property for last content modified date however could not find any clue to find the created ...
4
votes
6answers
14k views

Error - Get-SPWeb in Powershell

I am running this simple command from powershell under a user context, who has db_owner and SharePoint_shell rights to the SharePoint_config database. I get the following error: PS ...
2
votes
1answer
2k views

Using powershell enable windows authentication on claims based authentication web application

I am creating a web application using Claims based authentication as follows: $databaseName = "WSS_Content_$port" $authMethod = "NTLM" write-host "Creating $title web application on port $port..." ...
5
votes
5answers
8k views

SharePoint 2010 - Backup Term Store as CSV

Is there any PowerShell Script to export the Term Store? I have not found any OOTB solution, only import as csv, but no export as csv. Is there a script which can export the Term Store as csv? (So ...
1
vote
3answers
327 views

Automated PowerShell scripts

If I wanted to create a PowerShell script how can I make one that include the sharepoint commandlets
0
votes
1answer
786 views

Export-SPWeb permissions

When using Export-SPWeb to export a site does it copy permissions with it? When the export is running can it still be used by others? Once the export is complete will it be usable as before?
1
vote
2answers
193 views

Is there a way to move a site across web applications regardless of site template?

I have our old 2007 intranet upgraded to 2010 via database attach. It's in its own web application and I want to move some of the sites over to our production web application. I'm using a script ...
10
votes
2answers
11k views

How do I check if a site already exists from PowerShell? [duplicate]

I have a script that exports a site and restores it in another web application. I want to check if the target site already exists. Is there an easy way to tell if www.example.org/sites/asite/ is ...
4
votes
2answers
239 views

Uninstalling PowerShell 1.0 before installing SharePoint 2010

While going through the book "Beginning SharePoint 2010 Administration", the author was discussing how to prepare for a SharePoint 2010 server installation on a Windows 2008 R2 server. In that one of ...
5
votes
1answer
2k views

Get total size of attached files on all list items in SharePoint 2007with PowerShell v2.0

Using Powershell, I have to get the total size of all attached files on all list items for a generic list. I tried using the function below but this displays the total length of names for the attached ...
6
votes
1answer
2k views

Problem installing web part using Powershell

We've developed a custom Visual Web Part using Visual Studio 2010 for Sharepoint 2010 Server. The webpart gets deployed when executed from VS (F5), so we can add it wherever we want using Sharepoint ...
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
1answer
247 views

how to find the user profile property scope which user has set on his mysite - SharePoint 2010?

How can I find the list of colleagues/Team-members for a SharePoint 2010 user? and how can i find the scope for a specific user profile property (eg..birthday--->Everyone, Interest--->My Team)which ...
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. // ...
1
vote
1answer
961 views

remote execution of New-SpSite failing

I am trying to create a site collection under a web application on a remote machine using sharepoint powershell's invoke-command as below $secpasswd = ConvertTo-SecureString "Dummy" -AsPlainText ...
6
votes
2answers
1k views

How to reproduce Visual Studio “Deploy” action?

It seems like whenever I am developing a web part and I "Deploy" it from Visual Studio, everything gets deployed and works exactly as I would expect. When I take my WSP and try to install it to a ...
1
vote
1answer
1k views

Setting the top level navigation sort order with PowerShell

I've created a few sites using this command, > New-SPWeb -url "http://server" -Template "STS#0" -Name "test99" -Description "test99" -UseParentTopNav The sites are appearing in the navigation ...