MarkiMarta.com
Blog of Mark and Marta parent – IT-solution, best practices with code and applications and other useful things

SharePoint PowerShelll: difference between Groups and SiteGroups

SharePoint 2016 Logo

SPWeb object has 2 different properties for work with groups. There are Grops and SiteGroups. Inspite of the fact that they look very similar, they are different.

(more...)

Get data and stats about files in document libraries in SharePoint site from SQL Server

SharePoint 2016 Logo

Information about files in document libraries is strored in the table "AllDocs" of Site's content database. Of course, Microsoft doesn't allow to make queries to SharePoint databases directly. But I can't but agree with inserts and updates are not allowed, but select query in the worst case will make just some locks in database. So I guess that in some cases it's much better to execute select query than powershell script.

(more...)

Set option 'selected' in select form by text using jQuery

jQuery logo

The code below is my solution in creating a custom SharePoint List form. The list has a lookup column, the column is filled with Name (Fullnames) of employees. The task is to mark option with user Name as selected. Variable 'user' is equal to Name of employee.

(more...)

Add users to SharePoint group from text CSV file with PowerShell

SharePoint 2016 Logo

Once I had to add about 3 thousand users to SharePoint group. Usually when I have to add about 100 users, I use Excel function 'CONCATENATE' to add user login and ";" separator to generate a list of users. And then I manually enter them. But 3 thousand users – it's too much for manual.

(more...)

Escape curly brackets in ID in jQuery

I have a table in SharePoint list view which ID contains curly brackets '{9C48B48F-AA4E-4B34-8CE6-37E4C0EBAD8B}-{9B1EEE61-5E3C-4CA1-96CD-DB15199EDC83}'. I tried to select the table using jQuery but on the brackets I've got a Javascript error about a sequence of characters.

(more...)

Create and fill hash of arrays in Powershell

You can initialize and fill multidimension hashes (arrays) in powershell this way:

(more...)

Array in PowerShell – create and read

This is an manual how to work with arrays in PowerShell - how to create them, fill and read.

You can initialize array this way:

(more...)

C# WebClient return an error (401) Unauthorized. Easy fix

My code in C# console application used to download an image from web service and store it in SharePoint library. But some why the code always returned an error "(401) Unauthorized". The requested URL has been successfully opened in browser on the same machine.

(more...)

Click this or that element in jQuery

jQuery logo

If you want to set the same action for several elements, you can write IDs of elements separated by comma. This way:

(more...)

Set multiple CSS attributes for HTML element with jQuery

jQuery logo

You can set multiple attributes for HTML element with jQuery.

(more...)


MarkiMarta.com. Notes of web-specialist
Since 2009