Wednesday 17 November 2010

Powershell - Running as a farm administrator using the SharePoint plug-in on Powershell

Problem: I need to run SharePoint Powershell commands in Production/UAT, I get remote access to the servers however the account is not the SharePoint farm account as the Famr account runns windows services and should not have remote access to the servers. 

Initial Hypothesis: Remote desktop into the WFE server, use the command prompt to launch Powershell using the farm account.  Lastly, add the SharePoint snapin for SharePoint 2010.
Update 6 Dec 2010 - Alternatively, hold down the shift key and right click the program you wish to run, you are given the "run as .." menu option.

Resolution:
1.> Remote desktop into the machine using a remote desktop access account i.e. demo\
2.> Open the cmd prompt and run the following cmd:
cmd > runas /user:demo\farm_admin c:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe
3.> In the new Powershell windows add the PowerShell snapin
ps c:\windews\system32> Add-PSSnapin Microsoft.SharePoint.PowerShell
Read More:
http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/fcb77654-0f13-42e0-b181-6e52242fe9d6  Adding the SharePoint snapin to PowerShell.

Tuesday 16 November 2010

DateTime control default behaviour

Problem: The SharePoint date time control's default behaviour is to returns the current date and time when no date has been selected.
Initial Hypothesis: Validate the control to pre insert to check if it is selected, if no date time is choosen don't update the record.
Resolution:  The Property IsDateEmpty returns "false" if the date has been input.
Code:
if (!dtMyBirthday.IsDateEmpty)  { // ... User has delected their birthday date so insert into SQL table or list }
Read More:
http://karinebosch.wordpress.com/sharepoint-controls/datetimecontrol-control/

Monday 15 November 2010

Changing service account passwords - The Service is unavailable

Problem: Browsers return the following error "Service Unavailable  Http Error 503.  The Service is unavailable." on all SharePoint websites including central admin.
Initial Hypothesis: I changed my password yesterday causing the app polls to fail when logging in.  The domain account used on my development machine required a password change.  Starting the machine causes all the IIS web sites to display the error message "Service Unavailable".  I run various services and application polls using my domain account.  The services can no longer log on.  Application pool cannot be started after the reboot/iisreset.
Resolution:  Change the log on details for the application pools used by IIS that run using the domain account that's password was reset.  Also start the Windows services that run using the windows domain account.

Ensure the SharePoint services running

Friday 12 November 2010

Installing SharePoint using a dedicated Installation account

Problem: Best practice is to install SharePoint servers using a dedicated install account.  This account is not the farm account.  Once the installation is complete, the installation account should be disabled.  You need to install in the role of the admin account to install correctly. 

Note:  If your install and farm account are the same as is often the case, this post does not apply to you.

Initial Hypothesis:  It is only worth following this post if you are using at least 5 or more accounts for your farm install.  The idea is that the installation account is disabled after installation.

Resolution:  The farm account needs the 2 SQL Server security roles namely: dbcreator and securityadmin.  The farm account still needs local admin permission rights on each Web Front End (WFE) server.  The Installation account does not need any SQL Server permissions.

Using the codeplex AutoSPinstaller.  Launch the installer using a cmd prompt using the runs cmd to run in the farm domain admin priviledge.
cmd> runas /user:demo\farm_admin %windir%\system32\cmd.exe
cmd> D:\SP2010\Script>Launch.bat


You can also do the runas shotcut to change the account installing SharePoint.
Update 6 Dec 2010 - Hold down the shift key and right click the cmd prompt program menu, you are given the "run as .." menu option.

Update: 22 June 2011 - the current version of AutoSPInstaller is 2.5, additionallly the codeplex project is called AutoSPIntaller not SPAutoInstaller as previously named.

AutoSPInstaller - Step-by-step guide: http://blog.lekman.com/2010/11/automated-sharepoint-2010-installations.html

Central Admin is not working correctly - You may be trying to access this site from a secured browser on the server

Problem: Using Central Administration (CA) on SharePoint 2010 you can't use the menu and you see the following information "You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page."

Initial Hypthesis: FireFix work so it is a I.E. 8 issue.

Resolution: As suggested on the MSDN formun turn of the IE

More Info:
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/4cf3a740-dddf-4c08-bc36-03efc731eff8
http://social.technet.microsoft.com/Forums/en/winservergen/thread/e87585de-d365-48c8-b08f-1050d68724ed

Wednesday 10 November 2010