Skip to main content
6 votes
Accepted

How can I run this script against multiple sites

You can use a text file to get the list of Web URLs, and loop through this list in PowerShell UPDATED POWERSHELL SNIPPET Get-Content 'FULL PATH\\FILENAME.txt' | Foreach-Object { $web = get-spweb $_ $...
Ram's user avatar
  • 723
5 votes

Remove "Title" column from list default view using power shell command

Something like the following: $web = Get-SPWeb -Identity 'http://www.spsite.com/subsite' $List = $web.Lists['MyList'] $column = $List.Fields.GetFieldByInternalName('Title') $column.Hidden = $true $...
Benny Skogberg's user avatar
  • 25.5k
4 votes

Using JavaScript to force all my site collections' logos to reference the root site collection is only working on IE

You seem to miss a # on your second line of jQuery, change as below $(document).ready(function () { $("#DeltaSiteLogo a").prop("href", "/"); $("#DeltaSiteLogo a").prop("onclick", ""); }); or ...
Robert Lindgren's user avatar
4 votes
Accepted

Get current url inside a Script Editor

I think you need to put url instead SiteUrl it will be like this : string url = SPContext.Current.Site.Url; however this code will not run try to use page variable _spPageContextInfo : string url = ...
Youssef Moumen El idrissi's user avatar
3 votes

How to Hide Dialog Tile using CSS in Script Editor webpart in SharePoint On premises

<style type="text/css"> #dialogTitleSpan { display:none; } </style>
Christoffer's user avatar
  • 9,821
3 votes
Accepted

Memory usage problem with powershell script

You will need to use a CAML query to get a subset of list items and page through the results. Make sure you set the RowLimit on the query so that you only get a limited number of items at a time. You ...
Thriggle's user avatar
  • 1,620
3 votes

Is there a way to reference jQuery inside my master page without having to modify it (same as referencing Alternate CSS URL )

You have multiple options: load JS files with JSLink assigned to a WebPart, easy to do with the SharePoint UI, but less easy to maintain (and you need a WebPart that can do JSLink on the page) set ...
Danny '365CSI' Engelman's user avatar
3 votes
Accepted

Skipping Callout menu within context menu (ECB-Menu) in a list view of document library - SP2013

In order to get the new menu structure the easiest way will be to modify the existing view or create a new view for that document library or list. To do so perform the following steps: Go to your ...
Dikesh Gandhi's user avatar
3 votes
Accepted

Change font and size of button - no designer or jquery!

Just add another attribute for your button i.e. style attribute. You can put any style you like within it. In your case you can go with following code: <input type="button" style="font-size: 24px; ...
ThinkB4Code's user avatar
  • 2,970
3 votes

How can I run this script against multiple sites

@("url.1", "url.2") | %{ $web = get-spweb $_ $web.UIVersion = 3 $web.UIVersionConfigurationEnabled = $true $web.Update() } consider using try/finally in combination with $web.Dispose() ...
Nils's user avatar
  • 2,327
3 votes
Accepted

How to set default value for user profile property (string property)?

User Profile Properties doesn't support a Default Value
Per Jakobsen's user avatar
  • 32.4k
3 votes
Accepted

Create folders and subfolders in document library using client object model using JSOM/ECMAscript

Here is the example from original post converted to JSOM API: function createFolder(list,folderUrl){ var createFolderInternal = function(parentFolder,folderUrl){ var ctx = ...
Vadim Gremyachev's user avatar
3 votes

How to hide a List View column in Modern SharePoint

Check the article: Customizing "modern" lists and libraries We can't add JavaScript or CSS code in the modern list view page. As a workaround, we can hide the column value using column formatting ...
LZ_MSFT's user avatar
  • 6,219
2 votes

SharePoint 2013, updating lots of records, by script?

Using PowerShell it would go something like this, assuming you're replacing value in same field. If you need to update other field with the new value, just update the field name inside the IF ...
Jussi Palo's user avatar
  • 8,176
2 votes

How can I display an SVG in SharePoint 2013

Here is what I found from http://wolfig-techblog.blogspot.in/2015/03/creating-interactive-svgs-in-sharepoint.html?m=1 Opening the SVG in a text editor (I use Notepad++) Copy and paste the content of ...
Amal Hashim's user avatar
  • 28.3k
2 votes

How to remove certain entries of context menu [(...)-Menu] using Script Editor Web Part (JavaScript, jQuery)

The easiest way to do it, is to add this CSS to a Script Editor: <style> li.ms-core-menu-item[text="TEXT(of the entry which should be hidden)"] { display: none !important; } </style>
SteffPoint's user avatar
2 votes
Accepted

How to remove certain entries of context menu [(...)-Menu] using Script Editor Web Part (JavaScript, jQuery)

What you could do, is to override the function in Core.js on the current page instead. If its a library the actions are added in the AddDocLibMenuItems. And the View/Edit Properties are added from the ...
Mohamed Arif's user avatar
2 votes
Accepted

What tags do I need for adding following source code?

Any C# code is need to compile first by the compiler, and as we all know the code kept in Script Editor WebPart is not compiled. The content kept in Script Editor WebPart is executed by browser hence ...
Aakash Maurya's user avatar
2 votes

What tags do I need for adding following source code?

Script Editor only supports JavaScript code, so you cannot user C# in there.
Jussi Palo's user avatar
  • 8,176
2 votes
Accepted

PowerShell : How to pull user by Email from User Profile Store in SharePoint?

Try this; Add-PSSnapin "Microsoft.SharePoint.PowerShell" $emailAddress = "EMAIL ADDRESS YOU WISH TO QUERY" $site = Get-SpSite $mySitesURL; $context = Get-SPServiceContext $site; $profileManager = New-...
George Grainger's user avatar
2 votes
Accepted

How i can change the Label for my Discussion Board App from "new discussion" to something else

Take a look at render function within sp.ui.discussion.debug.js. You'd find two strings: Strings.STS.L_SPDiscHeroLinkAltText and Strings.STS.L_SPDiscHeroLinkFormat. You can override these string ...
Aveenav's user avatar
  • 4,201
2 votes
Accepted

Unable to upload a design package by using powershell scripts?

You need to define the function first since this is not OOTB function. Try the code as below: Add-PSSnapin Microsoft.Sharepoint.Powershell function Import-SPDesignPackage { #written by Ingo ...
Gautam Sheth's user avatar
  • 30.9k
2 votes
Accepted

Help understanding powershell script

There is no definition for get-splist mentioned in the second script. to get the list items from all the lists you have to loop through all the sub sites. For your second question about "|": its is ...
kesava's user avatar
  • 2,176
2 votes

How to Hide Dialog Tile using CSS in Script Editor webpart in SharePoint On premises

I have followed the following steps: Edited the Page listing page Kept Content Editor WebPart Inserted following code <style type="text/css"> .ms-dlgTitleText { display:none!important;...
Aakash Maurya's user avatar
2 votes
Accepted

Powershell script to get user permissions

you can try to get the sid from the DisplayName (DOMAIN\LOGINNAME) $adObj = New-Object System.Security.Principal.NTAccount($WebRoleAssignment.Member.DisplayName) $sid = $adObj.Translate([System....
Tiago Duarte's user avatar
  • 5,477
2 votes
Accepted

Can the latest versions of SharePoint support code snippets?

The code snippet is represented in two web parts Content Editor Web Part. Script Editor Web Part. The code snippet is supported SharePoint Server versions 2010 - 2019. Also, if the above options ...
Mohamed El-Qassas MVP's user avatar
2 votes
Accepted

Scripts Not Working in Content Editor

You need to add type attribute to your script tag, like given below: <script type="text/javascript">console.log('In.');</script>
Salah's user avatar
  • 364
2 votes
Accepted

Unable to permanently change the font size and weight inside a sharepoint modern page (the class name keeps changinag)

You could use the column formatting to do that. In your list, select the column you want to change > column settings > format this column. then advanced mode and put the JSON below - preview and ...
Murilo Santana's user avatar
1 vote

How to get a managed metadata column value from first list item in a script editor webpart?

Since your managed metadata column is going to be multi-valued, your results, will be in the form of any array. Assuming that, the internal column name is Countries, you can use the below code: ...
Gautam Sheth's user avatar
  • 30.9k
1 vote

Using JavaScript to force all my site collections' logos to reference the root site collection is only working on IE

This might not be the best approach but why dont you try building the root site collection url $(document).ready(function () { var rootSite=window.location.protocol+"//"+window.location.host $("...
rjv91's user avatar
  • 172

Only top scored, non community-wiki answers of a minimum length are eligible