Wednesday, October 28, 2009

Changin service accounts and service account passwords in SharePoint/MOSS and Windows SharePoint Service

To change the passwords for service accounts in SharePoint Server 2007 and in Windows SharePoint Services 3.0, follow these steps.

Note If the SQL Server service uses a domain account, and the password for that domain account is either expired or invalid, make sure that you update the password for the domain account before you perform this procedure.
  1. Update the password for the account that is used by the Central Administration application pool. To do this, follow these steps:
    1. On all servers in the server farm, open a command prompt, type the following line, and then press ENTER:
      cd %commonprogramfiles%\Microsoft Shared\Web server extensions\12\Bin
    2. On the server that hosts the Central Administration Web site, type the following line at the command prompt, and then press ENTER:
      stsadm -o updatefarmcredentials -userlogin DomainName\UserName -password NewPassword
    3. On all other servers in the server farm, type the following line at the command prompt, and then press ENTER:
      stsadm -o updatefarmcredentials -userlogin DomainName\UserName -password NewPassword -local
    4. Restart Microsoft Internet Information Services (IIS) 6.0. To do this, type the following line at the command prompt, and then press ENTER:
      iisreset /noforce
  2. Verify that the Administration Application Pool Credential Deployment job definition is no longer displayed on the Timer Job Definitions page of SharePoint 3.0 Central Administration. To do this, follow these steps:
    1. Open SharePoint 3.0 Central Administration, click Operations, and then click Timer job definitions under Global Configuration.
    2. Verify that the Administration Application Pool Credential Deployment job definition is no longer displayed in the list.

      Note If the Administration Application Pool Credential Deployment job definition is displayed in the list, wait until it disappears from the list.
  3. Update the password for the application pool account that is used by Web applications on the server farm. To do this, type the following line at a command prompt on every server on the server farm, and then press ENTER:
    stsadm -o updateaccountpassword -userlogin DomainName\UserName -password NewPassword -noadmin
  4. Update the password for the account that is used to run the Windows SharePoint Services Help Search service. To do this, type the following line at a command prompt on every server on the server farm, and then press ENTER:
    stsadm.exe -o spsearch -farmserviceaccount DomainName\UserName -farmservicepassword NewPassword
  5. Update the password for the default content access account that is used by the Windows SharePoint Services Help Search service. To do this, type the following line at a command prompt on every server on the server farm, and then press ENTER:
    stsadm.exe -o spsearch -farmcontentaccessaccount DomainName\UserName -farmcontentaccesspassword NewPassword
  6. If you are running SharePoint Server 2007, you must also follow these steps:
    1. Update the password for the account that is used by every Shared Services Provider (SSP) on the server farm. To do this, type the following line at a command prompt on every server on the server farm, and then press ENTER:
      stsadm.exe -o editssp -title SharedServicesProviderName -ssplogin DomainName\UserName -ssppassword NewPassword
    2. Update the password for the account that is used to run the Office SharePoint Server Search service. To do this, type the following line at the command prompt, and then press ENTER:
      stsadm.exe -o osearch -farmserviceaccount DomainName\UserName -farmservicepassword NewPassword
    3. If the server farm is configured to use single sign-on, update the password for the account that is used by the Microsoft Single Sign-On Service. To do this, follow these steps:
      1. Click Operations in SharePoint 3.0 Central Administration, and then click Service accounts under Security Configuration.
      2. Under Windows service, click Single Sign-On Service.
      3. Under Configurable, specify the password, and then click OK.
    4. Update the password for the default content access account that is used by the Office SharePoint Server Search service. To do this, follow these steps:
      1. Open SharePoint 3.0 Central Administration, and then click the link to the SSP Web application under Shared Services Administration.
      2. Under Search, click Search settings, and then click Default content access account.
      3. Specify the password to use for the content access account, and then click OK.

Creating an automated Back up of SharePoint/MOSS site collection

Here are the steps to be followed to create an automated back up of the site collection. This Script come in handy for any SharePoint/MOSS administrator

1. Create a text file and copy the following code into it

'''''''''''''
'Begin Script
'''''''''''''
Dim fso, f, fspec
dim yr, mo, dt, hr, min, sec

yr = Year(Now)

mo = Month(Now)
if mo < 10 Then
mo = "0" & mo
end if

dt = Day(Now)
if dt < 10 Then
dt = "0" & dt
end if

hr = Hour(Now)
if hr < 10 Then
hr = "0" & hr
end if

min = Minute(Now)
if min < 10 Then
min = "0" & min
end if

sec = Second(Now)
if sec < 10 Then
sec = "0" & sec
end if

FileName ="FILENAME_" & yr & "_" & mo & "_" & dt & "_" & hr & "_" & min & "_" & sec

'''''''''''''''''''''''''
'Run the spsbackup script
'''''''''''''''''''''''''
Set objShell = CreateObject("WScript.Shell")
objShell.CurrentDirectory = "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"

objShell.Exec ("stsadm.exe -o backup -url http://SiteCollection/ -filename ""E:\"& FileName & ".dat""")

Step 2: Rename the extension as .VBS and place it C:\ drive
Step 3: Double click on the .VBS file and check once if the back up happening properly.

Note: the back up may not happen if either site collection or path to save is wrong. And also if you don't have the rights to take back up of site collection or write permission in the save path

Step 4:Once successful back up is taken, you can create a schedule task for taking back up at regular interval

Note: In case you are working for an organisation where your pass word need to be changed after stipulated time span, don't use a domain account as the back up may stop when password is changed and you need to reset it for the schedule task. Use a local account with enough privilege

Tuesday, October 27, 2009

Remove Save button in Surveys with Branching

After a lot of searching and fiddling, i found a way to do this

Step 1: Go to the survey response page in SharePoint designer
Note: SharePoint designer is available for download at Microsoft for free
Click here to download
Step 2: Add a new row to the table in the page.
Step 3: Add a content editor web part by going to insert > sharepoint component > webpart > content query webpart
Step 4: Go to code view of content query web part and insert the following code between the CDATA []

Add a script tag and add this code along to it as shown in the image below


Code
_spBodyOnLoadFunctionNames.push("setValue");

function setValue() {
  hideButton("Save");
}

//This function hides a button on the page
function hideButton(valueDef){
  var frm = document.forms[0];
  for (i=0;i
    if (frm.elements[i].type == "button" && frm.elements[i].value == valueDef) {
    frm.elements[i].style.display = "none";
        }
    }
}

Note: If your survey uses more than 1 branching logic/you have more than 2 pages in the survey then you need to do the same for intermediate page

Monday, October 26, 2009

Sharepoint/MOSS and ME

One fine day, i was called in for a meeting to come up with a internal portal for a social forum of my company. This fortunate i still remember as this was the day i was introduced to one of my current buddies MOSS or we call it dearly as SharePoint. I term it as my buddy since i spend nearly 2 hours at least with her :).
Today it nearly 18 months since my first encounter. I have come on strides working my hand on MOSS deployment, Portal customization, Custom workflow based product development, Custom solutions to automate most of the manual business process. In this blog i will be put down all my experiences and challenges i had faced over my 18 months of affair with MOSS. Hoping that this would be use to budding SharePoint developers