Saturday, November 24, 2018

PWA: EPM/Project Server site give administrator access to user or group for project web app

Leave a Comment
To give administrator access to user/group for project web app we need to run following powershell command
Grant-SPProjectAdministratorAccess -Url http://contoso-AppSrv/pwa -UserAccount contoso\john.woods
Read More

SharePoint 2013/2016: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

Leave a Comment
While trying to give administrator access to user for an instance of PWA I tried to run following command in sharepoint powershell:
Grant-SPProjectAdministratorAccess -url XXXX user domain\XXXX

I came across following issues:

SharePoint 2013/2016: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

Solution:
This happened b/c I tried to launch sharepoint powershell with user part of farm admin group, however I need to work with account similar access to sharepoint central admin app pool as that account requires right on server & databases to run configuration through powershell commands.
so I need to run following command throught account which I used to install my sharepoint farm:
Add-SPShellAdmin -UserName Domain\User



Read More

Sunday, November 4, 2018

Sitecore: How to setup a visual studio solution

Leave a Comment
To setup sitecore visual studio solution we need following steps accordingly:


  1. Create a new MVC solution in Visual Studio
  2. Replace or copy web.config & global.asax files from inetpub->wwwroot->"Sitecore application" folder and paste it to new MVC application created in step 1.
  3. Similarly replace web.config files from View folder same as step 2 into new MVC application created in Step 1
  4. Add reference to following dlls (I mostly create a new folder in MVC solution/application created in step 1 called library and copy paste following files):
    1. Sitecore.Kernel.dll
    2. Sitecore.MVC.dll
    3. Sitecore.MVC.Analytics.dll
  5. Add new view to verify above configuration by using Sitecore intellisense for:
    1. @using Sitecore.MVC
    2. @Html.Sitecore().CurrentItem.Name
Read More

Thursday, November 1, 2018

Add new Publishing target in SiteCore 9

Leave a Comment
Previously in Sitecore 8 we used to add publishing target by following these three steps:

  1. Add new item under Sitecore->System->Publishing Targets
  1. Update Sitecore.config field to add database configuration section under <databases section for new Publishing Target i.e. WebUAE
  1. Add new connection string setting under ConnectionStrings.config for new web database
However while doing so we received following error:
Could not find configuration node: PropertyStoreProvider/store[@name='WebUAE']
solution:
For sitecore 9 we need to add missing nodes as indicated by error under section PropertyStoreProvider:
<store name="WebUSA" prefix="WebUSA" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.$(database)PropertyStore, Sitecore.Kernel">      <param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
      <param resolve="true" type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" />
      <param resolve="true" type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" />
    </store>
But wait, it pops up another error...hmmm Could not find configuration node: eventing/eventQueueProvider/eventQueue[@name='WebUAE']
solution:
Add following node under <eventQueueProvider
<eventQueue name="WebUSA" type="Sitecore.Data.Eventing.$(database)EventQueue, Sitecore.Kernel">
        <param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
        <param ref="PropertyStoreProvider/store[@name='$(name)']" />
      </eventQueue>
This will fix adding new publishing target for sitecore 9.
Happy development
x

Read More

Sunday, January 21, 2018

PWA setting missing security settings

Leave a Comment
In project Server 2016, sharepoint permission mode is overriding project server PWA instance permission.

Scenario:

After configuring project server 2016 on sharepoint 2016 VM, I can't able to find security setting under PWA setting.

Solution:

Run following powershell command under SharePoint powershell (administrator-mode)

Set-SPProjectPermissionMode -url 'pwa site url' -mode ProjectServer
Read More

Wednesday, January 3, 2018

Disable or hide project server custom fields in project detail pages based on group current user belong too

Leave a Comment


Business Case:

Only PMO coordination team should able to update/set information related to project status. Currently project managers are updating project status which are affecting business validations & process flow.

Solution:
1.       Create a SharePoint group “PMO_Users”. Add PMO coordination team members to this group.
2.       Whenever a project is edited or created, at project details page, our custom module will verify if currently logged in user is part of “PMO_Users” group.
3.       If point (2) is true then project status button is enable and PMO coordination team can only able to update project status.
4.       Project managers can’t able to update project status (as they are not part of PMO_Users group.

Understanding:
This module works on the basis that project status (custom field) can’t be updated from Microsoft Project (client application) and only updateable from PWA.

Cross-Browser compatibility:
I have verified this module on chrome & internet explorer. 

Script/Code:

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script>
ExecuteOrDelayUntilScriptLoaded(DisableProjectStatus,'sp.js');
function DisableProjectStatus()
{
var clientContext = new SP.ClientContext.get_current();
    var oWeb = clientContext.get_web();
    var currentUser = oWeb.get_currentUser();
    var allGroups = currentUser.get_groups();
    clientContext.load(allGroups);

    clientContext.executeQueryAsync(OnSuccess, OnFailure);

    function OnSuccess(sender, args)
    {
        var grpsEnumerator = allGroups.getEnumerator();
        var isNotPartOfPMO_Users=false;
        while(grpsEnumerator.moveNext())
        {          
            var group = grpsEnumerator.get_current();                  
            var grpTitle = group.get_title();
            if(grpTitle=='PMO_Users')
            {
                            isNotPartOfPCOAdmin=true;              
            }          
        }
        if(!isNotPartOfPMO_Users)
        {
            console.log('im not admin  user');
            var btnProjectStatus = $("button[id*='pfp_Repeater_ctl12_idCF_Btn_']");
            btnProjectStatus.attr("disabled", "disabled"); //similarly we can hide button as well.
        }
    }

    function OnFailure(sender, args)
    {
        console.log(args.get_message());
    }  
}
Read More