Restore SharePoint 2010 Farm to another Farm and then Access Denied

Backup and restore the SharePoint 2010 Farm more times to find a problem,if exchanged the service account when restored the SharePoint Farm, and the restored is success,enter the site will be directly Access Denied.
Log throw the related feature exception of Publishing, and find the Super User Account and Super Reader Account of Publishing feature are not updated, they are the original.
Run below command to update you will resolve this problem:
stsadm -o setproperty -pn portalsuperuseraccount –pv <New Service Account> –url <Web Application URL>
stsadm -o setproperty -pn portalsuperreaderaccount -pv <New Service Account> -url <Web Application URL>
iisreset



Javascript front-end to determine whether one user is the memeber of a permission group in SharePoint

last articl:Javascript front-end to start the SharePoint workflow ,Connected to a use SPservice some practice. When you need to do some low-level rights management, such as to determine whether the current user belongs to a permission group (Group) decided to display the UI. The following is the judgment function code:

function IsMemberOfGroup(strGroupName)
{
    var rt=0;
    var g_strCurrUser = "";
    $().SPServices({
            operation: "GetUserProfileByName",
            AccountName: $().SPServices.SPGetCurrentUser(),
            async: false,
            completefunc: function(xData, Status) {
        
            g_strCurrUser= $(xData.responseXML).find("Name:contains('PreferredName')").first().parent().find("Value").text();
        //alert(g_strCurrUser);
        $().SPServices({
                    operation: "GetUserCollectionFromGroup",
                    groupName: strGroupName,
                    async: false,
                    completefunc: function(xml, Status) {
                    
                            if($(xml.responseXML).find("User[Name='" + g_strCurrUser + "']").length > 0) 
                            {
                            //alert($().SPServices.SPGetCurrentUser({fieldName: "UserName"}));      
                            rt = 1;
                            }
                      
                    }
                }); /*close().SPServices({ */
            }
    }); /*close().SPServices({ */
      
    return rt;
}

First called by Jquery SharePoint webservice GetUserProfileByName "to get the user name and pass another one the webservice GetUserCollectionFromGroup" to determine whether the group members

Related Posts



Javascript front-end to start the SharePoint workflow

Within the enterprise, SharePoint requirement are immediate and small-scale, require fast realization. The front of the technology a lot of time to meet user needs, while avoiding the deployment of back-end development of the IIS restart, reducing the time of deliver. In many applications, I would like to do front-end using SPservice. SPservice based on JQuery javascript library to access the SharePoint the webservice CodePlex there is a lot of introduction. For example, to click a button to start a list of workflow code as follows:

<script type="text/javascript" language="javascript" src="http://server/JQuery/jquery-1.4.4.min.js"></script>
   <script type="text/javascript" src="http://server/jquery/jquery.SPServices-0.5.8.min.js"></script>

 

var g_workflow_templateid = "{d7b03357-1ad6-40b7-8d08-0c10d2935766}";
 
$().SPServices({
    operation: "StartWorkflow",
    async: true,
    item: "http://{ServerName}/sites/{SiteName}/Lists/{ListName}/" + itemID + "_.000" ,
    templateId: g_workflow_templateid ,
    workflowParameters:"<Data/>",
    completefunc: function(xData, Status) {
       //prompt("test",xData.responseXML.xml);
              
        alert("workflow has been started.");
                              
    }
});

The need to pay attention to the parameter is templateId: g_workflow_templateid,templateId will change every time when you pass the SharePoint designer to modify the workflow. It can find the configuration files from you through the URL of the page to manually start the workflow in the list settings, view the workflow through the SharePoint designer. In addition, a need to pass the itemID of course, is the current list item ID.

From: http://www.anhero.org/javascript-front-end-to-start-the-sharepoint-workflow/