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 ...
4
votes
3answers
6k 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 ...
10
votes
3answers
3k 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 ...
4
votes
4answers
2k 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 ...
2
votes
6answers
5k views
Backup and Restore SharePoint 2010 SiteCollections
I am getting an error "Backup version is different" while restoring SiteCollections from one web application to another on the same SharePoint server farm. Following are the steps I was executing when ...
0
votes
4answers
1k views
how to keep two sharepoint list in sync when located in 2 different servers
I two lists one is on site A which is on server A and the second one on site B on server B
So i decided to use Powershell to export the list on site A and then grab the export and load it to the list ...
8
votes
2answers
7k 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 ...
7
votes
3answers
11k 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 ...
5
votes
4answers
7k 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 ...
4
votes
2answers
1k views
Removing Orphaned WebParts via PowerShell - CheckIn/CheckOut Requirement Loop
A client migrated from 2007 to 2010 doing a database detach/reattach without checking the database for orphaned objects first. I whipped up a PowerShell script to programmatically remove orphaned ...
3
votes
4answers
524 views
Add a Web Part Zone to “My Newsfeed” Page via PowerShell
I've done a fair amount of looking into this idea without promising leads.
Let me define my problem:
I need to add a third column (as a Web Part Zone) to the "My Newsfeed" page in My Sites. The ...
3
votes
3answers
2k 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 ...
3
votes
1answer
2k 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 ...
5
votes
2answers
660 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 ...
4
votes
1answer
2k views
Remove a single user from all site collections in a web application using powershell
Is there a way I can choose to remove a single user from all site collections within a single web application using powershell. There are number of user profiles whose domain account has been blocked ...
3
votes
3answers
695 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 ...
2
votes
4answers
6k 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
2answers
2k views
Moving a Discussion from a Discussion Board to another?
I have a SharePoint 2010 Discussion Board and it has many Discussions. Would like to move a discussion from the discussion board to another in the same location (under same site collection).
I ...
1
vote
2answers
271 views
Using PowerShell how do I change the column ordering for a SharePoint List
Been trying to search for the answer to this, what I need to do is re-order the fields of a SharePoint list and propagate that change down to 300+ sites (should have used a content type, but oh well)
...
1
vote
1answer
429 views
Hide Listtemplate from Create Dialog in PowerShell
I want to set the "Hidden" attribute for a listtemplate to hide it from the create list dialog. I need a solution where I can switch visibility of listtemplates on a per web basis. First I tried this:
...
1
vote
4answers
7k views
List of databases used for a sharepoint 2010 farm?
How to find the list of databases are used by a SharePoint 2010 Farm, including content databases, service application databases and configuration database.
1
vote
1answer
959 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 ...
1
vote
4answers
3k views
PowerShell - Restore-SPSite Error
Restore-SPSite "http://dev.sharepoint2010/websites/0001" -path d:\temp\mybackup.bak -force
I want to restore a SiteCollection. 2 Days ago the same command works fine.
First I want to restore the ...
0
votes
4answers
2k views
Detecting Solution Deploying Status
I am Looking for a way to detect if the a solution is deploying the following code does not seem to return "Deploying" like I see in central admin.
$wspID = Get-SPSolution -Identity 'mysolution.wsp';
...
4
votes
3answers
8k 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
894 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 ...
3
votes
1answer
541 views
I am trying to rename a site using Set-SPSite command
I have created several host-named site collections and now I have to rename a couple.
I used the command New-SPSite to create 'http://test1.domain.com' and was able to get everything going fine, but ...
3
votes
4answers
2k 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" ...
3
votes
1answer
3k 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 ...
3
votes
1answer
3k 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 ...
2
votes
2answers
2k views
Change Document Library folder's Modified timestamp to latest timestamp inside
I have a Sharepoint 2010 Document Library with a range of subfolders and some files within each of them. The problem is, right now every subfolder has the same Modified timestamp, and I want each ...
2
votes
2answers
1k views
Mounted Office 365 sharepoint workspaces lose connectivity - how to fix?
I'm trying to get my sharepoint workspaces on office 365 to mount like network drives. I can achieve this following microsoft guidelines, but after a while this fails. The user has to login again to ...
2
votes
1answer
2k 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
1answer
873 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 ...
2
votes
2answers
3k views
SPSite.allwebs returns error
First of all sorry if this is an obvious question, I searched a lot but can't find the solution.
When I open an spsite in powershell like this:
$spsite = Get-SPSite "https://adress"
And then I ...
1
vote
1answer
40 views
“User cannot be found.” error in Powershell
I am writing a PowerShell script to re-sync my users to the AD because of a problem I have described Here. From time to time I get a "Set-SPUser : user cannot be found." error but when I call the same ...
1
vote
1answer
530 views
SPLimitedWebPartManager throwing “File is not checked out” error on AddWebPart and DeleteWebPart
I'm writing a powershell function to add custom webparts (i.e. not Out Of The Box webparts such as ContentEditor) to publishing pages on a SharePoint Server 2010 site. I encountered a frustrating ...
1
vote
2answers
1k views
PowerShell to Remove Site User Permission
I am looking for some help removing a User Permission from a site using PowerShell.
1
vote
2answers
282 views
Share Point Activity feed power shell script error
#Add SharePoint PowerShell SnapIn if not already added
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin ...
1
vote
1answer
774 views
Cannot Uninstall UserSolution: non-existent or broken web
I'm having some issues which I think are caused by some poor deployments. I'm trying to remove them but I'm running into an error.
Uninstall-SPUserSolution -Identity WspImportProject1.wsp -Site ...
1
vote
1answer
2k 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 ...
1
vote
1answer
672 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 ...
1
vote
3answers
2k views
Powershell - Item Level Permission by Content Type
Here is the scenario. I only need to run this once as business team just decided their contents are confidential. User Group is "Marketing", will use OOTB "Contribute" and all of marketing items are ...
1
vote
1answer
1k views
PowerShell script for searching lists for specific links?
being both quite new to both PowerShell and SharePoint 2010 I'm wondering if there is any way to make a script for searching a lists for links that begins in a certain way? I want to find all the ...
1
vote
1answer
1k views
PowerShell Script that modify items's value in SharePoint 2007 List/Library recurrently
Is it possible to have a PowerShell script that can modify some item's values in a SharePoint 2007 List or SharePoint Document Library on the last day at 2359 Hrs every month? (If it is possible, it ...
0
votes
1answer
357 views
Powershell error while iterating through sites quicklaunch and deleting a specific node
Hi I've put this question up here : http://stackoverflow.com/questions/13130785/delete-navigation-node-with-powershell-from-sharepoint-quicklaunch-in-all-sites but no answer yet so posting here too.
...
0
votes
4answers
3k views
How do I update an already existing wsp on farm? [duplicate]
Possible Duplicate:
Update-SPSolution does not Deploy Solution
I have a wsp that is already deployed on the farm. I made some code changes. I cannot use the Add-SPSolution command because I ...
0
votes
0answers
361 views
PowerShell Remoting Sharepoint 2010 Error
I use PS Remoting 2.0 for deploy WSP projects in Sharepoint 2010 in Windows 2008 server (named DESMOSSW03). My client is Windows 7 64 bits (named MyUser).
I use this credentials ...
0
votes
1answer
139 views
Powershell Script for Deployment and Activating Features SharePoint 2010
I am writing Powershell script for adding my solution,activating solution and at last activation features on my SP2010 server. There are no issues in adding solution and deploying the solution. Issues ...
0
votes
1answer
786 views
User profile Audience Using Power shell
#Add SharePoint PowerShell SnapIn if not already added
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin ...
0
votes
1answer
2k views
Create a list with powershell
I need to create one list with powershell with the following columns
Title
Url (255 max length)
Description (255 max length)
It must be a custom list. There is no need to create site columns or ...


