Tuesday, 4 August 2020

Run Solr as a Service on Windows

Solr 8 Prerequisites:
  1. Solr
  2. Java JDK 8+
  3. NSSM

Solr as a service
  1. Run command prompt as admin:
  2. From command prompt run
    nssm install solr8
  3. Configure service like images below:




  4. Click on Install service.
  5. Check windows services in services.msc installed and run.
  6. If service failed to start test service run from command line:
    bin/solr start
  7. Check Solr is up and running from url:


Monday, 3 August 2020

SharePoint Administration Urls

Famous urls help you administrate SharePoint site:

Site Contents
/_layouts/viewlsts.aspx
Site Settings
/_layouts/settings.aspx
Site Content and Structure Manager
/_layouts/sitemanager.aspx
Manage Site Collection Administrators
/_layouts/15/mngsiteadmin.aspx
People and Groups
/_layouts/people.aspx
Manage User Permissions
/_layouts/user.aspx
Grant Permission
/_layouts/aclinv.aspx
Check Permission
/_layouts/15/chkperm.aspx
Master Page Gallery
/_catalogs/masterpage
Web Part Gallery
/_catalogs/wp
Create a list or library
/_layouts/create.aspx
List Template Gallery
/_catalogs/lt
Manage Sites and Workspace
/_layouts/mngsubwebs.aspx
Site Collection Recycle Bin
/_layouts/AdminRecycleBin.aspx?View=stage 
stage: 1 or 2
Site Level Recycle Bin
/_layouts/RecycleBin.aspx
Site Column Gallery
/_layouts/mngfield.aspx
Site Content Types
/_layouts/mngctype.aspx
Solution Gallery
/_catalogs/solutions/
User Alerts
/_layouts/sitesubs.aspx
Web Part Page Maintenance
<Page Url>?contents=1
Manage navigation quick launch /_layouts/quiklnch.aspx
Manage Global Navigation
/_layouts/15/AreaNavigationSettings.aspx
Web analytical reports for the site /_layouts/usage.aspx
Manage the site collection/Site level features /_layouts/ManageFeatures.aspx?Scope=scopeparam
scopeparam: Site (Site), Web (Web)
Version of SharePoint server /_vti_pvt/Service.cnf
Change site master page SharePoint
/_layouts/ChangeSiteMasterPage.aspx
Audit log reports
/_layouts/15/Reporting.aspx?Category=Auditing
Storage metrics
/_layouts/15/storman.aspx
Site hierarchy
/_layouts/15/vsubwebs.aspx
Filter to the list view
<List/Library URL>?filter=1
Add App
<List/Library URL>/_layouts/15/addanapp.aspx”
App registration
/_layouts/15/appregnew.aspx
Taxonomy hidden list
/lists/taxonomyhiddenlist/allItems.aspx
Web part page edit mode
?toolpaneview=2
Save site as template
/_layouts/15/savetmpl.aspx
User information list
/_catalogs/users/detail.aspx
Master page gallery /_catalogs/masterpage/Forms/AllItems.aspx
Default page settings /_layouts/AreaWelcomePage.aspx
Page Layouts and Site Templates /_Layouts/AreaTemplateSettings.aspx
Hidden Variation Relationships List
/Relationships%20List
Hidden Variation Labels List

Variation Labels settings
_Layouts/VariationLabels.aspx
Workflow manager page /_layouts/wrkmng.aspx

SharePoint programmatically move a splistitem to another folder in the same list

My customer requests moving list items to sub folders keeping item id. Most of articles talk about moving document files instead of list items. Second problem, Moving item from GUI recreate new item with new item id.
Below code solving my problem moving item to new folder keeping the same id:

            var securePassword = new SecureString();
            foreach (char c in password)
            {
                securePassword.AppendChar(c);
            }
            using (var clientContext = new ClientContext(siteurl))
            {
                clientContext.Credentials = new SharePointOnlineCredentials(userName, securePassword); 
                Web web = clientContext.Web;
                clientContext.Load(web,a=>a.ServerRelativeUrl); 
                clientContext.ExecuteQuery();
                List list = clientContext.Web.Lists.GetByTitle(listname);
                ListItem items = list.GetItemById(itemid);
                clientContext.Load(items,item => item.Id, item => item["FileLeafRef"],item=>item["FileDirRef"],item => item["FileRef"]);
                clientContext.ExecuteQuery();
                var itemasfile = web.GetFileByServerRelativeUrl(items["FileRef"].ToString());
                //targetfolderpath sample "Lists/ListName/FolderDestination" ;
                string targetfilepath = items["FileRef"].ToString().Replace(items["FileDirRef"].ToString(), targetfolderpath);
                itemasfile.MoveTo(targetfilepath, MoveOperations.Overwrite);
                clientContext.ExecuteQuery();
            }

Change docker images and containers location with Windows 10

Docker with windows has 2 mode windows and linux (wsl) For Windows Mode: Docker Configuration File: By default, Docker stores Images and ot...