Questions tagged [powershell]

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 local and remote Windows systems.[except from WikiPedia]

Filter by
Sorted by
Tagged with
6
votes
6answers
22k views

PowerShell and the client object model: “The collection has not been initialized”

I'm trying to grant a user permission to a SharePoint site using PowerShell and the client object model. The code I'm using is as follows: # Setup context $context=New-Object Microsoft.SharePoint....
6
votes
3answers
16k 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") [void][System.Reflection....
6
votes
1answer
16k views

Powershell to list specific user profiles

Is there a way to list specific user profiles instead all the users? Ex: List all the accounts starting with IT. It should list all the users with ITUser1,ITUser2, ect.... The following script ...
6
votes
4answers
20k 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?
6
votes
2answers
5k views

Export-SPWeb List with spaces in list name

I am trying to backup a list and am getting the error Export-SPWeb : Cannot find an SPWeb object with Id or Url . I'm guessing this is related to the space in the list name. I've tried this ...
6
votes
3answers
24k views

Activating Site Collection Level Feature with PowerShell Script

I am trying to activate a Site scoped feature using a powershell script. I have another scrip which deploys my solution and I see my feature is installed correctly in Site Collection feature gallery. ...
6
votes
5answers
15k 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 ...
6
votes
3answers
5k 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 ...
6
votes
2answers
2k 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
3answers
8k views

App Pool created with Powershell name appears as GUID in IIS

I just installed SP 2013 in a test environment. I created an app pool to be used by the service applications using the Powershell command below: New_SPServiceApplicationPool -Name "Default ...
6
votes
4answers
18k 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" ...
6
votes
2answers
2k views

why backup-spsite get a backup much larger than $site.usage.Storage

I am working on a SP2010 farm. I need to backup a site collection. By using PowerShell $site = Get-SPSite "http://sharepoint" $site.usage.Storage The size is about 38GB. However when I try to ...
6
votes
2answers
1k views

SharePoint Online ULS Log

I want to get the ULS error log from SharePoint Online site. I'm using the following SPO powershell but it doesn't get any result. I also tried to use the correlation ID parameter but it returns ...
6
votes
1answer
5k views

Powershell Delete only 1 item in Document Library

I have 300 files in my document library and I need to delete one of them, I cant use the delete out of box option and I though I can use PowerShell to force it. Can anyone have any idea about this: ...
6
votes
4answers
42k views

Upload files to SharePoint intranet site using PowerShell

I'd like to upload files from my c drive on my computer to my SharePoint intranet site with url http://kmsbs. I would like the files to go to the documents library on that site. Does anyone know ...
6
votes
2answers
10k views

Is it possible to change an existing list's URL?

Is it possible to change a list's URL from something like /site/Lists/ListName to /site/ListName in SharePoint 2010?
6
votes
1answer
25k views

How to get the site and web url from a full url?

Let's have, for example, this url: http://corp.com/sites/project1/documents/forms/allitems.aspx. Is there an efficient way to analyse this full url to extract site and web url? The web application ...
6
votes
1answer
3k views

How to import term sets to Managed Metadata Service using PowerShell and CSV file

How do I import a CSV file to metadata service using PowerShell? The CSV file has 500 rows and seven levels in it (Importing of term store).
6
votes
1answer
10k views

Need to change the owner of an existing SharePoint group using Powershell

I have succesfully been able to create a SharePoint group and assign it an owner. But now I noticed that it only works if the group has not been created. So now I need to add a way to modify the ...
6
votes
1answer
2k 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, ...
6
votes
1answer
10k views

loop splistitem in folder in powershell

I'm trying to loop all splistitem in a folder of a library. I can get my library and have folder but i'm not able to get the items inside the folder. When i display the listitem for folder, i've the ...
6
votes
3answers
17k 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. I'...
6
votes
2answers
9k 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 ...
6
votes
4answers
49k 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 ...
6
votes
2answers
7k views

Update/Delete All List-item in SharePoint online list with more than 30,000 records

I have SharePoint Online List which contains more than 30,000 records. There are two use-cases I need to work as below: I have added a new column in that list, I want to update that column based on ...
6
votes
1answer
1k views

create custom content type from schema.xml using csom and powershell

I need to create a content type from my schema file which containe all my fields this is how to create a basic content type: function Add-metaXmlFields-ToContentType($ctx, $xmlFilePath, $CT_id) { ...
6
votes
1answer
2k views

Can powershell script be run using REST API / JSOM?

Is there a way to invoke and execute a .ps1 file using REST/JSOM? I am hoping to deploy a SharePoint Hosted App that runs a powershell script on the server.
6
votes
1answer
2k views

Get ULS log records programatically

Is it possible to retrieve records from ULS log using C#/SharePoint API without having to manually parse log files? I would like to display logged messages on a custom web page, and I would like to ...
6
votes
2answers
5k 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 I ...
6
votes
1answer
220 views

Creating a list column with Powershell for a blog site using existing site columns

When I get the fields property for a blog list, it returns empty. $SiteURL = "Blog site URL here" $web = Get-SPWeb $SiteURL foreach($field in $web.Fields) { Write-Host $field } But when I go ...
6
votes
2answers
575 views

Disabling tabular view

I have a bunch of views to create for a couple libraries that are all basically the same except for some filter values. I can create them in PowerShell using ViewCreationInformation. After a bit of ...
6
votes
1answer
3k 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 ...
6
votes
1answer
2k 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 ...
6
votes
3answers
3k 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 $...
6
votes
1answer
1k views

Update Custom Forms with Powershell

I'm trying to update custom forms of SharePoint lists in a large amount of SharePoint 2010 subsites with powershell. I'm not quite sure what the correct approach is. The form itself can be found as ...
6
votes
2answers
3k views

SharePoint Online CSOM create managed properties

I'm trying to find a way to deploy search managed properties via script to my Office 365 SharePoint tenant. Previously, for on-prem SharePoint I've achieved this using PowerShell - fairly straight ...
5
votes
4answers
29k 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.
5
votes
2answers
20k views

Collection was modified; enumeration operation may not execute Delete all libraries

I need to delete all libraries from a subsite, however I got this error: Collection was modified; enumeration operation may not execute $web = Get-SPweb($webUrl) foreach($list in $web.Lists) { ...
5
votes
4answers
10k views

SharePoint 2010: What is the difference between backing up a Site Collection and exporting a Site Collection?

Lectori salutem, I am reading into backup and restore operations in SharePoint 2010. I have noticed that in Central Administration > Backup and Restore > Granular Backup there is the possibility to ...
5
votes
6answers
2k views

SharePoint related PowerShell tutorials

I am really interested in PowerShell for SharePoint Administration. Please help me with some books, sources or tutotials.
5
votes
4answers
15k 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 ...
5
votes
5answers
9k 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?
5
votes
2answers
20k views

create New site collection with new content database using powershell

How to create a new site collection in existing web application but with new content database using powershell.
5
votes
3answers
39k views

how to checkin all checked out files via powershell?

We have in our environment installed Gary LaPointe powershell cmdlets and I found this script Get-SPCheckedOutFiles which returns all checkedout files, now I need to forcely check them in, not ...
5
votes
2answers
16k views

SharePoint 2010 PowerShell Getting List Column Object From Display Name Intermittently Gets Column

I'm trying to get columns in a list from the display name, however this isn't always working. Here is where I try to get the column, and check to see if it's null. I've tried it on display names ...
5
votes
3answers
380 views

Can not access the value of a Calculated column inside my power-shell script

I am working on sharepoint 2016 on-premises farm. and i wrote the following power-shell script to update the items of a list:- >> $web = get-spweb "http://servername/offices/Departments/IT/" &...
5
votes
2answers
20k views

SharePoint 2013 - Multiple domains in People picker

We have a farm that's setup on Domain A and it has trust to Domain B. By default we can find the users for Domain A in the People Picker, but we would like to add the users for Domain B as well in the ...
5
votes
3answers
11k views

Cannot delete site collection in Central Administration

I had created a site collection. But there is a problem of web-frontend server (I did not know when I created the site), so the page is always in processing. After waiting 40 mins, I closed the page. ...
5
votes
1answer
9k views

Edit SharePoint group permission using PowerShell

I am trying to modify the permission level of SharePoint groups and users with direct permission using PowerShell, e.g. if group/user has been given full control, I need to modify it to read. I have ...
5
votes
3answers
897 views

how to deploy a SharePoint solutions without installing SharePoint?

Is it possible to develop a SharePoint solutions in local machine,Without installing SharePoint Server

1 2
3
4 5
79