Changing Document Library Title via PowerShell

Hi there,
I´m trying to add a new Document Library in my SharePoint 2013 environment and change the title of it, due to URL reasons. 
The Code:
$web = Get-SPWeb(“http://sp/s/doc”)
$list = $web.Lists[“Admin”]
$list.OnQuickLaunch = $true
$list.EnableMinorVersions = $true
$list.Title = “Admin2”
$list.Update()
The QuickLaunch and versioning settings just work fine, but the title of the library stays "Admin".
Any Ideas?
Thank You!

Hi hank
This should be becoz of local resources.
That could be due to localization. In that case, you should also set TitleResource property:
field.TitleResource.SetValueForUICulture(new CultureInfo(1033), "My title");
http://sharepoint.stackexchange.com/questions/24163/how-to-rename-title-column-in-document-library-using-code
7down
voteaccepted
That could be due to localization. In that case, you should also set TitleResource property:
field.TitleResource.SetValueForUICulture(new CultureInfo(1033), "My title");
7down
voteaccepted
That could be due to localization. In that case, you should also set TitleResource property:
field.TitleResource.SetValueForUICulture(new CultureInfo(1033), "My title");
7down
voteaccepted
That could be due to localization. In that case, you should also set TitleResource property:
field.TitleResource.SetValueForUICulture(new CultureInfo(1033), "My title");
Please remember to click 'Mark as Answer' on the answer if it helps you

Similar Messages

  • Setting default value of document library column using powershell

    Created document library based on template which is using custom content type containing managed metadata based column.
    I can upload documents. Everything looks normal except when I visit Column default value settings page in DL settings, I get error message below
    Application error when access /_layouts/15/ColumnDefaults.aspx, Error=Value does not fall within the expected range.   at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl)    
    at Microsoft.Office.Server.WebControls.MetaDataNavTree.TreeViewDataBound(Object sender, EventArgs e)     at System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect()     at Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationContext.OnTreeViewLoad(SPTreeView
    spTreeView)     at Microsoft.Office.Server.WebControls.MetaDataNavTree.PerLocationPageLoad()     at Microsoft.Office.DocumentManagement.Pages.ColumnDefaultsPage.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()
        at System.Web.UI.Page.ProcessRe...  6bf73b9c-e4f3-10ae-0f74-9672cdd9936f
    I tried many things but nothing seems to work. When I create document library using SharePoint OOB template, everything works.
    Any help would be appreciated.
    Thanks.

    I found another way to fix this. Thanks to you pointing me to the file "{List Name}/Forms/client_LocationBasedDefaults.html"
    I found the difference between this file and the one of a list that worked:
    I had "&" in the names of some folders. The recreated subsites from a template that contained such folders in the document library had the problem descriped by the OP. In the recreated client_LocationBasedDefaults.html there were actual '&'
    in the folder names instead of '%26' escape characters. After replacing those characters with their escaped version everything worked as expected again.

  • Change document file name via workflow - SharePoint Online

    Is it possible to change the filename of document uploaded in sharepoint online/onpremises using workflow?
    We would like to have documents uploaded to sharepoint but unfortunately some have the same name and this from a folder structure :(
    When i used a workflow and use set i keep getting error.
    Thanks in Advance

    Hi,
    We can create a calculated column and use SharePoint designer workflow to achieve your requirement.
    More information is here:
    http://www.oracular.com/site/index.php/easyblog/workflows-that-rename-files-part-1
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Change Document Library Folder Name from client (JavaScript (JSOM) or Rest)

    Hi
    According to :
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/23441a0d-022a-4d97-8058-b75f32e342d2/rest-api-to-rename-the-folder-move-folder-copy-folder-prog-lang-is-java?forum=sharepointdevelopment
    Renaming a folder with Rest is not possible.
    and based on:
    http://msdn.microsoft.com/en-us/library/office/jj245697(v=office.15).aspx
    name property doesn't have any set.
    Is it means that renaming a folder is not possible by JSOM or REST?!
    Regards

    Hi,
    The following JavaScript Client Object Model code for your reference:
    <script type="text/ecmascript">
    ExecuteOrDelayUntilScriptLoaded(UpdateListItem, "sp.js");
    function UpdateListItem(){
    var clientContext;
    var oWebsite;
    var oList;
    clientContext = new SP.ClientContext.get_current();
    oWebsite = clientContext.get_web();
    oList = oWebsite.get_lists().getByTitle("DocumentLibrary");
    oListItem = oList.getItemById(1);
    this.oListItem.set_item("FileLeafRef", "Folder Name");
    this.oListItem.update();
    clientContext.load(this.oListItem);
    clientContext.executeQueryAsync(onSuccess, onFailure);
    function onSuccess() {
    alert('Update succeeded.');
    function onFailure(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    More information:
    http://msdn.microsoft.com/en-us/library/office/jj163201(v=office.15).aspx
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Item Level permissions document library

    In SharePoint 2010 you could apply item level permissions to document libraries via PowerShell with
    $web= Get-SPOSite "sitename"
    $list = $web.Lists[“Listname”]
    $list.ReadSecurity = 2
    $list.Update()
    $web.Dispose()
    Is there a way to apply this to SharePoint online 2013? it doesn't seem to work.  

    Hi SpNerd,
    For SharePoint 2013 Online, there is not a comdlet that is used to get a site. So, it seems that there is not a way to change Item-level permissions via PowerShell for SharePoint Online.
    Windows PowerShell for SharePoint Online cmdlets
    http://technet.microsoft.com/en-us/library/fp161364(v=office.15).aspx
    As a workaround, you can change Item-level permissions via SharePoint Online UI as List Settings->Advanced Settings->Item-level Permissions.
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Creating a folder for a document library in SharePoint online

    Hello I am looking for a good place to get started on creating a folder for a document library using a powershell script. Thanks in advance for any help.

    Here is a guide to creating folders and items in a document library for SharePoint Server/Foundation: Creating SharePoint Folders
    and Items with PowerShell. You will need to tailor it to your needs as it's a demo for creating 50,000 items.
    That's step 1 and contains the bulk of what you would need to do. Here's an example of connecting to a library in SharePoint Online using CSOM: Office
    365 - PowerShell Script to Upload Files to a Document Library using CSOM. You won't be uploading files, but the parts where you connect and get a list are what you're interested in.
    Now you'll combine bits from both of these scripts:
    1. Connect to SPO
    2. Get your list (looks like you need to first get the site collection and then the site)
    3. Create a folder
    I figure it would look something like this (note I haven't tested this at all):
    #Specify tenant admin and site URL
    $User = "[email protected]"
    $SiteURL = "https://tenant.sharepoint.com/sites/site"
    $DocLibName = "DocLib"$FolderTitle = "Example Folder"
    #Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
    $Password = Read-Host -Prompt "Please enter your password" -AsSecureString
    #Bind to site collection
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
    $Context.Credentials = $Creds
    #Retrieve list
    $List = $Context.Web.Lists.GetByTitle($DocLibName)
    $folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder)
    $folder["Title"] = $FolderTitle
    $folder.Update();
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • File Open Issues - document library pdf file to open in new browser window

    Hi
    I have a requirement to open the document library containing pdf file to open in new browser window. So far I have tried following steps but could not get it to work.
    1. Changing Document library advance setting to open the document in browser (have tried others as well).
    2. SharePoint web application setting changed as Permissive instead of Strict. Here the pdf file opens in browser but redirect from document library instead of new window(Also tried adding Target=”_blank” and no change).
    3. Executed the powershell script to adding MIME type to see if it works but no change.
    $webApp = Get-SPWebApplication http://SharePointSite
    If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains "application/pdf")
    Write-Host -ForegroundColor White "Adding PDF MIME Type..."
    $webApp.AllowedInlineDownloadedMimeTypes.Add("application/pdf")
    $webApp.Update()
    Write-Host -ForegroundColor White "Added and saved."
    Else
    Write-Host -ForegroundColor White "PDF MIME type is already added."
    4. Open the Doc library and modified ALLItems.aspx to add Target= “_blank”
    5. I have already tried solutions suggested in the link:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/9db08c4a-b53c-419a-84f8-001c194d1311/how-to-open-sharepoint-document-library-pdf-file-in-new-window?forum=sharepointadminlegacy
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/530e2ea1-d77d-491c-935f-04f536e439a5/open-a-pdf-document-to-a-new-browser-in-the-document-library-web-part?forum=sharepointadminlegacy
    http://mindsharpblogs.com/todd/archive/2005/08/16/654.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/7b6091df-4657-4799-ba02-259ebd7e4b7c/pdf-doesnt-open-in-document-library?forum=sharepointadminlegacy
    Appreciate if there are any working solution from any of you. Many Thanks

    I found a solution which works only in the development. No idea when I compared, Browser MIME type is enabled, STRICT browser type is configured for web application. on the document library advance setting, default to open in new browser. Both configurations
    are identical but I am able to open pdf file in new window in my developing using jquery script
    http://blog.ithinksharepoint.com/2011/02/21/open-pdf-files-from-a-document-library-in-a-new-window/ but the same does not work on production server :(
    Any help experts?
    Thanks

  • How do I change the name property of a file in a document library?

    I am trying to come up with an Event Receiver that will change the name property of an file when it is uploaded. For instance when a file is uploaded into a document Library, currently the Title is being generated (which is fine)...I want to be able to
    change the "Name" property from whatever it is, to match exactly what is in the "Title" property. Are there any sample codes/blogs out there that I can take a look at? Has anyone  had any experience doing this? It seems like something
    that should be straight forward, to change the "Name" property to match what is in the "Tilte" property.

    Hi,     
    You can try the code below which use the SPFile.MoveTo() function to change the name of the file.
    EventFiringEnabled = false;
    SPFile f = properties.ListItem.File;
    string spfileExt = new FileInfo(f.Name).Extension;
    f.MoveTo(properties.ListItem.ParentList.RootFolder.Url +
    "/" + properties.ListItem["Title"]+ "_new" + spfileExt);
    f.Update();
    EventFiringEnabled = true;
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/5cafb8e4-bb85-4147-9bda-4ab42a4d4817/sharepoint-2013-event-receiver-to-rename-files-not-working?forum=sharepointdevelopment
    A link about rename uploaded file using Event Receiver for your reference:
    http://paulgalvinsoldblog.wordpress.com/2008/01/25/quick-easy-rename-uploaded-file-using-sharepoint-object-model-via-an-event-receiver/
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to update managed metadata column for all file in document library using powershell

    Hi,
    How to update managed metadata column for all file in document library using powershell?
    Any help on it.
    Thanks & REgards
    Poomani Sankaran

    Hi TanPart,
    I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation  Document Library.But i am getting below error in powershell.
    Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
    Could you tell me which is the issues in it?
    See the code below.
    $web = Get-SPWeb http://ntmoss2010:9090/Site
    $list = $web.Lists["DocLib"]
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'";
    $query.RowLimit = 2000
    $caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
            '<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
    $query.Query = $caml
    do
        $listItems = $list.GetItems($query)
        $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
        foreach($item in $listItems)
            #Cast to SPListItem to avoid ambiguous overload error
            $spItem = [Microsoft.SharePoint.SPListItem]$item;
            Write-Host $spItem.Title       
    while ($spQuery.ListItemCollectionPosition -ne $null)
    Thanks & Regards
    Poomani Sankaran

  • Sharepoint 2013, Document Library: Sharepoint is changing data in a single line of text column to ISO8601 after modifying other columns

    Hello there,
    basically, as the title says: We have a Document Library on a Sharepoint 2013. Attached to every document are multiple columns, the type for every column is 'Single line of text'.
    One column is called 'billing date' and has suitable data in it, e.g. 01.01.2015, 26.02.2015, 29.03.2015 an so on.
    Sometimes when someone is editing an other column of the same document the data in 'billing date' changes from 01.01.2015 to 2015-01-01T00:00:00Z for that document, seemingly randomly.
    Is there any way to configure or prevent this?
    Thanks in advance and kind regards,
    Michael

    Hi,
    From your description, my understanding is that SharePoint changes the format of date in single line.
    It is very strange issue. I try to reproduce your issue in my environment, but everything is OK.
    To solve your issue, I need to collect some information, please confirm these points below:
    When will the format of date change? Does it change immediately when you edit the document or after clicking save button?
    Does the issue occur in this document library or each one in your environment?
    Do you have some special configurations for this document library?
    In addition, could you provide a screenshot as below?
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • JQuery to set Title field to Name field in Document Library

    I want to use some simple JQuery to populate the Title field of a document with the contents of the Name field. I am able to populate the Title field with basic text using:
    <script type="text/javascript">
    $(function() {
    $('input[title=Title]').attr({value: 'Test'});
    </script>
    That works fine - but how can I change it to pass the contents of the Name field into the Title field?  This code runs on the EditForm.aspx for the document library.  Thanks!

    Are you editing the webpart in visual studio and designing custom webpart?

  • Import Files to SharePoint library via Powershell

    Hi,
    I'm a newbie to programming and I appreciate anybody who can help me out.
    I need to be able to import files from a shared folder to a SharePoint document library on a scheduled basis. I prefer to do this via Powershell. 
    Here are the requirements:
    1. Shared Folder is "D:\For_Upload". There's only one folder where all files for upload will be dumped. There are no subfolders.
    2. The SharePoint Document library named "Invoice" is where the files will be uploaded. This library contains a list of folders pertaining to Invoice numbers (e.g. 5200004720, 5200004721, 5200004722, and so on.). 
    3. The documents to be uploaded will have a filename containing the Invoice number and year. The uploaded document should be dumped to a folder with its corresponding invoice number and year in the document library. If no year is specified in the filename
    then it should automatically use the current year.
    4. If the said document filename does not correspond to any invoice number in the document library folders, the document will be dumped to another shared folder labeled "D:\Not_Uploaded"
    I appreciate anybody who can assist me with this.
    Regards,
    Terri

    try these links:
    http://stackoverflow.com/questions/22411014/sharepoint-script-to-automatically-import-documents-from-a-network-share-on-a-r
    https://spfolderimport.codeplex.com/
    https://camerondwyer.wordpress.com/2014/06/04/how-to-bulk-uploadcopy-a-folder-structure-and-files-to-sharepoint/

  • Update document library item where a docx document uploaded using powershell script

    HI
    when i update an existing item of a document library using script i faced the issue.
    i uploaded two .txt files and two word docx files and a png file.
    where i update .txt file item there is no issues , but  for other items i have problem.
    PS C:\Scripts> C:\Scripts\UPdateDocLibrary.ps1
    Exception calling "Update" with "0" argument(s): "There is no file with URL 'Do
    cs/Emc.docx' in this Web."
    At C:\Scripts\UPdateDocLibrary.ps1:26 char:13
    + $item.Update <<<< ()
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
    $webURL = "http://tspmcwfe:89"
    $listName = "Docs"
    #Get the SPWeb object and save it to a variable
    $web = Get-SPWeb $webURL
    #Get the SPList object to retrieve the "Demo List"
    $list = $web.Lists[$listName]
    $items = $list.items
    #Go through all items
    foreach($item in $items)
    if($item["NO"] -eq $null)
    $item["Title"] = "My updated edited item!"
    $item.Update()
    adil

    Please check if file is checkout or locked , and if not then checkout it and then try to update -
    $url= $webURL + $item.File.Url;
    $file = $web.GetFile($url);
    if($file.CheckOutType -eq "None" -And $file.LockType -eq "None")
    $file.CheckOut();
    also please try these option, may help -
    1. Allow unsafe update at web
    $web.AllowUnsafeUpdates=$true;
    2. try systemupdate
    $item.SystemUpdate($false)
    Thanks
    Ganesh Jat [My Blog |
    LinkedIn | Twitter ]
    Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful.

  • Is it possible to get Exchange emails downloaded to SharePoint document library using Powershell and or Custom Workflow?

    I have been asked to see if it would be possible to get  exchange emails downloaded and or sent to a document library .
    I know of the sitemail box app. but we are not running Exchange 2013.
    and setting up the lists and or document library to receive emails using the built in doesn't seem to be working...( maybe not configured correctly, i would need to see what the prior admin/developer did)
    But is there a way to get the emails downloaded to a document library using a workflow and or a powershell script that is triggered via  workflow?

    Hi,
    Since workflow can only work on items in SharePoint sites, they cannot get Exchange emails, let alone download emails to SharePoint library. However, you could manually save email to local and upload it to SharePoint list/library.
    I'd suggest you toubleshooting the incoming email settings in SharePoint. Please refer to the article below and check your configuration:
    https://technet.microsoft.com/en-us/library/cc262947.aspx
    http://blogs.technet.com/b/harmeetw/archive/2012/12/29/sharepoint-2013-configure-incoming-emails-with-exchange-server-2013.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Looking for help with PowerShell script to delete folders in a Document Library

    I'd like to create a PowerShell script to delete old folders in a Document library that are over 30 days old. Has anyone created something like this?
    Orange County District Attorney

    Hello Sid:
    I am trying to do the same and Iam running the script to delete the subfolders inside a folder  but I have some errors. 
    Could you please take a look?
    _______Script________
    $web = Get-SPWeb -Identity https://myportal.mydomain.com
    $list = $web.GetList("ar_mailingactivity")
    $query =  New-Object Microsoft.SharePoint.SPQuery 
    $camlQuery = '<Where><And><Eq><FieldRef Name="ContentType" /><Value Type="Computed">Folder</Value></Eq><Leq><FieldRef Name="Created" /><Value Type="DateTime"><Today OffsetDays="-30" /></Value></Leq></And></Where>'
    $query.Query = $camlQuery
    $items = $list.GetItems($query)
    for ($intIndex = $items.Count - 1; $intIndex -gt -1; $intIndex--)
       $items.Delete($intIndex);
    ________Errors_______
    Unable to index into an object of type System.Management.Automation.PSMethod.
    At C:\Script.ps1:2 char:22
    + $list =$webGetList <<<< "ar_mailingactivity"]
    + CategoryInfo
    :InvalidOperation: (ar_mailingactivity:String) [], RuntimeException
    + FullyQualifiedErrorID
    :CannotIndex
    You cannot call a method on  a null-valued expression.
    At c:\Script.ps1:6 char:24
    + $items = $list.GetItems <<<< ($query)
    + CategoryInfo
    :InvalidOperation: (GetItems:String) [], RuntimeException
    + FullyQualifiedErrorID
    :InvokeMethodOnNull

Maybe you are looking for

  • Error while using dbms_lob.fileopen

    Hi, I am getting the below error when executing the code given below, CODE:- DECLARE l_bfile BFILE; l_data BLOB; BEGIN DBMS_LOB.createtemporary (lob_loc => l_data, CACHE => TRUE, dur => DBMS_LOB.CALL); l_bfile := BFILENAME('/home/lt/write','MIA00137.

  • Excise condition types

    Hai Gurus I hope we need to configure only 3 condition types in the sd pricing procedure for CIN implementation. ie: basic excise duty, secondary education cess and higher secondary edu cess. could you please tell me how to make all these condition t

  • Three Dates in Same Row

    Hi Experts, I need to developed a Query where three dates are coming in same row. User input: period from to date. in the above given period, user want to know which Purchase Order was made, date for PO, date for Goods Receipt with GRN No and date fo

  • Quicktime Pro Re-install

    How re-install Quicktime Pro with my key on new hard drive?

  • Library missing

    I authorized my new computer and updated Itunes now my library has disappeared.  Help!!