Ads

Thursday, 23 March 2017

Command to retrieve SharePoint farm/App pool account passwords

Farm account is the account which used by IIS to run Central Admin. Same way web applications and Service applications run in App Pools with their own credentials.

Along with central admin, we can also recover password of other app pools running accounts.

Lets assume we want to recover password of below app pool accounts
SharePoint Central Administration v4
SharePoint – 80
Some SharePoint Service App Pool

Here we can use IIS appcmd.exe to request the Password field from the ProcessModel section of the applicationHost.config file as like below :

cmd.exe /c $env:windir\system32\inetsrv\appcmd.exe list apppool "SharePoint Central Administration v4" /text:ProcessModel.Password

In above command we can replace "SharePoint Central Administration v4" with any app pool name to get the password.



Monday, 20 March 2017

Installation & Configuration of workflow manager in SP 2013

Hi All, Here i will explain the steps to install & configure workflow manager in SharePoint 2013...
If you want to know what is workflow manager, I recommend you to browse my previous post Workflow Manager in SP 2013

Installation & Configuration:-
1.      Pre-Install Steps:
a.       Ensure SP farm is updated to at least to march 2013 PU (SP1 is recommended)
b.      Ensure App management service is started
c.       Check user Profile sync service
d.      Create workflow setup & service account & one separate group
                                                              i.      Open AD & create accounts like wfsetup & wfsrv & WF Admin group
e.       Add WF setup account in SQL server with Sysadmin permission
                                                              i.      SQL à DB server à Security à login à New login à general tab à search à find WF setup account à in Server Roles à select sysadmin
f.        Add WF setup account in administrator group in workflow server
                                                              i.      If we are installing WF manager in same sharepoint farm then select one WFE server as an workflow server.
                                                            ii.      Open Server Manager > Tools > Computer Management > Local Users Ad Groups > In Administrator Group > Add WF Setup Account as Member.
g.        
2.      Install Workflow Manager
a.       Login to workflow manager server (WFE server in this case) with WF setup account
b.      Download Microsoft Web Platform Installer 5
                                                              i.      Download link: https://www.microsoft.com/web/downloads/platform.aspx
c.       Open this installer à product Tab à search box à workflow manager à add à install
d.      After installation, it will show “Continue” à click continue à close the configuration window as we will configure it in next step à click finish
e.       Again open installer à install following components
                                                              i.      Service Bus 1.0 Cumulative Update 1
1.      In search box type Service Bus and Click on Add > Install
                                                            ii.      Workflow Manager Cumulative Update 3.
1.      In Search box type Workflow Manager and Click on Add > Install.
                                                          iii.       
f.         
3.      Configure Workflow Manager
a.       Login to workflow manager server (WFE server in this case) with WF setup account.
b.      Start à search box à Type Workflow Manager Configuration
c.       In opened page à Select Configure Workflow Manager with Custom Settings
d.      Configure below databases by entering SQL server, DB names and Test Connections
Check the check box “use the above SQL server instance & settings for all databases”
                                                              i.      Farm management Database Name - WFManagementDB
                                                            ii.      Instance management database – WFInstanceManagementDB
                                                          iii.      Resource Management Database - WFResourceManagementDB
e.       Provide workflow service account (wfsrv) & password
f.        Configure Certificate
                                                              i.      If you don’t have it, then check on auto generate & set the generation key as SharePoint pass-phrase
                                                            ii.      If you have it, uncheck auto generate & browse for to choose it.
g.       Configure Port for Workflow manager
                                                              i.      The port we use here will be used during registering WFM using cmd.
                                                            ii.      Enter the default ports 12290 for WFM management & 12291 for HTTP port.
                                                          iii.      Check on allow WF management over HTTP on this computer
h.      Now in configure admin group section, Provide WF admin group name (WF admin) à Click Next
i.        Configure service bus & test connections
                                                              i.      Farm management Database - SBManagementDB
                                                            ii.      Gateway database – SBGatewayDatabase 
                                                          iii.      Message container Database – SBMessageContainer01
Use the same configuration of Workflow Manager for Service Bus
Same account credential, Same certificate, Same auto generated
j.        Configure ports for service bus
Use default ports as shown below & enable firewall rules on this computer
                                                              i.      HTTPS Port: 9355
                                                            ii.      TCP Port: 9354
                                                          iii.      Message Broker Port: 9356
                                                          iv.      Internal Communication Port Range: 9000
k.      Now in final page review the summary & click on OK à it will start the configuration
l.         
4.      Register Workflow Manager (For Http)
a.       Run SP management Shell as administrator à run the below command
b.      Register-SPWorkflowService -SPSite "Site URL" -WorkflowHostUri "http://workflowhost:12291" -AllowOAuthHttp
c.       Now logon to each SharePoint server & install workflow manager client on each server
                                                              i.      Download Link: https://www.microsoft.com/en-in/download/details.aspx?id=35375
d.       
5.      Test Workflow Manager
a.       Method 1:
                                                              i.      Open IIS à Expand Sites à Select workflow management site à click browse
                                                            ii.      It will show up one page with XML, that means connected & registered properly.
b.      Method 2:
                                                              i.      Open SP designer à Workflows à Site workflow in ribbon à in platform type the SharePoint 2013 workflow should be listed along with SP 2010 workflow
c.       Method 3:
                                                              i.      Open SharePoint CA à Application Management à Manage service application à Click workflow service application proxy à check whether its connected or not
6.       
         Related posts:
           Request Management in SharePoint 2013

Friday, 17 March 2017

SharePoint: Redirecting to a page after adding a New item to a list

There are times when you want a user to add an item to a list without displaying the list, either before or after they fill out the “New Item” form.
 image
To get them to the form is easy. Go to the list, click the New button and note the URL. Copy the URL and paste it as a link in Quick Launch, an Announcement, a links list or a Content Editor Web Part.
image
When the user clicks your link they will go directly to the New item page.
But when they click OK they will go to the list, not back to your page.
 image

The fix is easy...        Add “source=” to the end of the link.

1) Go to the list and click the new button. You will see a URL like:
http://www.yourserver.com/sites/sales/Lists/Tasks/NewForm.aspx?RootFolder=%2FLists%2FTasks&Source=http%3A%2F%2Fwww.yourserver.com%2Fsites%2Fsales%2FLists%2FTasks%2FAllItems%2Easpx

2) copy the URL and change the part after Source= to the desired destination. The following will send them back to your home page:
http://www.yourserver.com/sites/sales/Lists/Tasks/NewForm.aspx?RootFolder=%2FLists%2FTasks&Source=http%3A%2F%2Fwww.yourserver.com%2Fsites%2Fsales

Absolute or Relative?
Best practice would be to use a relative URL (no HTTP or server name) so your site will work when you have internet and intranet access to the same site. Something like "Source=/sites/sales/" or "Source=/sites/sales/mycustompage.aspx".
To return to the home page add this URL as a link in your Announcement, a links list or a Content Editor Web Part:
Absolute:
http://www.yourserver.com/sites/sales/Lists/Tasks/NewForm.aspx?RootFolder=%2FLists%2FTasks&Source=http%3A%2F%2Fwww.yourserver.com%2Fsites%2Fsales
Relative:
/sites/sales/Lists/Tasks/NewForm.aspx?RootFolder=%2FLists%2FTasks&Source=%2Fsites%2Fsales

In the examples above I did not always escape the slashes:  /  =  %2F
Any slash after the "?" should be escaped.

Redirect the Cancel Button

One of the questions below notes that the redirect steps above redirect both the OK and the Cancel button to the “Source” URL.  Here’s is a quick pass at adding a “CancelDestination” parameter to the query string to set the destination for the cancel button.
Steps:
  1. Go the “New Item” page
  2. Edit the URL and add “&ToolPaneView=2” to the end of the URL to put the page in edit mode
     
    http://yourserver/sites/sales/Lists/Announcements/NewForm.aspx?RootFolder=%2fsites%2fsales%2fLists%2fAnnouncements&Source=http%3a%2f%2fyourserver%2fsales%2fyoursite&ToolPaneView=2
     
  3. Click “Add a Web Part” and add a Content Editor Web Part (CEWP)
  4. Move the CEWP below the existing list web part
  5. Edit the CEWP and click the Source Editor button
  6. Paste the JavaScript from below
  7. Save your changes and exit the edit mode of the page
  8. Create a URL similar to the one earlier in the article, but add a new parameter named “&CancelDestination=http://yourcanceldestination"
     
    http://www.yourserver.com/sites/sales/Lists/Tasks/NewForm.aspx?RootFolder=%2FLists%2FTasks&Source=http%3A%2F%2Fwww.yourserver.com%2Fsites%2Fsales&CancelDestination=http%3A%2F%2Fwww.yourserver.com%2Fsites%2Fsales%2FCancelPage.aspx
     
  9. Test!

The JavaScript:
<script>

var querystring = window.location.search.substring(1);  
var parameters = querystring.split("&");
var QueryString = Array();
for (var i=0;i<parameters.length;i++)
{
  QueryString[parameters[i].split("=")[0]] = parameters[i].split("=")[1];
}
if (QueryString["CancelDestination"] != undefined)
{
  var inputs = document.getElementsByTagName("INPUT");
  for (var i=0; i<inputs.length; i++)
  {
    if (inputs[i].value == "Cancel")
    {
      inputs[i].onclick =
       function () {document.location.href = unescape(QueryString["CancelDestination"])};
    }
  }
}
</script>

Ads