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 ...
3
votes
4answers
2k views
Trying to delete a column from a sharepoint document library view - SP2010
I'm trying to delete a field (site column bound to managed metadata) in a view with the following powershell script:
$spWeb = Get-SPWeb -identity http://servernamehere/docs/test/sitename
$spView = ...
3
votes
2answers
4k views
Adding a WSP through the Management Shell?
I have a WSP that I am trying to install on my development SharePoint server. I used the Management Shell to do this:
Add-SPSolution -LiteralPath c:\temp\mySolution.wsp
and then:
...
3
votes
2answers
1k views
Powershell Script to Set Qouta
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 ...
3
votes
1answer
1k 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)
...
3
votes
4answers
4k 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 ...
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 ...
3
votes
4answers
10k views
Iterating through a SharePoint List and Items with PowerShell
I am trying to iterate over a List and view properties on some items that live within that list, and down one or two levels; this is on a SharePoint 2010 server. So far I have been able to connect to ...
3
votes
3answers
714 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 ...
3
votes
1answer
565 views
Powershell to List GUIDs of Lists and Libraries but how to seperate
Working on a script that will dump out all of the lists and libraries in a site, I found the script on Mike Smith's Blog: ...
3
votes
1answer
1k views
How to authenticate when using powershell
I am trying to perform some tasks on user profiles and so, need to connect with different permissions using an account created for that. And, I am doing this with Powershell.
Try {
$site = ...
3
votes
2answers
706 views
Is there a PowerShell cmdlet to delete a Timer Job?
Is there a PowerShell cmdlet to delete a Timer Job in SharePoint 2010?
3
votes
2answers
1k views
Powershell Get-SPServiceInstance - The term 'Get-SPServiceInstance' is not recognized as the name of a cmdlet
On a fresh SP2010 install.
I run powershell as the admin
I have my policy set to unrestricted.
I've tried embedding this in a .ps1 file or running in the shell.. but get:
Powershell ...
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
1k views
What does LoadWithPartialName(“Microsoft.SharePoint”) in PowerShell script do?
I'm learning Powershell, I have this line at the top of example script, but it doesnt appear to be necessary. What does it do? Why would it be there?
# SharePoint DLL
...
3
votes
3answers
237 views
SharePoint related PowerShell tutorials
I am really in interesting PowerShell for SharePoint administration. Please help me with some books or sources, tutotials
3
votes
5answers
919 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 ...
3
votes
2answers
730 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 ...
3
votes
1answer
114 views
Access denied after creating site collection by using Powershell
I am using SP2013 single server dev environment. I use following scripts for creating web application and site collection. but when I browse to it, it says this site has not been shared with you. I am ...
3
votes
1answer
154 views
Enumerating Features in a WSP or Deployed Solution using PowerShell
I am creating a build script that will automatically create a Test Site, Deploy all wsp to that site and activate all the features. The problem I have is how do I enumerate the feature Names or GUID's ...
3
votes
1answer
544 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
1answer
409 views
How to remove duplicate EventReceiver entries
Lately i had a bug that time-to-time added duplicate event receiver entries in SPEventReceiverDefinitionCollection.
So how do i easily enumerate and remove these duplicate entries?
3
votes
1answer
639 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.
3
votes
2answers
3k views
Error: Access Denied (Including Site Collection Admins) for all users
I have migrated to Sharepoint 2010 successfully but Search service wasn't working every time I get system error when I perform search.
Today I have tried following things on server,
1] Application ...
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
2answers
2k views
Nulling/clearing/updating Managed Metadata TaxonomyFieldValue?
In my recent adventures populating Managed Metadata values (aka TaxonomyFieldValue), I have encountered either a bug, potential oversight, or a substantial erosion of my sanity. In short, it does not ...
3
votes
4answers
325 views
How to programmatically determine which application pool a service application is using?
Is there a way to programmatically determine which application pool a service application is using?
Further i would like to get the information about the service account the app pool is using.
3
votes
1answer
699 views
Update vti_author in SPDocumentLibrary item using PowerShell?
I want to update the property vti_author in an item in a SPDocumentLibrary, but it doesn't work. The items original vti_author is the same even after running this script, why?
$spSite = Get-SPSite ...
3
votes
1answer
259 views
How to create a content source of type “web” with the option “Only crawl within the server of each start address” via powershell
I have a requirement to create a content source of type "web" with the option "Only crawl within the server of each start address" via powershell. I am trying the below command : ...
3
votes
2answers
4k views
How to use GetItems in Powershell to retrieve list items
I'm having issues with this powershell script below.
It does work with SP 2007 but won't work with Sp 2010.
My goal as you can see is to filter the list returned using the field Date - 1.
But getting ...
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
1k 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 ...
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 ...
3
votes
1answer
882 views
Creating the secure store service master key fails
I have some powershell to create a farm including the secure store service. The code is pretty straight forward:
Update-SPSecureStoreMasterKey -ServiceApplicationProxy $id -Passphrase $passphrase
...
3
votes
1answer
690 views
How to remove the builtin “Item” Content Type from a list using powershell?
I have a custom content type and I added this content type to a list.
I now want this list to only use the custom content type and I want to remove the built-in "Item" content type.
I tried
...
3
votes
2answers
444 views
How to export a list in SharePoint 2010 and import it into 2013
Is there a good free way of exporting a list in SharePoint 2010 and importing it into 2013.
Need to keep structure, data, attachments and other data but revisions, permissions etc not necessary.
...
3
votes
1answer
46 views
Hide SPContenType in use
I'm trying to hide (or remove it from the new button drop) a SPContentType that is already in use via Powershell scripting.
Even if before:
$SPContentType.Hidden = $true
$SPContentType.Update()
I ...
3
votes
1answer
156 views
How can I update a publishing page's page layout via PowerShell?
I have a few publishing pages that need a page layout change. The layout includes a Content Editor Web Part pointed to an html file in the site assets folder. The layout changes but the Web Part ...
3
votes
4answers
526 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
2answers
541 views
Get the check out file based on users Name
My environment is SharePoint 2007.
I have write a Power shell script to get the file names and checked out by username and their email id. I am successfully able to get these details.
Now I want to ...
3
votes
1answer
474 views
Moving list from one environment to another while preserving the GUID
I have a list template (.stp) file. I would like to restore the list and its contents in any given SharePoint environment. The conditions for restoring are listed below:
Restore the list to any ...
3
votes
1answer
263 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.
// ...
3
votes
0answers
83 views
Application DLL replaced sometimes in 14 Hives feature folder
I deploy Infopath forms using powershell script. After deployment, dlls of my deployed application appears in 14 hives/feature/guidfeaturefolder After some modifications when i deploy again the same ...
3
votes
1answer
471 views
Create a site using powershell for a custom site definition
I have created a custom site definition which I can see and create a site using my custom definition with the UI. However, if I try to create a site using powershell I get an error saying WARNING: ...
3
votes
2answers
603 views
PowerShell - Create Search Service App Pools (All 3)
How many App Pools are created when you create the Search Service Application?
How can I create all the Search Service Application App Pools using PowerShell and give them all unique names?
I've ...
3
votes
2answers
156 views
Migrating changes from development site to staging site without doing a content database backup and restore
I wanted to find out the best practice to migrate changes from a development site to staging or production site. I think there should be a better way than backing up the content database on ...
2
votes
5answers
12k 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?
2
votes
5answers
1k views
Adding new webparts to an already deployed solution
I have a webpart project built in visual studio 2010 and it has been deployed successfully to my production environment. I recently had to make some changes to the webpart and also needed to add a ...
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 ...
2
votes
2answers
1k 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 ...
2
votes
4answers
515 views
How to download a sharepoint aspx page from server using powershell
I made some changes to sp aspx pages on a environment. I want to move these changes to my TFS. Usually one takes the pages using designer, save it to the desktop, and save that to TFS.
But is there ...