Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • akhileshgandhi 6:13 pm on February 10, 2015 Permalink | Reply  

    Sharepoint ADFS configuration with both internal and external users 

    Below section only covers how to add Claims rule. everything else you can find on ther sites

    1

    2

    3 4 5

    6 7 8

    9

    8

    Advertisements
     
  • akhileshgandhi 5:54 pm on January 26, 2015 Permalink | Reply  

    Merge Sharepoint logs 

    Merge-SPLogfile -path “C:\MergedULS.log” -starttime “1/26/2015 9:40” -endtime “1/26/2015 9:50”

     
  • akhileshgandhi 2:33 pm on January 23, 2015 Permalink | Reply  

    Parature USD Tutorial 

    This is a very good Parature USD integration tutorial

     
  • akhileshgandhi 12:11 pm on January 15, 2015 Permalink | Reply
    Tags: javascript, parature, ticket   

    Create Parature ticket using javascript 

    I did not find any blog which gave detailed how you can create a parature ticket using javascript.

    <script type=”text/javascript”>

    function createCustomer()
    {
    var url = “https://demo.parature.com/api/useryourpath/Ticket”;
    var xmlhttp;
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
    }
    xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById(“myDiv”).innerHTML=xmlhttp.responseText;
    }
    }
    var str = “<Ticket>” +
    “<Ticket_Customer><Customer id=’10002′></Customer></Ticket_Customer>” +
    “</Ticket>”;
    xmlhttp.open(“POST”,url ,true);
    xmlhttp.setRequestHeader(“Content-type”,”application/x-www-form-urlencoded”);
    xmlhttp.send(str);
    }

    </script>
    <div >
    <input type=”button” onclick=”createCustomer()” value=”Submit”/>
    </div>

     
  • akhileshgandhi 6:52 pm on May 20, 2014 Permalink | Reply
    Tags: , full control,   

    Sharepoint user group with full controll getting access denied 

    Sharepoint user group with full controll getting access denied

     

    This would happen if you deleted default group and have recreated new groups again. When you did that new Owners group does not have permission to Access Request list and thus when you try to modify or go to user permissions you get access denied.

    Get Access request list GUID from powershell

     

    cls
    $myweb = Get-SPWeb -Identity  weburl
    $id = $myweb.Lists[“Access Requests”].Id
    $id

     

    Now EditList permissions by doing following

    weburl/_layouts/15/ListEdit.aspx?List=GUID of list

    grant newly created owners group full control on this list

    this should solve the problem

     
  • akhileshgandhi 6:48 pm on May 20, 2014 Permalink | Reply
    Tags: 2013, , security group,   

    Sharepoint Security Groups not getting updated 

    When user add’s and removes members in security group it does not get updated in sharepoint.

     

    Core reason for this problem is security token service is caching your security token for 24 hours. You need to change default settings to update token expiration. It should not be to low value as it will affect performance thus I reasonable time is atleast 60 minutes

     

     

    cls
    $sptokensvc= Get-SPSecurityTokenServiceConfig
    $sptokensvc
    $sptokensvc.FormsTokenLifetime = (New-TimeSpan -minutes 60)
    $sptokensvc.WindowsTokenLifetime = (New-TimeSpan -minutes 60)
    $sptokensvc.LogonTokenCacheExpirationWindow = (New-TimeSpan -minutes 30)
    $sptokensvc.Update()
    iisreset

     
  • akhileshgandhi 10:33 pm on March 27, 2014 Permalink | Reply
    Tags: sharepoint 2013 ;search;custom;display template   

    Sharepoint 2013 Search Custom Microsoft Word Display Template 

    We want to include Last Modified date and author name is Search results. 

    1.Open your Search Site in Sharepoint Designer.

    2, Go to _catalogs/masterpages/Display templates/Search

    3. Copy Item_Word.html and past it. rename new file as Item_Work_Custom

     

    Image

     

    4. Change top most title to Word Item Custom

    5. Update  <doby> content with following content

    <div id=”Item_Word”>
    <!–#_
    if(!$isNull(ctx.CurrentItem) && !$isNull(ctx.ClientControl)){
    var id = ctx.ClientControl.get_nextUniqueId();
    var itemId = id + Srch.U.Ids.item;
    var hoverId = id + Srch.U.Ids.hover;
    var hoverUrl = “~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Word_HoverPanel.js”;
    $setResultItem(itemId, ctx.CurrentItem);
    ctx.CurrentItem.csr_Icon = Srch.U.getIconUrlByFileExtension(ctx.CurrentItem);
    ctx.CurrentItem.csr_OpenApp = “word”;
    ctx.currentItem_ShowHoverPanelCallback = Srch.U.getShowHoverPanelCallback(itemId, hoverId, hoverUrl);
    ctx.currentItem_HideHoverPanelCallback = Srch.U.getHideHoverPanelCallback();
    ctx.CurrentItem.csr_ShowLastModifiedTime = true;
    ctx.CurrentItem.csr_ShowAuthors = true;
    var modifiedDate = $getItemValue(ctx, “LastModifiedTime”);
    modifiedDate.overrideValueRenderer($contentLineText);

    _#–>
    <div id=”_#= $htmlEncode(itemId) =#_” name=”Item” data-displaytemplate=”WordItem” class=”ms-srch-item” onmouseover=”_#= ctx.currentItem_ShowHoverPanelCallback =#_” onmouseout=”_#= ctx.currentItem_HideHoverPanelCallback =#_”>
    _#=ctx.RenderBody(ctx)=#_
    <div id=”_#= $htmlEncode(hoverId) =#_” class=”ms-srch-hover-outerContainer”></div>
    <div><b>Last modified :</b> _#= modifiedDate=#_</div>
    </div>
    <!–#_
    }
    _#–>
    </div>
    Image

     
  • akhileshgandhi 10:40 pm on February 4, 2014 Permalink | Reply  

    Issue with Sharepoint 2013 designer workflow 

     

    You get error message sorry something went wrong

    In logs I found out request was timing out.

     

    Solution Make sure following four service are running

     

    Service Bus gateway

    Service Bus Meeage Broker

    Windows Fabric Host Service

    Workflow Manager Backend

     

     
  • akhileshgandhi 9:02 pm on December 17, 2013 Permalink | Reply
    Tags: nlog ;javascripts;logging   

    ASP.NET with NLOG Custom fields with javascript and server logging 

     

    NLOG is logging package for ASP.NET  you can install package from NUGet

    below I am pasting nlog config for inserting custom data in logging

     

    <?xml version=”1.0″ encoding=”utf-8″ ?>
    <nlog xmlns=”http://www.nlog-project.org/schemas/NLog.xsd&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    autoReload=”true”
    internalLogLevel=”Trace”
    throwExceptions=”true”
    internalLogFile=”${basedir}/internalLog.txt”
    internalLogToConsole=”true”>

    <!– define various log targets –>
    <targets>
    <!– write logs to file –>
    <target name=”file” xsi:type=”File” fileName=”${basedir}/logs/Log ${shortdate}.txt” layout=”${longdate} ${callsite} ${level}: ${message} ${exception:format=Message,StackTrace} ${stacktrace}” />

    <!– write log message to database –>
    <target xsi:type=”Database” name=”Logger” keepConnection=”true”
    useTransactions=”true”
    dbDatabase=”Logger”
    commandText=”INSERT INTO LogTable (CreateDate, Origin, LogLevel, Message, Exception, StackTrace,UserId,ActionType) values (@createDate, @origin, @logLevel, @message, @exception, @stackTrace,@UserId,@ActionType)”
    connectionString=”Server=LR3TWVSHPQ03;Initial Catalog=12L_Ext_Apps_Dev001_RRRS;User Id=RRRSUser;Password=Y0rHp4eeWpp)t*e303″ >

    <parameter name=”@createDate” layout=”${date}”/>
    <parameter name=”@origin” layout=”${callsite}”/>
    <parameter name=”@logLevel” layout=”${level}”/>
    <parameter name=”@message” layout=”${message}”/>
    <parameter name=”@exception” layout=”${exception:format=Message,StackTrace}”/>
    <parameter name=”@stackTrace” layout=”${stacktrace}”/>
    <parameter name=”@UserId” layout=”${event-context:item=UserId}”/>
    <parameter name=”@ActionType” layout=”${event-context:item=ActionType}”/>
    <!– custom field! –>
    <!– custom field! –>

    </target>
    </targets>
    <rules>
    <logger name=”*” minlevel=”Trace” writeTo=”file” />
    <logger name=”*” minlevel=”Trace” writeTo=”Logger” />
    </rules>
    </nlog>

     

    here is logging table structure

    /****** Object:  Table [dbo].[LogTable]    Script Date: 12/17/2013 15:00:11 ******/
    SET ANSI_NULLS ON
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    CREATE TABLE [dbo].[LogTable](
    [id] [bigint] IDENTITY(1,1) NOT NULL,
    [CreateDate] [datetime] NULL,
    [Origin] [nvarchar](50) NULL,
    [LogLevel] [text] NULL,
    [Message] [text] NULL,
    [Exception] [text] NULL,
    [StackTrace] [text] NULL,
    [UserId] [nvarchar](100) NULL,
    [ActionType] [nvarchar](200) NULL,
    CONSTRAINT [PK_LogTable] PRIMARY KEY CLUSTERED
    (
    [id] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

    GO

     

    Here is code to insert log event into table from server code

    private Logger logger = LogManager.GetCurrentClassLogger();

    LogEventInfo theEvent = new LogEventInfo(NLog.LogLevel.Info, “”, LoginId);
    theEvent.Properties[“UserId”] = LoginId;
    theEvent.Properties[“ActionType”] = “Portal Login”;
    logger.Log(theEvent);

     

    I wrote a ajax function with inserts into nlog and then call it in javascript to records client side events

    client function

    function InsertAction(action)
    {
    $.ajax({
    type: “POST”,
    contentType: “application/json; charset=utf-8”,
    url: “Search.aspx/SetAction”,
    data: “{‘action’:'” + action  + “‘}”,
    async :true,
    dataType: “json”,

    success: function (data) {

    },
    error: function (result) {
    alert(“Error Occurred”);
    }
    });

     

    [WebMethod(EnableSession = true)]
    public static object SetAction(string action)
    {
    Logger logger = LogManager.GetCurrentClassLogger();
    try
    {

    User usr = (User)HttpContext.Current.Session[“User”];

    LogEventInfo theEvent = new LogEventInfo(NLog.LogLevel.Info, “”, usr.UserID);
    theEvent.Properties[“UserId”] = usr.UserID;
    theEvent.Properties[“ActionType”] = action;
    logger.Log(theEvent);
    }
    catch (Exception ex)
    {
    logger.TraceException(“Exception”, ex);
    }
    return true;
    }

    }

     

     

     
  • akhileshgandhi 12:17 am on August 14, 2013 Permalink | Reply
    Tags: bootstrap 3;sharepoint 2013;custom navigation   

    Sharepoint 2013 + bootstrap 3 

    Please first check my previous post on custom navigation

    https://akhileshgandhi.wordpress.com/2013/08/08/sharepoint-2013-custom-navigation-with-bootstrap/

    changes for bootstrap 3

    Added following references in MasterPage html

    <link rel=”stylesheet” href=”//netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/css/bootstrap.min.css”>

    <script src=”//netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/js/bootstrap.min.js”></script>

    rap your  TopNavigationNoFlyoutWithStartNode node with

    <nav class=”navbar navbar-inverse” role=”navigation”>
    <div class=”navbar-header”>
    <button type=”button” class=”navbar-toggle” data-toggle=”collapse” data-target=”.navbar-ex1-collapse”>
    <span class=”sr-only”>Toggle navigation</span>
    <span class=”icon-bar”></span>
    <span class=”icon-bar”></span>
    <span class=”icon-bar”></span>
    </button>

    </div>

    end you nav tag where TopNavigationNoFlyoutWithStartNode  ends
    </nav>

    wrote custom js file to change DOM to use specific css on Sharepoint navigation

    please refer to my previous post on how to modify DOM for 2013 Navigation

    Image

     
    • Amar 9:40 pm on April 17, 2015 Permalink | Reply

      Hi Akhilesh,

      I like your post. Could you please let me know where can i get your custom CSS file ?

      I download bootstrap wsp file from codeplex. I want to change my master page similar to your design.

      I greatly appreciated your post and help.

      Thanks,
      Amar

      • akhileshgandhi 6:46 am on July 9, 2015 Permalink | Reply

        Amar,

        I did it 2 years back. I do not have it handy else I would have shared it

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel