Friday, March 24, 2017

cachehostinfo is null when starting distributed cache

An error comes up when we try to start the Distributed Cache Service on the Services on the Server page in the Central Administration. The error that comes up is "CacheHostInfo is null". This happens for particular server where we want to start the service. To troubleshoot the issue follow the below steps -


1> Login to the server for which this error had come up while starting the distributed cache.
2> Open the PowerShell ISE and run the below command
 
                 Get-SPServiceInstance -Server 
 
 3> Once we see the output, search for the Distributed Cache Service Instance. Get the ID associated to the Distributed Cache instance. once done, run the below command


          $s = get-spserviceinstance
          $s.Delete()


4> This will cleanup the distributed cache on that particular server.
5> For adding the server for the Distributed Cache, run the below powershell command

                  add-SPDistributedCacheServiceInstance -Verbose


6> For validation, one can check in the CA in Services on the Server page or run the below commands to check is distributed cache is running on the required servers
 Get-SPServiceInstance | ? {($_.service.tostring()) -eq “SPDistributedCacheService Name=AppFabricCachingService”} | select Server, Status

Friday, December 30, 2016

Setting up Synchronization of On-Premises Active Directory with Office 365

In office 365, there is a service called as the Azure Active Directory or better know as Azure AD. It is an integral part of Office 365. It is a free service available on each and every tenant. Azure AD is the identity store of the MS cloud. It is the Active Directory that these servers are hooked into for the identity needs. Azure AD is very different from the on-premises AD. Both of these manage the users, groups and contacts, but there is no concept of OU (Organizational Units) in Azure AD. It is a flat hierarchy. But with the concept of Azure Active Directory Domain Services (Azure AD DS), machine objects came into picture, where the Azure machines can be attached to the domain. Here the Azure level Domains become the container to hold resources related to Azure. But these Azure VMs cannot be connected to the Domains present or created on on-premises AD.

Now coming to the identities, that are being taken care in Office 365, are as follows -
a> Cloud-Only Identities - they are the simplest identity scenario, where all the user identities are stored on Office 365. Once can go to the Office 365 Admin Center, select Active Users and then add them manually one by one or import multiple users using CSV files as shown in the screenshot below.



b> Synchronized Identities - Here, the on-premises AD is the master of the identities. There is a service that would run regularly which would push the on-premises user data to Azure AD. All changes that are made in on-premises are synchronized properly on the Azure AD using Azure AD connect. This synchronization can include passwords. Technically, password hashes are synchronized and not the passwords stored in on-premises AD. If password hashes are chosen to for synchronization, then the end users can log into the office 365 using the same password as they log into on-premises. This is also called as SAME-SIGN-ON.

c> Federated Identities - We will talk about this bit later in the next post.

As we are aware and confident on the 1st option, we can skip this. Now, coming to synchronized identities, I share the high level steps which I performed to implement the same. Here in the below mentioned steps, I am not implementing the password synchronization part. here we will be synchronizing the users from on-premises AD to Azure AD.

The pre-requisites for this implementation is, one should have an O365 subscription. The account used to log in is the global administrator. I have utilized Amazon AWS Windows VM for the same. I have my Server Admin user name and password ready.


so, let's start from scratch -

1> Create a VM and enable the AD related roles and features as shown in the screenshot below as we will be creating an Active Directory/Domain Controller out of it. 
2>Once the roles and features are installed, went ahead and created a new forest to which the server was attached to. Please note that the Office 365 subscription one has .onmicrosoft.com, a same domain is advisable while creating the new domain on this step.

3> Once the domain is created and the server associated, go ahead and create test users as shown in the screenshot below.
4> Coming to the Office 365, there is a need to install Azure AD Connect Tool on the server (on-premises Domain Controller or AD), which will connect the server to Azure AD. The Azure AD Connect tool can be installed from the link

5> For the user synchronization to happen, we can select the express settings but for password synchronization, we need to select the Custom Settings while configuring the Azure AD Connect tool. In the Connect to Azure AD Section, we need to provide the O365 Global admin credentials.
6> Once done, it will ask for to Connect to the Directories. Here, provide the credentials of the server administrator used to access the VM that was created in step 1. Once done, it will connect to the AD.

7> In the next steps, it will ask about the domains. There will be a default domain linked to onmicrosoft.com. The other domain, that needs to be added is the .com domain. Once, added the next steps follow.

8> In the following steps, it will install and automatically take care of the configurations of the Azure AD Connect tool. Once done, it will automatically do the synchronization.    

9> In the Active users in the O365 Admin Center, please refresh and will find the test users that were created in on-premises AD will be reflected there as shown in the screenshot below. The sync type mentions if its synched from on-premises AD or not.

I hope I gave a clear idea on the synchronization aspect and also the steps to be performed for this to work properly.


Saturday, June 14, 2014

ILM SQL Configuration file could not be read: User Profile Synchronization issue in Sharepoint 2010

There was an issue in starting the User Profile Synchronization service from the central administration. Below is the warning and the content of the warning that were shown in the event viewer.

ILM SQL Configuration file could not be read: Error Parcing the SQL File: D:\Microsoft Office Servers\14.0\Sql\SchemaCollections.sql  Exception: Specified collection 'StringSchemaCollection' cannot be dropped because it is used by object '\.GetObjectCurrent'.



Observation and Steps to resolve the issue -

It was observed that the SYNC Database DBO owner was not the farm account but sa account. That was really very odd as I had used powershell to create the service application. For the issue to be fixed, the dbo on the SYNC database needs to be associated to The farm account. Below are the steps that were taken to fix the issue.

1>     Ran the below PowerShell script

Add-PSSnapin Microsoft.Sharepoint.powershell
cls
$syncdb = Get-SPDatabase -Id 97c3f4a3-2df2-47ef-9d36-52438563b0e8   # we need to get the ID from the respective SP farm
$syncdb
$syncdb.Unprovision()
$syncdb.Status='Offline'
$upa = Get-SPServiceApplication -Id cc4ea1bb-a1ee-40eb-8af7-e2bac2359431 # we need to get the ID from the respective SP farm
$upa
$upa.ResetSynchronizationMachine()
$upa.ResetSynchronizationDatabase()
$syncdb.Provision()

2>     Once the above script is run successfully, execute the below SQL script on the SYNC database

Use [Sync_DB]
EXEC sp_changedbowner ‘domain\Farmaccount’

3>     Once that is run, restart the timer service across all the SharePoint servers in the farm. This should fix the issue.

Hope this helps someone....


Sunday, March 10, 2013

Issue in accessing SharePoint Sites from inside the server

This is a very common issue which every sharepoint administrator faces. If the admins are trying to access the SharePoint site from the server itself, they are never able to do so because of the security set up that has been provided by Microsoft. Usually the sharepoint admins use this technique to understand which WFE is causing the issue during routine troubleshooting, if the Host file entry on the servers is made in this format.

127.0.0.1   xxx.sharepoint.com

Once they hit the SharePoint site on that server, it implies that the request is hitting to that server itself. I would suggest the below steps to be followed for the dev, test and staging environment, but wouldn't suggest to do so on production, as this would come under security audit.

Method 1 (recommended): Create the Local Security Authority host names that can be referenced in an NTLM authentication request
To do this, follow these steps for all the nodes on the server: -

1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
3. Right-click MSV1_0, point to New, and then click Multi-String Value.
4. In the Name column, type BackConnectionHostNames, and then press ENTER.
5. Right-click BackConnectionHostNames, and then click Modify.
6. In the Value data box, type the CNAME or the DNS alias or the Host header URL, and then click OK.
Note - Type each host name on a separate line.
Note - If the BackConnectionHostNames registry entry exists as a REG_DWORD type, need to delete the BackConnectionHostNames registry entry.
7. Exit Registry Editor, and then restart the computer.

Method 2: Disable the authentication loopback check
To set the DisableLoopbackCheck registry entry to 1, need to follow the steps on the server: -
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
3. Right-click Lsa, point to New, and then click DWORD Value.
4. Type DisableLoopbackCheck, and then press ENTER.
5. Right-click DisableLoopbackCheck, and then click Modify.
6. In the Value data box, type 1, and then click OK.
7. Exit Registry Editor.
8. Restart the computer.

Wednesday, January 23, 2013

Various Warning Emails in SharePoint 2010

I was working on setting up warning emails on my SharePoint farm, both for Site Quota warnings and warning emails for deleting unused sites. SharePoint provides these two features which can be used, but there has always been confusion about who will be receiving the emails. Before I answer that, lets discuss about the set up for sending out such warning emails.

1> First and foremost is to set up the outbound email settings from SharePoint Central Administration, as shown in the screenshot below. Go to Central Administration >> System Settings >> Configure outgoing e-mail settings


Provide the details of the SMTP as shown in the screenshot below otherwise the other configurations related to Warning emails will be greyed out.

2> Now go to the Central Administration >> Application Management and click on "Confirm Site Use and Deletion" as shown in the screenshot below.

3> On this page one can provide all the details as per the requirement and click on OK. The information would be when would the notifications start going to the site collection administrators and also if auto deletion would be opted for such unused sites as shown in the screenshot below.


 4> The e-mails that are generated because of this setting goes to the Primary Site Collection Administrator only. It doesn't go any other site administrator nor to secondary site collection administrator. You can check the primary site collection administrator by going to Central Administration >> Application Management >> Change Site Collection Administrators . Once can validate the Primary Site collection Administrator there.

5> For the Site Quota Warning, one has to go to Central Administration >> Application Management >> Configure Quotas and Locks . In that option, we need to enable check box inorder to send warning emails when the site collection storage is reaches to a warning limit as shown in the screenshot below.



6> These emails once configured will be sent to the Site Collection Administrators. But these Site Collection Administrators are the ones present in the path
Go to the Site Collection >> Site Actions>> Site Settings >> User and Permissions > Site Collection Administrators.

So, one can add more administrators in that group inorder to get the Site Quota Warnings emails.

Hope this helps and clarifies the doubts about the Warning emails sent by SharePoint 2010.
 

Thursday, January 10, 2013

Not able to delete SharePoint 2010 Web Analytics orphaned databases

I was working on cleaning up the sharepoint farm. I tried to delete the Web Analytics Service Application from the UI but was not able to do so. It was not allowing me to delete the service application from PowerShell either and threw the below error.

Exception calling "Delete" with "0" argument(s): "An object in the SharePoint a
dministrative framework, "WebAnalyticsWarehouseDatabase Name=WebAnalyticsServiceApplication_ReportingDB", could not be deleted because other objects depend on it. Update all of these dependants to point to null or different objects and retry this operation. The dependant objec
ts are as follows: WebAnalyticsServiceApplication Name=Web Analytics Service Application"


 I went to the Central Administration --> Upgrade & Migration --> Review Database Status. I observed that the Web Analytics databases were in "not responding" status.

After some analysis, I found that there were timer jobs that were using the databases which didn't allow to delete the service application. The Timer jobs are as follows -

Health Analysis Job (Daily, Web Analytics Data Processing Service, Any Server)
Health Analysis Job (Daily, Web Analytics Web Service, Any Server)
Microsoft SharePoint Foundation Usage Data Processing
Microsoft SharePoint Foundation Usage Data Import
Microsoft SharePoint Foundation Site Inventory Usage Collection


I went ahead and disabled the jobs. Then I went ahead and deleted the service application from the UI. It got deleted successfully without any issues. I ran the powershell command to clean up any orphaned database present on the sharepoint farm by running the below script

Get-SPDatabase | Where{$_.Exists -eq $false} | ForEach {$_.Delete()}

Thursday, December 27, 2012

Site Directory in SharePoint 2010

By default Site Directory template is not available in SharePoint 2010. Actually this template is in hidden state. In order to make it visible, we need to follow the below steps -

1>  Open  "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML\webtempsps.xml" XML file in the mentioned path.
2> Search for Site Directory in the XML.
3> Change the Hidden parameter from TRUE to FALSE.
4> To create it as a sub-site, there is a need to run the following command: stsadm.exe -o activatefeature -id 5F3B0127-2F1D-4cfd-8DD2-85AD1FB00BFC –url http://oursite
5> Once that is done we can see the option of Site Directory template under the Enterprise tab while creating a new Site Collection as shown in the screenshot below
6> Now we can go ahead and create a new site directory using the above template. Once the Site Directory is created, Microsoft provides an option of linking older site collections to the Site Directory. To manually add sites,we need navigate to the Sites list present in the newly created Site Directory i.e. http://sitedirectoryURL/SitesList and add to directory.  We can add any URL to the Site Directory.  We need to approve them as content approval is on by default.
7> For the new sites that would be created, we need to do the below configurations as shown in the screenshot below

In the Central Administration -> General Application Settings -> Configure Site Directory


Once the link is opened, we need to provide the Site Directory URL and enable the Site Creation Metadata.  This is enabled inorder to provide data wrt the site collections either to be mandatory or not. This will be visible when we create new site collections as shown in the screenshot below.

In the above screenshot we have selected only one site category to be mandatory. We get to see the below screenshot when we create the new site collection.
 
When the Site Directory is not implemented, the Site Categories option is not available.

For adding or deleting Site Categories in Site Directory of Sharepoint 2010, steps can be followed as mentioned in the below link, which applies to MOSS 2007, but the same steps can be followed for SP 2010 as well with some self understanding.

http://office.microsoft.com/en-in/sharepoint-server-help/add-or-change-categories-in-the-site-directory-HA010106564.aspx

Now coming to the second link on the Site Directory in General Application Settings in CA i.e. Scan Site Directory Links we can provide links for the lists and libraries looking for any broken or updated link. There is a timer job "Site Directory Broken Links Scan" that runs daily to do a validation and update the Title and Description of any updated link on to the Site Directory.

 

Wednesday, December 26, 2012

SharePoint 2010 search administration reports throwing error


While configuring all the service applications, I came across the Link "View Administrative Reports" under the Monitoring section.  When I went ahead and clicked on the one of the reports "CrawledRatePerContentSource", I got an error  "An unexpected error has occured".

I did an analysis of the ULS logs and found that it could not find the store procedure as highlighted in the screenshot below.

Then after doing some more analysis found that there is a timer job named as "Search Health Monitoring - Trace Events" which was in disabled state. Once this timer job is enabled and executed, the store procedures are created and thus execution of reports happen successfully.


Happy Troubleshooting!!!

Wednesday, November 21, 2012

Issue while deleting web application or service application in SP 2010

I came across an error while deleting a User Profile Service Application and it mentioned "An update conflict has occurred, and you must re-try this action. The object UserProfileApplication Name=User Profile Service Application was updated by [farm admin id], in the OWSTIMER (ID) process, on machine [machine name]. View the tracing log for more information about the conflict."

Below are the steps I followed to remove the User Profile Service Application with out error.
On the server throwing the OWSTIMER (ID) error I cleared the server cache, by following the below steps -
1. Logged into server throwing the OWSTIMER error.
2. Went to Start -> Administrative Tools -> Services
3. Stopped the Timer service by Right click SharePoint 2010 Timer and click Stop

Next I cleared the Server Cache (Win 2008 x64 R2) by following the below steps-

1. Browsed to local drive (c:) on the server
2. Looked for the ProgramData directory.  It is set to be hidden by default. Hit the Alt key -> Tools -> Folder Options -> View and under Hidden Files and folders click the Show Hidden files and folders radio button. Click ok.
3. Next browsed to ProgramData/Microsoft/SharePoint/Config directory
4. Inside this directory there are a couple folders with [GUIDs] as their names. Looked inside each folder until I found the one that has all the .XML documents and the Cache.ini file.
5. Backuped the Cache.ini file and save it in a safe place.
6. Then highlighted all the .XML files and deleted them.
7. Opened up the Cache.ini file and deleted the value inside and replaced it with 1. Saved a close the file.
8.  Went back to Administrative Tools -> Services, right clicked SharePoint 2010 Timer services and clicked Start to restart the services.

Inside the ProgramData/Microsoft/SharePoint/Config directory inside the [GUID] folder that had all the .XML documents and Cache.ini files all the .XML documents that were deleted were starting to repopulate.

Retrying the deletion went through with no error.
 

Tuesday, November 6, 2012

List of Active Sharepoint databases in SharePoint 2010

There was a need when I had to get the list of sharepoint databases present on a shared SQL server instance.

Below PowerShell Command helps to reduce the work in searching the databases individually. We need to go to the Sharepoint Management Shell and run the below powershell command -

Get-SPDatabase | Select Name | Out-File c:\AllActiveSPDBs.txt

The text file will be created automatically if it doesn't exist.

Also you can go and validate the same from Central Administration as well by following the path
Central Administration --> Upgrade and Migration --> Review Database Status


Tuesday, November 30, 2010

How to repair and re-install WMI on a Windows 2003 server

We need to restart the server if we do a repair or reinstall of the WMI. We repair WMI components on the server and if it does not work, then reinstall and restart the server.

We need to follow the below steps in order to Repair WMI :-

1> Open a command prompt window (Run as Administrator) and change directory (cd) to %windir%\System32\wbem on 32bit Windows or %windir%\SysWOW64\wbem on 64bit Windows

2> Run both these commands one at a time-

a> FOR %i in (*.dll) do RegSvr32 -s %i
b> FOR %i in (*.exe) do %i /RegServer
c> FOR /f %s in ('dir /b /s *.dll') do regsvr32 /s %s

3> Net stop /y winmgmt

4> FOR /f %s in ('dir /b *.mof *.mfl') do mofcomp %s

5> Net start winmgmt

We need to verify by running any WMI query to check if the WMI is working on the server or not. If the issue is still not resolved, then we need to use the following command to detect and repair a corrupted WMI Repository:

a> rundll32 wbemupgd, RepairWMISetup
b> we need restart the server.



We need to verify by running any WMI query to check if the WMI is working on the server or not. If the issue is still not resolved, then we need to perform the Comprehensive Rebuild Method.

Important note: If you've installed a Service Pack, you need to insert your Windows XP CD with Service Pack integration (called as the Slipstreamed Windows XP CD). If you don't have one, you may point to the %Windir%\ServicePackFiles\i386 folder for a recent version of the system files required during WMI repair. Or you may create a slipstreamed Windows XP CD and insert it when prompted.

Click Start, Run and type the following command, and press ENTER:

1> rundll32.exe setupapi,InstallHinfSection WBEM 132 %windir%\inf\wbemoc.inf

Insert your Windows XP CD into the drive when prompted. Repair process should take few minutes to complete. Then restart Windows for the changes to take effect.
 
 
Hope this helps someone.

Thursday, September 2, 2010

How to enable the Three State Workflow in a Document Library in Sharepoint

The Three State Workflow, is by default disabled in Document Library but is enabled in Tasks in the Sharepoint Site.

Here we will see how do we enable the Workflow States which are greyed out by default.

Problem-

When we open the Document Library and then go to the "Document Library Settings". Then we click on the link "Workflow Settings". We go to a page where we provide the Workflow name and then click on next button. In the other page, we get the section Workflow States and that section is greyed out. So we are stuck here when we try to create the workflow for the document library.

Resolution-

Here we have to create a column with the type of information in that column should be "Choice". And then add three options like, open, resolved and closed. Thats the reason why we call the workflow as 3 state workflow.
Once that column is specified, Now go ahead and create the workflow. Here in the "Workflow States" section you can see the options and the column name coming up without any issues.

If you try the same on the Tasks, you wont be facing such issue,as already that kind of choice column would be already present.

Hope this helps some onw.

How to disable the "New Folder" option in a document library in Sharepoint

When we go to a document library in a Sharepoint Site, we often see an option on the top as "New" which provides us an option to create a new document or new folder.

There may be a requirement which may come up that folder creation should be restricted for a particular document library.

We can follow the below steps to implement the same -

1> Open the Document library and click on "Settings" tab which comes besides the "Actions" tab.
2> Then select the "Document Library Settings"
3> Now go to "Advanced Settings" link and click on it.
4> There you will find out there is a "Folder" section, where it asks "Display "New Folder" command on the New menu?". Select the option as "No".

Then we are done. Go back to the Document library and click "New". you will get only the "New Document" option.

I would this implementation to be done for small Document Libraries. But for large Document Libraries, it is advisable to split the documents into various folders which inturn would improve the performance.

Hope this helps someone.

Wednesday, September 1, 2010

Installing SP2010 pre-requisites

Installation of Sharepoint 2010 Pre-requisites-

1> 64 bit Windows Server 2008 (2 in no.)
2> IIS 7.0 needs to be installed on web server
3> SQL 2008 is the database server



Steps to install Sharepoint 2010 on web server -


1> To install the O14 sharepoint, firstly run the pre-requsisteinstaller.exe file. This should install the following files and exe


a> IIS server role.

b> Power shell 1.0

c>.NET framework 3.5 SP1

d> MS windows Installer 4.5

e> MS "Geneva framework"

f> MS Synch framework runtime v1.0

g> MS chart controls for MS .NET Framework 3.5

h> MS filter pack 14

i> MS 2008 client utility

2> Once the pre-requsites are installed, executables are downloaded to the local system. Then the Sharepoint Configuration Wizard comes up. Then click on Next which will start the configuration.

It is important to have internet connection on the server as it connects to internet to download the above requirements.









Tuesday, June 22, 2010

Logging of IIS AppPools status for remote servers (Win 2003) using PowerShell

Hi,

I was having a struggle in writing a script which would log the status of the App Pool from across all the remote servers. I tried using two things -

1> ADSI
2> Get-WMIObject

Using the ADSI, I faced issue in which it was not able to access the remote server. It used to say RPC server unavailable. But the same when I tried using Get-WMIObject, it was able to get data from remote server. The catch here was, the Children class was availabe from ADSI but the same was not found using Get-WMIObject . Finally I was able to write the script using the Get-WMIObject.

----------------------

Param(



[string]$global:computer = $env:COMPUTERNAME


,[string]$LogDir = "d:\AppPoolLogging"


,[switch]$doNotRestart


,[switch]$enableLogging = $true


)






function Convert-AppPoolState([int]$value){


switch ($value){


1 {"Starting"; break}


2 {"Started" ; break}


3 {"Stopping"; break}


4 {"Stopped" ; break}


default {"Unknown"}


}


}






Function Write-Log($appPoolName,$message){


$dateTime = Get-Date -format "yyyyMMdd"


$LogFile = "$dateTime.log"


$logPath = join-path $LogDir $LogFile


$output = (Get-Date -Format "yyyyMMdd_HH:mm:ss") + "|" + $computer + "|" + $appPoolName + "|" + $message


$output


If ($enableLogging) {$output | Out-File $logPath -Append}


}






Function Trim-AppPoolName ($appPoolName){
[string]$appPoolName.Substring(15)
}



$computers = Get-Content "c:\computerlistall.txt"


foreach ($computer in $computers)


{



$iis = Get-WmiObject -Namespace root\MicrosoftIISv2 -Class IIsApplicationPoolSetting -ComputerName $computer -Authentication PacketPrivacy


$iis

$i = $iis.Count

 
for ($k = 0; $k -lt $i; $k++)
{



$name = $iis[$k].Name


$ApplicationPoolName = Trim-AppPoolName $name


$state = $iis[$k].AppPoolState


$Status = Convert-AppPoolState $state


Write-Log $ApplicationPoolName $Status


}


}

Monday, June 14, 2010

Installing the SMTP and POP 3 Services on Windows Server 2003

I know this would be real old stuff and many would be aware of these. But I would like to share it with respect to Sharepoint where we have to configure the incoming and outgoing mails. I would like to start from the beginning and provide other steps for configuring mails in sharepoint later. Hope you enjoy the post.

1> Click Start --> Control Panel --> Add or Remove Programs.
2> Click the Add/Remove Windows components button to the left of the Programs list. The Windows component wizard will appear.
3> Select Application Server and then click on the Details button below.
4> When the Application Server Dialogue box appears, Click Internet Information Services(IIS) to select it and then again click on the Details button below.
5> Tick the SMTP service check box and click OK. Then click OK again in the Application Server Dialogue box.
6> Click OK and in the Windows Component wizard dialogue box, tick the E-mail Services check box. Then click the Details button.
7> verify that both the POP 3 Service and POP 3 Service Web Administration is selected and ticked. Then Click OK.
8> In the Windows Components Wizard Dialogue box, click Next to install all the components.
9> If you have your windows 2003 CD, it will call the folder "i386" and then will install all the components. If you dont have the CD, you need to get a copy of that folder and then run the Component which shall install the components requested.

Sunday, April 25, 2010

Clearing SharePoint Configuration Cache

SharePoint stores some of the configuration in a cache on the SharePoint servers instead of makings calls to SQL Server (Config DB) every time inorder to improve performance.
But sometimes, this cache might have old or corrupted data which might cause timer jobs to fail.There would be cases where you want to take out a server from the farm and that doesn't refresh properly. Also there is a possiblity that this issue may come up when we change the service account of the sharepoint farm.

To clear the cache, we need to follow the steps below


Note: This operation will break your farm, if we delete the “GUID folder” or the “Cache.ini file”.
1> On all Servers in the farm, stop the Windows SharePoint Services Timer service (OWSTIMER.EXE). To do this go to the Services Console, right click on Windows SharePoint Services Timer service and click stop.

2> After this go the SharePoint Server running Indexing Server and navigate to “System Drive\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID” in case of Windows Server 2003 or “System Drive\ProgramData\Microsoft\SharePoint\Config\GUID” in Windows Sever 2008.

3> In the folder there is single “cache.ini” & rest all are XML files. Delete all the XML files except for the “Cache.ini file”, make sure we do not delete the “cache.ini”. This is very important, do not even delete the whole GUID folder too, this is also very important. Do not delete the GUID folder or the cache.ini file!

4> Now open the “cache.ini” file and note down the number. Clear the number and type in 1.

5> Click save and close the “Cache.ini” file.

6> Now start the Windows SharePoint Services Timer Service on the Indexing Server from the services console.

We will see all XML files being generated again. We open the Cache.ini and we will see same the number, as you noted down before.

We need to repeat steps 2-6 on all queries servers followed by application/web servers.

Reference -
http://support.microsoft.com/default.aspx/kb/939308?p=1

Friday, April 23, 2010

What is windows server core in Windows server 2008?

When I was installing Windows server 2008 R2 I came across the option where I had to install either Windows Server R2 Full install and other one was Windows R2 Server Core Installation.

Anyone thought what is Windows server core installation in 2008? I did some analysis. let me explain what is this all about.

What is Windows Server Core?
Windows Server Core is a type of install which installs what is needed to make the Hadware a server. The basics to call the hardware a server. We can call this as a "THIN" install.

Whats the difference between the regular install and the server core install?

a> Server core doesnt have a GUI. Command prompt is used for all the tasks.
b> There are no desktop Icons. Notepad, remote desktops access have got GUI.
c> There is no upgrade from windows 2003 to Windows 2008 server core. We need to go for fresh install.

Advantages -

1> Easier to secure,manage and maintain. It has reduced attack surface as less services and less applications are present. reduced management as less parts are present to manage.
2> Lower hardware requirement. So less maintenance overhead. minimum requirement is about 1.6 GB hard drive space, lower processor overhead and lower memory requirement.
3> Supports unattended installations. It can be fully automated.
4> Supports key infrastructure roles like IIS, AD DS, DHCP, DNS, AD LDS etc.

Disadvantages -

1> few roles not compatible with server core.
2> no windows GUI. work to be done using command prompt.  For example, you can open notepad GUI by typing notepad.exe on cmd . Also the datepalce by tping timedate.cpl on cmd.
3> There is not .NET framework or IE on the server.
4> This needs a fresh installation.

Configuring on server core -

using the command on the command prompt -
start /w ocsetup

This command will help you inconfiguring roles, AD DS, IIS etc.

Monday, March 22, 2010

Killing a process consuming more memory using PowerShell

There would be performance issues coming up in a server where we find that the server memory is being consumed by unnecessary processes. In order to prevent its unnecessary memory consumption, We can use the below powershell script which shall kill the process that consumes 100000000 KB of memory.

$computer = "mymachine"

$a = Get-Process -ComputerName $computer
$objs = $a | where-object {$_.WorkingSet -gt 100000000}
$processes = $objs | select {$_.ProcessName}


$i = $processes.Count

for ($k = 0; $k -lt $i; $k++)


{


$obj=get-wmiobject -comp $computer -query "select * from win32_process where name=$processes[$k]"
$obj.Terminate()


}


 Hope this helps....

List of services running on the server using PowerShell

As a systems administrator, there would always be a requirement for us to check if the particular services in the servers are running on that. To fix this, we can use the powershell script which shall give us the list of services running on a particular server and its status. We can also have a list of servers and get the powershell script run which would give details of the services from all the servers, We need to make sure that the account using which you would run this script is an administrator on all the servers on which you want to validate.

The powershell script is

$a = get-wmiobject win32_service -ComputerName "mymachine"

$a | select name,startname,startmode,state

Hope this helps....