SharePoint Musings for the Mind
Wednesday, July 17, 2013
"Minnesota Nice"
Tuesday, June 11, 2013
SharePoint 2013 Search Topology Creator
Have you built a new SharePoint 2013 search topology lately? If you have you will notice that is all done via PowerShell. There are also some rules around how we create a new topology and how we add and remove existing components. For anyone who is not ready to dive deep into PowerShell you can use the following walkthrough to auto-provision your Search topology.
First, lets take a look at the 6 core components that support SharePoint search:
- Admin
- Crawler
- Content Processing
- Analytics Processing
- Query Processing
- Index
When creating a new topology you need to create the topology either ‘brand new’ or clone from existing. Next, you add your components and/or remove existing components and finally Activate. Another thing to keep in mind is that you may have to modify your topology down the road. This script can help you do just that.
The script below is two-fold. The first part is a 2013SearchConfig.xml file that contains the configuration for your new topology. This XML configuration is below.
<SearchTopology>
<admin>
<servers Name="WFE1" remove="false"/>
</admin>
<crawler>
<servers Name="WFE1" indexLocation="D:\SP\Searchindex" partition="0" remove="false"/>
</crawler>
<servers Name="WFE1" remove="false"/>
<content>
<servers Name="WFE1" remove="false"/>
</content>
<analytics>
<servers Name="WFE1" remove="true"/>
</analytics>
<query>
<servers Name="WFE1" remove="false"/>
</query>
<index>
<servers Name="WFE1" remove="false"/>
</index>
</SearchTopology>
Using the configuration above the new cmdlet will automagically build your topology. The features are included are:
- Adding new components to your topology on ANY server in the Farm
- Removing any component from any server in your topology
- Activate the new topology
Adding a component
If we look at the config we notice that one Admin component is being added to the first front end server called WFE1. If this server does not currently host an Admin component already, the script will automatically clone the topology, add the component and activate. No intervention is required.
If the server already has a component of the same type installed the script will prompt you to ensure you want to add a new component as shown below.
This helps when you are looking to scale your topology.
Removing a component
Looking at the above example configuration file we notice that we also want to remove the analytics processing component off of the WFE1 server. When the script runs it is first going to create the new topology with any NEW components. It will then remove any components that you have requested. If you have told the script to remove a component you will see the prompt below:
As you can see it returns any components in that category in a 0-Based array. You select your component to remove and continue. I have entered 0 to delete the first component in the list.
NOTE: I had to run the command again and caused the order to change so my screenshot is off due the nature in which PowerShell brings in the results. I am adding in some sort abilities to keep the experience consistent.
Wednesday, May 22, 2013
XBOX One
I know, it is off topic, but Microsoft released the new Xbox One yesterday. The overall design of the unit it very sleek and will look great in any living room. The specs of this unit are very comparable to their rival with the addition of an HDMI input. The Xbox One was designed to be a ‘connected’ console that will help reinvent the way you interact with everything in your living room. Games, TV, streaming, music, the Xbox One connects to each and allows you to control them via voice and new defined gestures.
Let’s talk about voice control for a minute. How feasible is this? I love the idea of telling my Xbox what to do but I have two kids running around the house. When am I going to be able to get a word in without the Xbox hearing all the other noise? Nice feature but I think the use will be limited. Most will rely on the new Kinect gestures as well as using the new control.
I have been building media center computers based on the Windows platform since 2006. One of the biggest hurdles is that you had to have cable. Even the best TV tuner cards could not accept a DirecTV or DISH signal. The Xbox one shows promising strides in this area but they didn’t go into detail about what the Xbox One would support. If you cannot hook up an HDTV satellite provider I would call this launch a bust. A majority of subscribers will have satellite TV and without the ability to control it with the new Xbox One, it won’t be replacing living room units anytime soon.
Economies of scale. A term that Microsoft has been using since jumping ‘all in’ to the cloud. The Xbox One leverages cloud technology to make your music, movies, games and more available from anywhere is the world. Does that mean you must have a broadband connection to use Xbox One? Probably. Microsoft would not make this kind of investment to a device that will be used offline. After all, one of their primary themes around the launch was being ‘connected’. Not only to the internet but to other devices as well. Microsoft has scaled their new Xbox Live system to over 300k servers. Surpassing the capacity of the internet in 1999. That is no small feat and shows Microsoft’s commitment to the next generation of gaming and home entertainment.
The advances in the new Kinect technology look promising as well. The ability for your console to pick up your every move seams a bit scary but it also creates virtually limitless possibilities. Creating new virtual worlds where your character can live and interact with thousands of people around the world. Interacting with games in new ways and utilizing your console for entertainment, relaxation, exercise and learning all with voice control and hand gestures.
A topic that is not thought of often is security. Do these units have same type of anti-virus or IDP system built in? An always on device that has a high definition camera into your personal life seem to be a great target for hackers and e-peeping toms. We continue to stay connected but without the risk of exposing our lives to the world. Something eerie about that Kinect optic staring you in face all the time and not knowing who ‘may’ be on the other end.
With each release we move closer to a real life Minority Report and I am excited to get the new Xbox One! I have never been an early adopter of consoles, or a big gamer, but this will be the unit I have in my living room on day 1!
Monday, May 20, 2013
TechEd 2013
TechEd 2013 is right around the corner. I will be hopping a plane from ‘sunny’ Minneapolis to ‘Hot and Muggy’ nawlans (New Orleans) I am very excited to get my session list put together and see some good SharePoint material. I will be blogging and tweeting along the way so be sure to follow me @kameronberget.
Friday, May 17, 2013
Custom User Profile data from external LOB system
Scenario:
We want to pull in additional social data for our user’s that displays their current Facebook and Twitter handle and web address. We will utilizing the following:
- User Profile Service Application
- Custom properties in the UPA
- Twitter Handle
- Twitter Page
- Facebook Page
- User Profile Sync
- SharePoint Designer ECT (External Content Type)
- Business Connectivity Service Application
From SharePoint Designer create a new external content type and call it whatever you would like. I have called mine EmployeeSocialData.
Next we will add external data to this ECT. In this case we are using a direct SQL connection. However, you could chose to use a WCF service to retrieve your data. As you can see below we are utilizing a Secure Store ID to connect to our data. For this example I have mapped my farm creds this ID.
We need to create the Read List and Read Item operation on the table SocialData. You will notice that I did not have to change anything when configuring my List/item read operations. This is because I declared the userName column in my SQL table as the primary key. SharePoint uses that column as the identifier. If your table does not have this setup you need to manually configure which field will be your identifier.
NOTE: The identifier will be the filed that the User profile Service will use to create a relationship and return employee data. This will be shown in later steps.
Once we create the ECt it will show in our BDC Service App as shown below.
We need to setup the object permissions to allow the SP Farm account to query and pull data from the ECT. In this case I am allowing a single user. Because the SPFARM account is doing to call I give the SPFARM execute permissions. I also have to give an account the Set Permissions permission to advance this screen.
TIP: To test whether or not your ECT is working correctly, use designer to create a list based on the ECT. You can do this via the ribbon.
Now we can go to our new list and ensure that data is being returned. This will validate that everything is flowing correctly. As you can see below, we are seeing all of the SQL records in our list as expected.
Note: You can delete this list. It only for validation purposes. Alternatively, you create additional ECT operation to allow people to update this list as well.
Next we will create our new Sync Connection in Central Admin > Service Applications > User Profile Service Application > Synchronization Connections
Add a new BCS connection to your BCS ECT that were created earlier. As you will see below, we have created a new connection to our SQL database via BCS. We have also told SharePoint that we want the UPS to match the SharePoint UserName field to the primary key we identified in our ECT to make our 1:1 match.
Now we can configure our user profile service application. First we will create our custom properties.
Facebook PageFor each property we need to create a property mapping to our BCS data connection. An example of the twitter handle field is below.
Twitter handle
Twitter page
Do this for the remaining fields
Now we need to perform a full sync. If you check the FIM client you will see that our ‘updates’ are being updated in the user profile as shown below.
We can check our user profile and see our new data has been synced!
Saturday, April 13, 2013
Content By Search and Display templates
First we need to add the content by search web part to our page and configure our query:
Above query displayed no results as my crawl had not yet completed.
As you can see below we are telling the CBS web part that we want to find all items matching the content type “Help Document” in the designated site collection. This is done using the quick mode to build our query. We can switch to advanced to add any other search parameters we would like as shown below.
After we configure the query we click ok and move on the Display template web part settings.
As you can see above, we copied to the Two lines template and the conversion was successful.
Now we can crack open the template and start making our changes.
For this scenario the client wanted the following layout for their items:
| Title | Team | Category | Location |
Modified by Modified By on ModifiedDate
|
Next, we need to add the additional fields to our template in the Managed Property Mapping section.
I needed to add 4 additional fields. I just copied an existing field and incremented the field number to keep it easy. Each field looks something like this:
'Title','Line 2'{Line 2}
And each field is separated with a ‘:’ As you see above we added Lines 2-6 giving us 4 additional fields to display when configuring our web part.
Ok, lets change our DIV ID and unique ID as shown below.
Next we need to add these fields to the corresponding JavaScript variables as well as create line IDs for each of these fields. If you scroll through the template you will see areas where each field is called out. Copy these lines and adjust them to match your new lines.
Next we can use HTML to build our documents layout table. Because we needed a table layout I created a table and moved the fields into each row. I did this by copying the existing Line 2 DIV and A tags and adjusting them to match my new lines. If you are simply looking to display a field you can grab the:
Snippet and place it wherever you would like. I have done this for my ModifiedBy and ModifiedDate fields as shown below.
Note: #_ .. _# are wrapper for JavaScript logic
Now we can save and publish our template. Barring any errors, this will now be an available option within our web part properties.
Note: IF you make an error SharePoint 'Gracefully fails' and actually gives you some good debug information regarding line/char numbers and reason for failure. Unlike 2010 where every CQWP blows up.
When we select this template we are now presented with additional fields to configure under property mappings.
To change these field we need to check the Change the mapping of the managed properties….. checkbox.
The best part is that SharePoint allows us to pick crawled properties when selecting our fields!!
Now as a sanity check I have placed a border on my table so I can validate the layout as shown below.
Looks good to me! I removed the border on the table and published to get my final result.
Monday, February 4, 2013
Need clean SharePoint filenames?
Make-SharePointReady ($filename)
{
$filename = [System.Text.RegularExpressions.Regex]::Replace($filename,"[~`"#%&*:<>?/\{|}.(),]","")
return $filename
}
{Kam}