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

12
votes
3answers
18k views

Suddenly getting “The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.”

This morning all the development machines at the company I work at, couldn't manage SharePoint through Powershell. We were all getting the annoying "The local farm is not accessible. Cmdlets with ...
11
votes
4answers
5k views

How to automate entry of external column data in BCS?

I have a document library, Resumes, that has a large number of resumes in it. There is a regular column on that library, called EmployeeID, that is already populated. I have an external content type ...
9
votes
3answers
17k 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 ...
8
votes
4answers
6k views

How to log off user from SharePoint site, if the user has been inactive for 20 minutes

How to log off the SharePoint site, if the user is has been inactive for for 20 minutes? Do I need to redirect user to logout page? How would I count the idle time?
8
votes
2answers
8k 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 ...
8
votes
2answers
2k views

SPWeb being closed when getting list by powershell. What's wrong?

When I run this little piece of powershell code: $w = Get-SPWeb http://localhost $l = $w.List["some list"] I get Unexpected error message to my Sharepoint ULS log Detected use of SPRequest for ...
8
votes
3answers
7k 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 ...
8
votes
4answers
4k 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 ...
7
votes
4answers
4k 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 ...
6
votes
4answers
15k 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
2answers
893 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 ...
6
votes
2answers
242 views

Programatically determine who created a site collection

Is there a way, preferrably with Powershell, to determine who created a site collection? I'm not interested in who the site collection admins are, but who the actual creator of the site collection ...
6
votes
1answer
4k 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 ...
6
votes
4answers
3k views

How can I schedule the User Profile Service to run a full sync weekly?

We are running SharePoint Server 2010 and have not yet applied SP1. User profile incremental sync is not picking up all of the group membership from AD. Starting a full sync seems to rectify the ...
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 ...
6
votes
2answers
103 views

Script to automatically import documents from a network share on a regular schedule

I am new to SharePoint development. I am trying automate the task of: Uploading documents from a network share to a SharePoint document library. The related metadata for each of the files also need ...
6
votes
1answer
132 views

SharePoint 2013 Variations Using Powershell

I am using powershell to manage the creation of some site variations following this tutorial: http://www.sharepointeurope.com/blog/2013/7/23/automate-variations-in-sharepoint-2013-using-powershell-c ...
6
votes
2answers
165 views

What is a good way to build/install/provision a full web application?

I have a fairly simple SharePoint web application, with a publishing front end, an extranet for customers and an intranet portal. I want this web app to be easily redeployable -- pretty much a ...
5
votes
3answers
481 views

How to create a site collection

I need to create a site collection so that url looks like http://hr.mycompany.com instead of http://portal.mycompany.com/hr. How do I do that?
5
votes
2answers
2k 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 ...
5
votes
6answers
203 views

Restore sitecollection from backup is not working

I have a problem while restoring a backup file on another server. Servers build versions are the same. I'm executing the Restore powershell command. And it is giving me the following error: ...
5
votes
2answers
3k views

Powershell: Update People Picker Field with domain\Username

I'm trying to get this to work in powershell: $spListItem[$ppField] = "domain\username" $spListItem.Update() This gives me the following error: Exception calling "Update" with "0" argument(s): ...
5
votes
4answers
8k views

Sharepoint 2010 powershell add-spsolution access denied

I'm trying to do a test deployment to a client server. The site collection backup completed without error. When trying to add a spsolution I get an 'Access Denied' error. I'm adding it with the ...
5
votes
3answers
6k 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 ...
5
votes
2answers
3k views

Move files between document libraries in the same Site Collection (#2)

Quick note: First and foremost - this is somewhat in line with a previous post of mine found here: Move files between document libraries in the same Site Collection however I've opened a new question ...
5
votes
1answer
618 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, ...
5
votes
3answers
455 views

Powershell, why did the development team decide to only support async executions?

I've been getting into power shell recently. I am beyond impressed with it, and I think its perhaps the most exciting SharePoint tool yet. It is extremely versatile and it really does live up to its ...
5
votes
2answers
1k views

I dont have permissions to use SharePoint PowerShell, what to do?

I am a developer and would like to deploy a wsp to a server (win2k8r2) from my customer. I log in with some user created special for me. When I start SharePoint PowerShell I got this error: The local ...
5
votes
2answers
490 views

SharePoint 2010 Documentor

Is there already existing a tool , I think "documentor" can be his name for Sharepoint 2010 that can output a form of documentation with a description of all db, web application , sites, sub sites , ...
5
votes
1answer
1k 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 ...
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 ...
5
votes
2answers
1k views

Automate SharePoint Site build with NAnt

As part of a new SharePoint 2010 project I am trying to automate the build of the SharePoint site on our staging system using NAnt, something we use a lot with our C# builds. I have created a ...
5
votes
1answer
6k views

PowerShell - create list from list template in list template gallery

Using PowerShell on a SharePoint 2010 site, how can you create a new list from a list template found in the list template gallery?. I want to be able to add several lists at once (just in numerically ...
5
votes
1answer
513 views

What update I have to install in Foundation 2010 to run a backup that asks for version 4.1.13.0?

I'm trying to run a backup from a Sharepoint Server 2010 that runs a version 14.0.6101.5008: The version of my local Sharepoint Foundation 2010 server is 14.0.6114.5000: When I run the backup ...
5
votes
1answer
889 views

Extracting Comments from Version History in Powershell

So I am trying to extract version history from a document library in Powershell. I have found the commands/scripts to do this. However I cannot seem to get the comments. From my script I can get ...
5
votes
1answer
980 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 ...
4
votes
4answers
4k views

Update-SPSolution does not Deploy Solution

I am trying to deploy or update a WSP solution to SharePoint in a script using Update-SPSolution. The problem I have is that if this is the initial install I need to use Add-SPSolution and then ...
4
votes
5answers
1k views

I cant delete or restore a site collection or repair database

When I try to do a restore of a site collection, restore-spsite -Identity https://xx/10014628/ -Path D:\SiteCollectionBackups\10014628.bak -Force -Confirm I get: restore-spsite : ...
4
votes
6answers
452 views

SharePoint related PowerShell tutorials

I am really interested in PowerShell for SharePoint Administration. Please help me with some books, sources or tutotials.
4
votes
4answers
11k views

How to activate feature using powershell script?

I need to activate specific feature to all site collection which is inside the particular web application using powershell script?
4
votes
3answers
8k views

Download and delete documents using Powershell

I'm looking to build a Powershell script that does the following to all documents in a SharePoint 2010 document library: Downloads the document to a network file share Deletes the original document ...
4
votes
2answers
5k views

Powershell and checking for Site existence

I am an nube to Powershell, so I think I have a pretty basic question here.... How do I determine if a SPWeb exists? I want to perform some operations on a site based on a URL passed in as a ...
4
votes
3answers
3k views

Add group to Library permissions using powershell

I have written a script that created a document library called "Audit Logs" for every site collection in our environment. I then wanted to ensure that only Site Collection administrators and the ...
4
votes
5answers
6k 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 ...
4
votes
2answers
2k views

Powershell script to find permissions for a specific user

what am i doing wrong user.ps1 $user = "sp2010\systemsacct" $site = $gc | Get-SPSite sp2010 $site | Get-SPWeb -Limit All | Get-SPUserEffectivePermissions $user Out-GridView -Title "Web ...
4
votes
3answers
1k views

How can I modify a file stored in SharePoint via PowerShell?

I have some files in SP 2010 that are simply HTML, and I need to modify the contents of those files in a systematic manner. Is there a good way to do this using powershell? Imagine that I want to ...
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 ...
4
votes
1answer
5k views

Using PowerShell and the New-SPWeb command, how can I add a site to a site collection with the -UseParentTopNav argument?

Whats the correct format of the New-SPWeb command when using the UseParentTopNav argument? I'm trying to add a new site, I've tried passing in the following New-SPWeb -url "http://server" -Template ...
4
votes
3answers
4k views

Use Powershell to iterate through all UserProfile properties

The following script spits out all UserProfile properties for users on Sharepoint 2007: [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") ...
4
votes
2answers
2k views

Powershell Script to Set Quota

We are planning to apply quotas on our site collections of about 60 which are already created in our web application . i thought of achieving that using power shell but we are facing a small problem ...