Monday, November 2, 2015

Clear SharePoint Configuration Cache Files

Whenever my farm gets out of whack, I'll clear the cache files. A lot of times it helps straighten out issues with search. Below are the instructions I have to clear the files. I've done it on SharePoint 2007, 2010, and 2013. You can clear the configuration cache on one server or all of them in your farm.

I got these fantastic steps from this article http://blogs.msdn.com/b/josrod/archive/2007/12/12/clear-the-sharepoint-configuration-cache-for-timer-job-and-psconfig-errors.aspx

  1. Stop the OWSTIMER service on ALL of the MOSS servers in the farm.
  2. On the Index server, navigate to:                          

Server 2003 location: Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory. 

Server 2008 location: Drive:\ProgramData\Microsoft\SharePoint\Config\GUID and delete all the XML files from the directory.

  1. Delete all the XML file in the directory. NOTE: ONLY THE XML FILES, NOT THE .INI FILE.
  2. Open the cache.ini with Notepad and reset the number to 1. Save and close the file.
  3. Start the OWSTIMER service on the Index server and wait for XML files to begin to reappear in the directory.
  4. After you see XML files appearing on the Index server, repeat steps 2, 3 & 4 on each query server, waiting for XML files to appear before moving to subsequent servers.
  5. After all of the query servers have all been cleared and new .xml files have been generated, proceed to the WFE and Application servers in the farm, following steps 2, 3, 4 and 5 for each remaining server.


Note: if you don't see the ProgramData folder, you have to adjust the settings on the folder to be able to view hidden files and folders.

Friday, October 23, 2015

SharePoint Ports and Protocols

The following is my list of ports and protocols for SharePoint communications between servers based on my experience. Many are optional and rely on how your network is set up. The items can be configured with custom ports.

WFE = Web Front End
APP = App server
Search = Search server
UP = User Profile
AD DS = Active Directory Domain Service
BDC = Business Data Connectivity



Sorry for the image... it was difficult to fit the table on this page, so an image was the best choice I had to be compatible across devices.

Reference:
https://technet.microsoft.com/en-us/library/cc262849.aspx

Wednesday, October 14, 2015

Being a Woman in a Leadership Role

This article is part of a series. You can start at the beginning: Leading Development Teams on Large Projects.

Although this article is about being a woman in a leadership role, I firmly believe that these qualities are essential for any good leader and that you can remove gender from them. I just think there are certain areas that are stronger for a woman and stronger for a man. So the areas we are not as strong in, we just have to hone in on those and build up those skills and then eventually, we all end up on level ground.

There are three areas I want to talk about in this article:
1.       Communication
2.       Decision Making
3.       Be Yourself

Communication

I touched a little on this in the last article, Resolve Team Issues Quickly. A woman’s approach to leadership is slightly different than a man’s. I think most women are in touch with their feelings or at least try to be. We always want to talk things out. It’s in our nature and how we were raised. I think this quality helps in leadership because it helps to get everyone talking – communicating, which seems to be the number one issue that comes up as a problem in IT amongst employees. Don’t get me wrong, I think men are capable of this too, but I think if a man wants to be a good leader, he will probably need to work a little harder fostering good communication skills.

Decision Making

There’s this stereotype of women – we can’t make up our minds. We want the couch on the left, no, the right, maybe if we turn it sideways, no, turn it the other way. Oh, let’s just paint the room a whole different color and maybe that will make the couch work. Yeah, I admit. I’m guilty of that with one exception: I’m not like that at work. This is something I’ve had to work hard at. The ability to make decisions and stick with them is important when you’re in a leadership role. This very important skill can single-handedly diminish all your good intentions as a leader if not done well.

When it comes to making a decision, I first listen to all my teammate’s points of views and their supporting evidence as to why they think it is the best solution. We meet as a group and I listen to each of the suggestions individually and fully. The whole team hears the arguments. A lot of times the team has differing opinions. So it’s up to me to make the final decision. When I make my decision, I center on what is best for the company and our customers first. Then I consider how well will this idea work for long-term maintenance by other developers or architecture-wise as a system. My responsibility as a leader is to be thinking about the big picture. Then I make the decision based on that. I explain to my team why I’ve made that decision. I know that some people may say you don’t need to explain your decisions, but I’m a member of the same team. I feel it’s important to communicate the reasoning behind your decisions. This way, you get your team’s support and understanding, while at the same time you teach them how to make important business decisions if they ever get into a leadership position.
The hardest part is not to waver after the decision is made. To become uncertain in yourself, shows weakness in leadership and to a team that’s full of men, that can lead to a mutiny of sorts – a slow takeover by someone who is strong-minded, but ultimately not the leader. You are the leader for a reason, stand behind your decisions and trust in your ability. Actually, this is true for men too. If you reverse the situation, say instead you have a man leading a team of women. The result will be the same. The women will take the man down at any sign of weakness. The ultimate message is to believe in yourself and stand behind your decisions, no matter your gender.
What about wrong decisions? Sometimes that happens. It’s happened to me before. Your approach just didn’t work out. Admit to the team that the approach didn’t work based on factual reasons. Demonstrate where the decision went wrong. Then, have the answer to what has to happen next. How can we turn it around and make it work? Have the answer in hand already and you will still be considered a good leader. If you can’t think of the answer, consult with your teammates and brainstorm solutions. Then rinse, lather, and repeat the decision making process I outlined above. Remember through the process, it’s a learning opportunity, for you and the team, and you will all make better decisions in the future as a result.
I find that sometimes people new to my team will be doubtful of my abilities, but my ability to make good decisions and use facts to support them usually ends up in turning their opinions around. I’ve heard before that if you’re a man, you don’t have to prove yourself with facts, but I don’t find that to be true in my experience. I think all good leaders have supporting evidence and reasoning to back up their good decisions. If you want to get ahead genuinely, you have to know your stuff whether you’re a man or a woman.

Be Yourself

It sounds simple, but in actuality, we all tend to wear masks when we are at work, school, parties, etc. Think Carl Jung’s Persona mask here. “Because of his more or less complete identification with the attitude of the moment, he deceives others, and often himself, as to his real character. He puts on a mask, which he knows is in keeping with his conscious intentions, while it meets the requirements and fits the opinions of society, first one motive and then the other gaining the upper hand. “[1]

To be fully satisfied in your accomplishments as a leader, you have to do them as yourself with your own beliefs, conscience, and values. My personality is gentle. I am not a harsh, demanding person. I don’t draw hard lines. I am generally happy, kind, and I have a good sense of humor that I use to my advantage. I like to put my team at ease and build a friendly rapport amongst the team. When I work with other teams, I try to understand their point of view. They probably are just as busy as me with just as many obstacles. My approach is very different than a man’s approach to leadership, but it works for me and that is my point. I try to let myself shine through. Consequently, my gentle approach leads to a lot of support by my team members and other teams. They trust that I only have good intentions. I treat everyone as equals and they treat me as an equal too. I can be a woman with my woman ways (in other words, I don’t have to act like a man) and my peers respect me for who I am.

I used to work for a company that didn’t put women in leadership roles, and I truly felt jilted as I saw men promoted above me that weren’t as knowledgeable or didn’t work as hard. But then I realized the truth – I don’t owe that company for any of my accomplishments. I am in control in this situation. There are many other companies that promote a person for their abilities, whether that person is a man or a woman, and all that is left is to seek them out.
 
[1] The Basic Writings of C.G. Jung as translated by R.F.C. Hull. © 1990 by Princeton University Press.

Tuesday, October 13, 2015

Resolve Team Issues Quickly

This article is part of a series. You can start at the beginning: Leading Development Teams on Large Projects.

When your team is first coming together on a project, issues between team members may begin to surface. Not everyone codes the same or has the same values or thought processes. Sometimes things can get heated between team members.  As the Team Lead, you’ll want to nip these issues in the bud as quickly as possible because if you ignore them, they will fester and completely obliterate any good intentions the team has/had. How well your project turns out is a direct reflection on how well you built your team. You absolutely can’t build a successful project if your team can’t work well together.
If there are problems between team members, talk to them individually first and find out what the problems are. Usually when I do this, knowing both sides, I realize there is miscommunication going on. Maybe it’s because I’m a girl and I have an easier time communicating my feelings that I can discern this miscommunication. My next step is to bring everyone in the room together. First, I say what one person’s issue is, then I say what the other person’s issue is. Finally, I point out where the miscommunication I observed is. I do not beat around the bush at all. I think women have a tendency to try not to hurt anyone’s feelings, but men are not like this. They say straight up what’s going on, get it off their chest, then punch each other in the arm and go have a beer together. Well, maybe it’s not exactly like that, but my point is not to be too touchy feely here. Be direct, be honest. I like to ask the troubled parties what their ideas are to resolve the problem and if they have none, I come prepared with my own ideas and ask if those will suffice. Sometimes, they just need a few ideas to springboard their own resolutions.  
At many companies, contractors are hired to supplement teams on projects. I interview my contractors before bringing them on, because if the contractor is the bad apple, the whole team gets spoiled. I trust they have the skillset the vendor says and when I interview them I focus on their personality, sense of humor, and thought processes to ensure they will fit on my team. As soon as they become part of my team, they are “one of us” and it’s up to all of us to deliver a rock-solid project. If issues arise between a contractor and another team member, I follow the same process as above. I treat everyone as an equal team member.
So what about issues that can’t be resolved? Occasionally, there are just team members that don’t play well together. I have a three-strikes-and-you’re-out rule. I will try three times to resolve issues between team members. On the third time, I’ll explain that this is the last chance we have to resolve the conflict. I’ll explain directly and clearly what the consequences are if the issue cannot be resolved. For example, maybe a team member gets removed from a project or depending on the issue, written up. Or in the case of a contracted employee, he gets removed from the company and replaced with a different contractor. I make sure everyone knows exactly what will happen if this final try at resolution doesn’t work so that way it’s no surprise when the consequences come.
< Go back to Assign a "Number 1"

Monday, October 12, 2015

Assign a "Number 1"

This article is part of a series. You can start at the beginning: Leading Development Teams on Large Projects.

In Star Trek: The Next Generation, Captain Picard is head of the ship. He makes all the important decisions, but he can’t be on duty 24x7. That’s where Commander Riker, aka Number 1, comes into play. He is second in command. Both the Captain and crew equally respect and trust his ability to lead in the event Captain Picard is unable to. The same is true in development teams. I lead multiple projects simultaneously. I can’t always be available to all my teams. I do like to take vacations once in a while! For each project team, I assign a “Number 1” – a person the team can trust to lead when I’m not available. If the same team members are on numerous projects, I pick a different “Number 1” for each project. In this way, I can mentor my team members and help them grow their leadership qualities and empower them to move ahead in their career. I keep the person informed of everything I can so he can take over and make informed decisions when necessary. I don’t always tell the entire team everything that happens behind the scenes. There is often a lot of drama and politics that aren’t conducive to productivity so I usually keep that stuff to myself. However, I may share it with my “Number 1” so that if he gets the opportunity to lead in the future, he is not blind-sided by these unavoidable annoyances. I’ll also keep him informed of architectural decisions that may be beyond his skillset. This enables me to teach new skills to my team member and, again, help him grow.

I usually consult with the person before I announce his “Number 1” position to the team because not everyone wants to be in that position. If a person is resistant, I will point out specific qualities I think he has that will make their leadership experience successful. This shows him I know his abilities and that I have confidence in him. He, in turn, gains confidence in himself. If he still doesn’t want the position, I won’t pressure him, but I will approach him again on future projects.
I believe leading a project gives a person valuable insight to being a good team player and consequently builds stronger teams. It also helps to further the person’s career by growing skillset and challenging him to learn more which results in happiness, satisfaction, and a sense of purpose. The result for me as the Project Lead is that my team trusts my ability to make decisions and to support their needs as individuals. Plus, they become my champions to my boss which helps me to further my career at the same time. It’s a win-win situation. This is why I try to give everyone a chance to lead.


Sunday, October 11, 2015

15-Minute Daily Stand-Up Meeting

This article is part of a series. You can start at the beginning: Leading Development Teams on Large Projects.

At my company, we gravitate towards the waterfall development methodology though we do adopt some agile practices. For example, I hold daily stand-up meetings that last only 15 minutes. Sometimes I will hold these meetings over instant message if any team members are working from home, but I always have them. The daily meeting is the most important way to keep everyone informed, hold the team together, and keep progress moving forward. There are three questions I ask each team member at every meeting:

1.       What did you work on yesterday?
2.       What do you plan to work on today?
3.       Do you have any blocking items?

Asking these questions quickly tells me the status of the project, how far along we are. It also tells me if someone is not working on anything and can help another team member out or if I can assign that person a new task. Finally, it tells me if anyone is having problems meeting their goals. As the team lead, this is where I need to step in and find ways to clear any obstacles so the project can move ahead and with the daily meeting, I know the issues as soon as possible. Building trust with your team is largely based on how you perform at removing obstacles, so it is best to act quickly on these items.
Another benefit of this daily meeting is that I can keep the team informed of any important decisions, directions, or changes on the project. Sometimes during long-running projects, upper management or business owners forget what the original goals were, so part of my job as team lead involves continuously reminding management and business owner what the project goals are and the progress the team has made. Sometimes, that’s not enough though and the direction gets changed anyway. The daily meeting enables me to quickly communicate and negate any rumors the team might have heard.
 

Leading Development Teams on Large Projects

At my company, I am the Lead Software Engineer. In addition to leading my team as a whole, I also lead multiple smaller teams broken out by projects. The projects that we are working on right now are very large. One project is running into its second year. The challenge with running large projects is how to keep everyone on track while keeping them motivated to charge ahead. Through this series of articles, I’ll discuss three tools to help successfully lead a development team on large projects with the result that teams bond together and continue to deliver solid software:

2.       Assign a “Number 1”

Finally, I’ll talk a little about being a woman in aleadership role and the challenges it presents. Know, though, that these tips are for anyone, not just women. Good leadership goes beyond gender, but I do think it takes a little effort to help others believe that too sometimes.
I started writing this article with the intention of keeping it all together for one post, but quickly realized there was a lot to say. Therefore, I broke up this article into smaller bite-sized pieces and will release them over the next few days so that it’s easier to stay focused.
Start with the first article, the 15-Minute Daily Stand-UpMeeting.

Thursday, October 1, 2015

Button Won't Postback with IOS 9

I had a problem today where an application with an older code base, ASP.NET 2.0 had compatibility issues in Safari 9. The application was a login application and with the release of Apple's IOS9, the submit button wouldn't postback. Therefore, no users with Apple devices with the new IOS could login.

The key to getting the button to activate was adding a configuration setting to the web.config file to allow the Apple Web Kit version 601:

<system.web>
...
 <browserCaps>
      <filter>
        <case match="AppleWebKit/601">
          EcmaScriptVersion = 1.5
          supportsCallback = true
        </case>
      </filter>
    </browserCaps>
...
</system.web>

After adding this setting, the button works on IOS9 with Safari 9 and users could login again. You can continue to add cases for additional web kits as needed.

Sunday, June 14, 2015

Create a SharePoint 2013 Development Server

Here are some steps to help you build a SharePoint 2013 development box.

Preparation

  1. ISO and Update Files
    1. Copy  SP iso to all servers to your chosen drive in a folder called install\SharePoint. I usually choose a drive other than C:. So in this case we'll use the D: drive.
    2. Copy the following important windows server 2008 R2 updates to d: drive folder called install\WindowsUpdates
      1. The SharePoint parsing process crashes in Windows Server 2008 R2 (KB 2554876).
      2. FIX: IIS 7.5 configurations are not updated when you use the ServerManager class to commit configuration changes (KB 2708075).
      3. Hotfix: ASP.NET (SharePoint) race condition in .NET 4.5 RTM:
        1. Windows Server 2008 R2 SP1 (KB 2759112)
    3. OR if you're using Windows Server 2012, just install the hotfix for the race condition:
        1. Windows Server 2012 (KB 2765317
  2. Turn off UAC
  3. Prerequisites
    1. Mount SP iso and run prerequisiteinstaller.exe. Restart Server.
    2. Mount iso again and in CMD type F: (mounted drive) then type prerequisiteinstaller.exe /continue to continue the installation where it left off.
  4. Updates
    1. Install all the updates listed above for your OS
    2. Restart if asked
  5. Loopback
    1. Run Disable loopback. In Powershell, run the following command as administrator (may have to reboot server) 

      New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck"  -value "1" -PropertyType dword

Install SQL Server 2012

Instead of typing in all the steps here, I highly recommend the article Instruction Guide for Installing SQL Server 2012 SP1 for SharePoint 2013. It is very detailed and very accurate and has lots of pictures to help guide you through.

After you are done installing SQL, you need to set the max degree of parallelism to 1.

Using SQL Server Management Studio configure the max degree of parallelism option by performing the following steps:
  1. In Object Explorer, right-click a server and select Properties.
  2. Click the Advanced node.
  3. In the Max Degree of Parallelism box, select the maximum number of processors to use in parallel plan execution to 1.

Install SharePoint

Now follow these remaining steps. I've kept it to the most simple steps to make it quick and easy.
  1. Install SharePoint 2013
  2. Create Service Apps - I included instructions below on how to use the wizard AND how to install them yourself. This is really personal preference. The service apps I've selected are the bare bones. You can add more as needed for your development efforts.
    1. Quick and easy - When CA opens on the MI server, choose to let the Wizard configure service apps for you. Only check the following service applications:
      1. State Service
      2. Usage and Health Data Collection
      3. Managed Meta Data
      4. Search
    2.  A little harder - Create Service Application - This is my preferred order:
      1. State Service
      2. Usage and Health Data Collection
      3. Managed Meta Data Service
      4. Search
      5. Secure Store
  3. Set up Virus exclusions
  4. Configure Logging
  5. Address SVCHOST.exe memory leaks by Disabling the Windows Update Service
  6. Address Noderunner memory leaks
  7. Install SharePoint CUs to match your production environment. Be sure to reboot your dev server and run the SharePoint config wizard after install.

    See SharePoint 2013 Build Numbers by Todd Klindt for a comprehensive list of SharePoint updates. My rule of thumb is that I don't install any hotfixes unless I have a serious problem. I'll update CUs about 3 months behind the current date again, if I'm having issues. For example, my farm had many distributed cache issues and so I installed the September 2014 CU which helped greatly. It took a bit of reading through all the CU information to find which CUs were somewhat stable though. I'd be more inclined to install Service Packs, but again waiting for some months to let any bugs get noted first.
  8. Install AppFabric CU

Configure Managed Service Account

In Central Admin > Security > Manage Service Accounts
Add your account as a managed account. DO NOT select to enable automatic password change.

Change the Farm Account

If your company has a password policy to change the password every so often, you may want to change your dev instance to run under a local farm account. This way you don't have to change the password of the farm account all the time. This is just a personal preference on your part. See my article on how to Change the Farm Account on a Dev Box for instructions if you want to do that.

    Sunday, June 7, 2015

    Change Farm Account on Dev Box

    Below are the steps to change the SharePoint farm account on your development server to a local user.

    Start by creating a local user on your server.

    Add New User
    Open Computer management on your server. Go to Users and Groups. Under Users > Actions > Add new user



    Add User as Local Administrator
    Under Groups > Administrators > Add
    Type <computer name>\spfarm and check names. OK. Apply. OK. (use a password you’ll remember)
     
     
      
    Update Additional Security Groups
    Add permissions as below:
    • WSS_WPG – add the new farm account
    • WSS_ADMIN_WPG – add the new farm account

    Add Yourself as a Farm Administrator
    In Central Admin > Security > Manage the farm administrators group
     
    Make sure your name is listed. If not, add it.
     
     
      
    Add Local Account as Managed Account
    Right click on SharePoint Management Shell and choose to Run as Administrator.
     
    Type the following cmdlet:
    $cred = Get-Credential
     
    When you get a prompt, type in the local account you made <computer name>\spfarm and enter the password.
     
    Now type the cmdlet:
    New-SPManagedAccount –Credential $cred
     
     
      
    In Central Admin > Security > Configure Managed Accounts. You will see your newly added account.
      
    Update Farm Account
    Run Command Prompt (CMD) as admin.

    Navigate to the BIN folder by typing the following two lines:
    cd C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN
    STSADM.EXE -o updatefarmcredentials -userlogin "<computer name>\spfarm" -password "<password>" 

    Reset IIS
    Run following command in CMD (as administrator - you should still have this window open from before):
    iisreset /noforce


    Configure App Pools
    Open IIS. Change Identity of the highlighted app pools below to the <computer name>\spfarm account.




      
      
    Configure Services Account
    Go to Services. Update or verify the following services are using the spfarm account. To update, right click the service and choose properties > Log On tab > Browse. Enter <computer name>\spfarm and click Check Names. Enter password. Apply, OK.
    • AppFabric Caching Service
    • SharePoint Search Host Controller
    • SharePoint Server Search 15
    • SharePoint Timer Service
    • SharePoint User Code Host
    Restart each service.
     
     
     
     
      
     
    Reset IIS
    Run cmd prompt as administrator (switch back to CMD) and type the following command:
    iisreset /noforce


    Update Search Service App
    In CA, go to Manage Service Applications > Search Service Application. Click on the Default content access account link.

    Change the Default content access account to new spfarm account: <computer name>\spfarm
     

    Sunday, May 31, 2015

    SharePoint 2013 PSConfig Wizard Stuck after Upgrade

    Occasionally after an upgrade such as a service pack or CU, the SharePoint Products Configuration Wizard (PSConfig) can get stuck. It may happen on one or more servers in your farm. In my case, it happened on my dev box on step 9. Here are the steps to get things moving again. On the server with the issue perform the following:
    1. Terminate the PSConfig task through the Task Manager.
    2. Go to Administrative Tools > Services. Stop the SharePoint Timer service.
    3. Clear the config cache
      1. In Explorer, go to C:\ProgramData\Microsoft\SharePoint\Config
      2. Delete all files EXCEPT the cache.ini file
      3. Open the cache.ini file, change the number shown to 0 and save
    4. Start the SharePoint Timer service
    5. Wait for the cache files to populate again
    6. Open SharePoint Management Shell as an administrator and run the command:

      Psconfig.exe -cmd upgrade -inplace b2b -wait -force

    Now in Central Administration and navigate to Upgrade and Migration > Check Upgrade Status. You can verify the upgrade completed successfully.


    Sunday, May 24, 2015

    Create a SharePoint 2013 Farm

    If you are clever, you may have noticed there is order to my previous posts. This is by design. I've been guiding my readers through a step-by-step process of setting up a SharePoint 2013 farm. I know, I'm tricky sometimes!

    I did this not only for my readers, but also for myself. I have a terrible memory and so this blog helps me to keep my notes in order. Here is the culmination of all my latest blogging efforts in the order needed to build a SharePoint 2013 farm.

    1. SharePoint 2013 Farm Checklist
      Use this to gather all your necessary information, accounts, and files for your farm.
    2. Turn off UAC on all servers
      This step is very necessary to ensure no hiccups for your install!
    3. Install Prerequisites
    4. Install the Windows updates you gathered (in the checklist)
    5. Disable Loopback
    6. Set up a SQL Alias
    7. Install SharePoint 2013
    8. Configure Managed Accounts
    9. Create Default Service Application Pool
    10. Create Service Application - This is my preferred order:
      1. State Service
      2. Usage and Health Data Collection
      3. Managed Meta Data Service
      4. Search
      5. Secure Store
    11. Set up Virus exclusions
    12. Configure Logging
    13. Set Up IIS Headers
    14. Set up Cache accounts super user and super reader accounts: http://technet.microsoft.com/en-us/library/ff758656(v=office.15).aspx
    15. Address SVCHOST.exe memory leaks on all servers by Disabling the Windows Update Service
    16. Address Noderunner memory leaks
    17. Remove distributed cache from app servers
    18. Configure SMTP for outgoing email: http://technet.microsoft.com/en-us/library/cc263462(v=office.15).aspx
    19. Install SharePoint CUs. Be sure to reboot every server in the farm and run the SharePoint config wizard.

      See SharePoint 2013 Build Numbers by Todd Klindt for a comprehensive list of SharePoint updates. My rule of thumb is that I don't install any hotfixes unless I have a serious problem. I'll update CUs about 3 months behind the current date again, if I'm having issues. For example, my farm had many distributed cache issues and so I installed the September 2014 CU which helped greatly. It took a bit of reading through all the CU information to find which CUs were somewhat stable though. I'd be more inclined to install Service Packs, but again waiting for some months to let any bugs get noted first.
    20. Install AppFabric CU
    And that's it! 20 "simple" steps to  install SharePoint. Ok, I know it's not simple, but it's not too bad when you have it all organized. Good luck!

    Sunday, May 17, 2015

    Distributed Cache and AppFabric Update in SharePoint 2013


    Distributed Cache problems have been prevalent on SharePoint 2013. To try to circumvent these issues, you should do an AppFabric update on all your servers as part of your initial SharePoint 2013 installation.

    In the past, cache updates for SharePoint would be included as part of SharePoint patches. This time around, cache is separated from SharePoint in AppFabric updates. So add that to your list of patches to watch when you are updating SharePoint 2013.

    Stop the Distributed Cache Service

    If your SharePoint is in production, you should stop the distributed cache service first on the server you will update. Then the cache will move to another one of your servers set up with distributed cache. You may want to check out my post The number of Distributed Cache hosts in the farm exceeds the recommended value (SharePoint 2013) to see where your cache should be set up.

    To stop the cache on a server, run SharePoint management shell as an administrator and run the following commands:
    asnp *sharepoint*
    Stop-SPDistributedCacheServiceInstance -Graceful

    Install AppFabric CU

    Now you're ready to install the latest AppFabric patch. At the time of this writing, they were up to CU5 – KB2932678. This install is easy, just follow the directions.

    Update DistributedCacheService.exe.config File

    Next you need to update the DistributedCacheService.exe.config file. This is due to an update that was released in CU3 – KB2787717. You wouldn't know you needed to update the config file unless you read all the write-ups on all the CUs. A new background garbage collector was implemented in this CU. The config file is located at C:\Program Files\AppFabric 1.1 for Windows Server folder and the update is:

    <configuration>
      ...
      <appsettings>
        <add key="backgroundGC" value="true">
      </add>
    </appsettings>
    </configuration>
    

    Start Distributed Cache Service

    Now your ready to start the Distributed Cache service again:

    $instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Distributed Cache" -and $_.Server.Name -eq $env:computername}
    $instance.Provision()

    Lather, Rinse, Repeat

    Now, do this on all your distributed cache servers one at a time.

    Still Not Working?

    For some people, this is enough and the service will work again. This didn't quite do it for me. I had to actually unprovision the distributed cache service and reprovision it again to it to work. Here are the steps to do that:
    $instance = Get-SPServiceInstance | ? {$_.TypeName -eq "Distributed Cache" -and $_.Server.Name -eq $env:computername}
    $instance.Unprovision()
    Then provision it again:
    $instance.Provision()

    References
    http://www.wictorwilen.se/how-to-patch-the-distributed-cache-in-sharepoint-2013
    http://msdn.microsoft.com/en-us/library/ee790928(v=azure.10).aspx

    Sunday, May 10, 2015

    The number of Distributed Cache hosts in the farm exceeds the recommended value

    The error "The number of Distributed Cache hosts in the farm exceeds the recommended value" shows in your SharePoint 2013 Health Analyzer after an initial install of SharePoint. This is because the default is to enable the distributed cache on all servers in the farm. Really, you only need distributed cache on your Web front ends The solution is to removed distributed cache from all your application servers such as your Central Admin and Search servers.

    1) Run SharePoint 2013 Management Shell as your install account because it needs a high level of permissions to perform this action.

    2) On your app servers only, run the following cmdlet:

    Remove-SPDistributedCacheServiceInstance

    Resource:
    http://technet.microsoft.com/en-us/library/jj891124(v=office.15).aspx

     

    Sunday, May 3, 2015

    Noderunner Memory Leaks


    In addition to the svchost.exe memory leak issue I mentioned in my last article, I also noticed memory leaks for the noderunner. In searching the Web, I discovered this is a fairly common issue with SharePoint 2013. I've made this step a part of my SharePoint 2013 deployment. Below are the steps to resolve the issue:

    The node runner application used by SharePoint 2013 preview for search related process slows down the system due to memory leak issues.

    1. Open SharePoint Management Shell and type the following cmdlet:

    Set-SPEnterpriseSearchService -PerformanceLevel Reduced

    2. Open the config file at C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config and change the value of  memoryLimitMegabytes to 200. This sets the maximum limit for memory use.

    I found anything less than 200 caused search to fail on my farm.

    3. Restart the SharePoint Server Search 15 service.

    Sunday, April 26, 2015

    Disable Windows Update Service

    In my SharePoint 2013 farm, I was seeing the svchost.exe taking up a lot of memory directly affecting the performance of my site.

    There's a great article on How to Troubleshoot svchost.exe Issues to determine what service is the culprit of your memory leak. In my case, it was the Windows Update Service. Since my Windows Updates are controlled by a group policy, I decided to disable this service which solved my performance issues.

    Go to Start > Administrative Tools > Services. Right click the Windows Update service. Under Startup type, selected Disabled.

    Sunday, April 19, 2015

    Set Up an IIS Response Header

    If you have a test or staging environment, it is helpful to set up a response header if you have multiple Web front ends (WFEs). Then you can easily determine which server the error is on through your browser's developer tools, Fiddler, or an equivalent.

    Open IIS 7, click on your site. In the Features View, double-click on HTTP Response Headers icon.



    Now click on the Add link in the right navigation pane. For Name, enter something that is meaningful to you. In my example, I chose ServerName. For Value, type in the details. I entered WFE1 in the example below. You don't need the whole server name, just some hint that will quickly identify the server.



    Using Fiddler, you can easily see the result under the Headers tab.



    Be Concerned About Security

    Something to keep in mind is that it's never a good idea to give away too many details about your server so never identify your server names in a production environment. This is just very easy way to help troubleshoot.

    SharePoint in Practice

    Where SharePoint is considered, when you get an error you always are given a correlation ID. If you know which server you are on, you quickly know which server to check the logs on. In a multi-server farm, this can save a lot of time.
     

    Sunday, April 12, 2015

    Configure Logging for SharePoint 2013

    All log files can become large. If you get a major error that fills up log files quickly, a consequence is your disk space can fill up and cause your SharePoint site to crash. So avoid this issue (and keep your system administrators happy) by moving all your log files to an external drive. This process applies to both SharePoint 2013 and SharePoint 2010.

    Configure your logs to an external drive (anything other than C:). I'll use a D: drive in my example. I like to create a LOGS folder and underneath create separate folders for all my key logs.

    IMPORTANT! Make sure you configure the same folder structure on the same drive on all your servers in your farm.

    Here’s the folder structure I use:
    • LOGS
      • Trace
      • Usage
      • IIS

    SharePoint Logs

    Trace Logs

    In Central Administration, go to Monitoring > Configure diagnostic logging. Near the bottom on the screen, update the Path to your external drive location such as D:\LOGS\Trace\.


    Usage Logs

    In Central Administration, go to Monitoring > Configure usage and health data collection. Under Log file location, update the path to your external drive location such as D:\LOGS\Usage\.


    IIS Logs

    In IIS under the server name, click Logging. Update the directory location. Staying consistent with my example, I would update the location to D:\LOGS\IIS\. You’ll have to do this step directly on all servers in your farm.

    That’s it! Now all your log files are easily found in one location and they won’t cause your SharePoint to crash if the logs fill up.

    Sunday, April 5, 2015

    Virus Protection and SharePoint Exclusions

    Servers with virus protection software such as Symantec or McAfee can sometimes cause problems for SharePoint. It is important to exclude certain key folders for SharePoint. If the content in these folders became quarantined, whammo! All of SharePoint is down. This holds true for all versions of SharePoint.

    Now you don't really want to exclude folders entirely in a production environment. That would be silly. You still need protection. So in production, just be sure to disable on-access scanning. In a test environment, you can exclude these folders from all scans. Terminology may vary by virus protection software.

    The key folders are:
    • C:\Program Files\Microsoft Office Servers
    • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions
    Additionally, on your search server exclude your index folder. You can find your search index location through this sp shell script:

    $ssa = Get-SPEnterpriseSearchServiceApplication
    $ssa.AdminComponent.IndexLocation

    Sunday, March 29, 2015

    Create Secure Store Service

    To create a secure store, in Central Admin go to Application Management > Manage Service Apps. Choose New from the menu and select Secure Store and fill in the following information:
    Go to Central Admin > Application Management > Manage services on server and start the service.
     
    Now go to Central Admin > Application Management > under Manage Service Apps, click Secure Store (top one).
    • Choose to generate a new key
    • Passphrase: PickYourOwnPassphrase

    Sunday, March 22, 2015

    Create Search Service Powershell

    I've not had my search service creation go smoothly for me yet. But the good thing is that I created and deleted the search service numerous times without things going too wrong.  Below is a script I found online mixed with information from Professional SharePoint 2013 Administration and a minor tweak of my own to allow for creation in a farm, not just a local install.

    Create Search Service

    IMPORTANT! You must run this script on the server in your farm that you want search to be installed. Use your install account to create the search service.

    # Get App Pool
    $saAppPoolName = "Default SharePoint Service App Pool"
    
    # Search Specifics, we are single server farm
    $searchServerName = (Get-ChildItem env:computername).value
    $serviceAppName = "Search Service Application"
    $searchDBName = "SearchService_DB"
    
    
    # Grab the Appplication Pool for Service Application Endpoint
    $saAppPool = Get-SPServiceApplicationPool $saAppPoolName
    
    # Start Search Service Instances
    Write-Host "Starting Search Service Instances..."
    Start-SPEnterpriseSearchServiceInstance $searchServerName
    Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $searchServerName
    
    # Create the Search Service Application and Proxy
    Write-Host "Creating Search Service Application and Proxy..."
    $searchServiceApp = New-SPEnterpriseSearchServiceApplication -Name $serviceAppName -ApplicationPool $saAppPoolName -DatabaseName $searchDBName
    $searchProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name "$serviceAppName Proxy" -SearchApplication $searchServiceApp
    
    # Clone the default Topology (which is empty) and create a new one and then activate it
    Write-Host "Configuring Search Component Topology..."
    $clone = $searchServiceApp.ActiveTopology.Clone()
    $searchServiceInstance = Get-SPEnterpriseSearchServiceInstance -Local
    New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
    New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
    New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance 
    New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance 
    New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
    New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
    $clone.Activate()
    
    Write-Host "Search Done!"

    In Central Admin > Application Management > Manage Service Applications. Click on the search service and change the default content access account to sp_content.

    Move the index

    It's a good idea to move your index off your C: drive so it doesn't take up all your space. The example below moves the index to the D: drive.

    I found the script Move-SPEnterpriseSearchIndex.ps1 to move the index. Run this script and then alter the last line to something like this:

    Move-SPEnterpriseSearchIndex -SearchServiceName "Search Service Application" -Server "SERVERNAMEHERE" -IndexLocation "D:\SearchIndex"


    Sunday, March 15, 2015

    Create Managed Meta Data Service in SharePoint 2013

    The Managed Meta Data service is required for User Profile and search. It's easiest to do this service through Central Admin. Go to Central Admin > Application management > Manage service applications.
    1. Click New button and choose Managed Meta Data Service
    2. Fill in details
      1. Name: Managed Metadata Service
      2. SQL Database Name: Managed_Metadata_Service_DB
      3. use default app pool
    3. Start the service
    4. On the Manage service applications screen, click on the second line for the Managed Meta Data service - just to the right of the name and click the properties button.
    5. Select "This service app is the default storage location for column specific term sets". This makes it so you can use the term set for navigation.

    Sunday, March 8, 2015

    Create Usage and Health Data Collection Service Powershell

    Below is the Powershell script to create the Usage and Health Data Collection service for SharePoint 2013.

    New-SPUsageApplication -Name "Usage and Health Data Collection"
    $proxy = Get-SPServiceApplicationProxy | where {$_.TypeName -eq "Usage and Health Data Collection Proxy"}
    $proxy.Provision()

    Now to start the service. Go to Central Admin >  Application Management > Service Applications > Manage services on server. Find the Usage and Health Data Collection service and start it.

    Sunday, March 1, 2015

    Create State Service Powershell

    Below is the Powershell script to create the State Service for SharePoint 2013.

    New-SPStateServiceApplication -Name "State Service Application"
    Get-SPStateServiceApplication| New-SPStateServiceApplicationProxy -defaultproxygroup
    Get-SPStateServiceApplication| New-SPStateServiceDatabase -Name "State_Service_DB"
    Get-spdatabase | where-object {$_.type -eq "Microsoft.Office.Server.Administration.StateDatabase"} | initialize-spstateservicedatabase

    Now to start the service. Go to Central Admin >  Application Management > Service Applications > Manage services on server. Find the State Service and start it.

    Sunday, February 22, 2015

    Create Default Service Application App Pool

    Before you create your service applications in SharePoint 2013, you'll want to create a default service application app pool. Once it is created, you'll assign this app pool account to your service applications.
     
    Open SharePoint Management Shell and run as Administrator. Type in the cmdlet:
     
    New-SPServiceApplicationPool -Name "Default SharePoint Service App Pool" -Account DOMAIN\sp_serviceapps 

    Wednesday, February 18, 2015

    Set SMTP Message Size


    We set up a new incoming email list on our SharePoint 2010 site and allowed it to receive attachments. We tested the email worked correctly and the list could receive the emails with attachments. However, when end users attempted to email a large attachment, they received the following message:

    "This message exceeds the maximum message size allowed. Microsoft Exchange will not try to redeliver this message for you. Please make the message smaller -- by removing attachments, for example -- and try sending it again, or provide the following diagnostic text to your system administrator."

    The Web application was set to allow for 1024 MB for uploads which was plenty large enough for our use. Also, the list settings were set correctly to allow attachments.

    The issue turned out to be the settings on the SMTP side. To fix it, go to IIS 6.0:
    1. Expand the server name and right-click on SMTP Virtual Server.
    2. Select the Messages tab
    3. Adjust the settings according to your allowable limits

    Sunday, February 15, 2015

    Configure Managed Accounts in SharePoint 2013

    When you create your SharePoint 2013 farm, you'll want to set up some Managed Accounts. These are the accounts you'll need:

    In Central Admin > Security >  Configure Managed Accounts > Register Managed Account
    • Service App account:  DOMAIN\sp_serviceapps 
    • Web app account:  DOMAIN\sp_webapp
      

    Sunday, February 8, 2015

    SharePoint 2013 ISO Install

    Below are the steps to install SharePoint 2013 from the ISO. I've kept the steps very simple and limited only to the actual install of SharePoint 2013 using NTLM. All the items that are in italics are personal choice for the installer. I left in the details as examples.
    1. Install SharePoint first on the Central Admin server
    2. Choose Setup from SharePoint ISO and use the Config Wizard 
    3. Create a new Complete Server Farm
    4. SQL info
      1.  Enter SQL alias name SQL (see Set Up a SQL Alias for SharePoint 2013)
    5. Enter the configuration database name SP2013_Config
    6. Enter your farm service account DOMAIN\sp_farm
    7. Enter the farm account's password
    8. Enter a Passphrase ThisIsMyPassphrase
    9. Choose a port or leave the entry selected for you.
    10. NTLM
    11. When Central Admin opens on the server, choose No I will configure myself.**
    12. If you have a multi-server farm, then on all remaining servers
      1. Install SharePoint and go through the Config Wizard.
      2. Use passphrase to connect to farm
    ** If you are creating a development box, you can allow the wizard to set up the services you want to use to make it easy on yourself. Just depends on your preference. You can select to configure your own services if you want. The bare bones services to select are:
    • State Service
    • Usage and Health Data Collection
    • Managed Meta Data
    • Search
    That's it. It's pretty easy to actually install SharePoint 2013. The hardest part is actually getting everything ready for the install.

    References
    http://technet.microsoft.com/en-us/library/cc262957(v=office.15).aspx

    Sunday, February 1, 2015

    Set Up a SQL Alias for SharePoint 2013


    When I build all my SharePoint farms, I always set up a SQL alias. A SQL alias is similar to setting a host file in that you provide a name for your SQL instance and then you can change the actual source of that instance to anything. This is helpful if your SQL has to change servers for any reason. Your install will use your alias pointed to wherever you set it.

    This works for both SharePoint 2013 and SharePoint 2010.

    To set up a SQL alias, simply go to your start icon and choose the Run program. Type in cliconfg and OK. Cliconfg pops up.
     
    On the General tab, enable TCP/IP. Switch to the Alias tab. Select the TCP/IP radio button and in the ALIAS text field type the name you want to use for your SQL. I usually just use SQL. In the Server Name field, type the actual name of your SQL SharePoint server.
     
    When you create your SharePoint farm and the install asks you for your SQL name, all you have to do is enter SQL (or whatever name you used). Now you can change the SQL source anytime you need to without affecting your farm.

    Sunday, January 25, 2015

    Disable Loopback a Best Practice for SharePoint 2013

    When you install SharePoint, there is an issue using Integrated Authentication for a Web site that is mapped to a local loopback address. Your method of remediation depends on whether the environment is production or test.

    Production

    1. Set the DisableStrictNameChecking registry entry to 1.
    2. Click Start, click Run, type regedit, and then click OK.
    3. In Registry Editor, locate and then click the following registry key:

      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
    4. Right-click MSV1_0, point to New, and then click Multi-String Value.
    5. Type BackConnectionHostNames, and then press ENTER.
    6. Right-click BackConnectionHostNames, and then click Modify.
    7. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK. Enter hostnames as myhostname.domain.com on a separate line for each site in your farm.
    8. Quit Registry Editor, and then restart the IISAdmin service.

    Test

    This method can expose a security risk to your SharePoint farm, so be sure to only do this method in a test or development environment.

    Open PowerShell and Run as Administrator. Type in the cmdlet:

    New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck"  -value "1" -PropertyType dword

    Reboot the server.

    References

    Sunday, January 18, 2015

    Install SharePoint 2013 Prerequisites

    Microsoft has made it very easy to install your server prerequisites for SharePoint. This holds true for SharePoint 2010 and SharePoint 2013.
    1. Login to your server with your install account.
    2. Mount your ISO file. I use Virtual Clone Drive and it mounts to the F: drive.
    3. On your mounted drive, run the prerequisiteinstaller.exe file and it will start installing the prerequisites.
    4. You will have to restart the server periodically when it tells you to.
    5. After each restart, mount the ISO again and in a CMD prompt type F: (mounted drive) to change the drive and then type prerequisiteinstaller.exe /continue . This will continue the installation where it left off. 
    Do these steps on all servers in your SharePoint 2013 farm.

    Sunday, January 11, 2015

    Turn Off UAC

    It's easier to install SharePoint if you turn off UAC. It's not too difficult to do and it is preferred if you have created a script to automate your SharePoint install. Below are the steps:

    Windows Server 2008

    From your start menu, choose Run. Type in msconfig. The System Configuration window pops up.


    Choose Change UAC Settings and click the Launch button. The UAC Settings window pops up.
    Slide the bar down to Never Notify and click OK. You may need to reboot your server for the settings to take place.

    Windows Server 2012

    Turning off UAC in Windows Server 2012 is a little more involved. The first part is the same as listed above. After that, a registry change is required to fully disable UAC. I could not install my SharePoint CUs with the UAC not fully disabled.
    1. From start menu, choose Run and type msconfig. 
      1. Choose Change UAC Settings and Launch the program.
      2. Slide the bar to Never Notify.
    2. From start menu, choose Run and type in regedit.
      1. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
      2. Change the DWORD "EnableLUA" from 1 to 0
    3. Reboot Server

    Sunday, January 4, 2015

    SharePoint 2013 Farm Prep Checklist

    I’ve built a few SharePoint farms now. My memory is not the best so I put together this checklist to help me remember what I need to do even before I install SharePoint. There's lots to do before you can even think about installing SharePoint. Plus, depending upon your company structure, you may need help from many different teams that handle Exchange, Firewall, Database, DNS, and System Administration.

    Below is the list I put together of things to do to build a production install of SharePoint. It suits my needs for my environments. Use it as a starting point. You can add steps or remove them depending upon your situation. If you have any suggestions on items to add, please comment below. I've  listed SharePoint 2013 for this list, but really this list translates well to any version of SharePoint.

    Service Accounts

    Hardware/Servers

    To add users to local administrators, open up Server Manager > Configuration > Local Users and Groups > Groups > Admins.

    NOTE you can do this all from one server. Right click on server name in server manager and choose Connect to...

    Software

    ISO Files

    • Obtain SharePoint 2013 ISO
    • Obtain SQL Server 2012 ISO
    • Copy  SharePoint ISO to all servers to an external drive in a folder called install\SharePoint

    Updates

    • Copy the following important windows server 2008 R2 updates to an external drive folder called install\WindowsUpdates
      • Windows Server 2008 R2
        • The SharePoint parsing process crashes in Windows Server 2008 R2 (KB 2554876)
        • FIX: IIS 7.5 configurations are not updated when you use the ServerManager class to commit configuration changes (KB 2708075)
        • Hotfix: ASP.NET (SharePoint) race condition in .NET 4.5 RTM - Windows Server 2008 R2 SP1 (KB 2759112)
      • Windows Server 2012  (KB 2765317

    Firewall

    DNS 

    • Load balanced VIP needed between External WFEs
    • Load balanced VIP needed between Internal WFEs
    • Hostname required for MySites (CNAME). Must have this for User Profile service!!
    • Hostname for website via CNAME

    SQL

    • Make sure parallelization is set to 1
    • Set ram to max allowed
    • Set model db to simple in TEST only
    • Give sp_install account public, dbcreator, and securityadmin SQL roles

    SMTP

    • Add external WFEs to whitelist for SMTP server
    • Add internal WFEs to whitelist for SMTP server