Monday, November 17, 2014

SharePoint User Profile Synchronization Service Monitoring

SharePoint User Profile synchronization service interacts with Microsoft Forefront Identity Manager (FIM) to synchronize information with external systems. Thus to you may use the FIM client to monitor or review the synchronization processes.

Location of the FIM client:
SharePoint 2010
C:\Program Files\Microsoft Office Servers\14.0\Synchronization Service\UIShell\miisclient.exe
SharePoint 2013

C:\Program Files\Microsoft Office Servers\15.0\Synchronization Service\UIShell\miisclient.exe




If you launch the FIM client and gotten the following error message, it means that the SharePoint User Profile synchronization service is not configured correctly due to the following reasons:

  1. Your account is not a member of a required security group. Your service account must have the following permission:
    • Requires Log on Locally permission on the computer running the instance of the User Profile Synchronization Service
    • Replicating Directory Changes permissions on the domains being synchronized
    • Replicating Directory Changes permissions on the configuration partition of the domains being synchronized if the NetBIOS and fully qualified domain name (FQDN) names do not match
  2. Service is not started. the following services must be started before running the FIM client:
    • Forefront Identity Manager Service
    • Forefront Identity Manager Synchronization Service
There services can be started by starting the User Profile Synchronization Service in SharePoint Central Administration

Tuesday, April 29, 2014

SharePoint: Report Viewer Session State

If you encounter an error message :-
"Session state has been disabled for ASP.NET. The Report Viewer control requires that session state be enabled in local mode."



Quick Fix
  1. Run the following command in
    • Enable-SPSessionStateService –Defaultprovision
  2. Open the web.config file, search for enableSessionState 
  3. Update the value of enableSessionState from false to true

Thursday, September 26, 2013

Report Viewer export to Excel/Word return blank/empty document

Issue
Exporting a report to Excel, Word or PDF was fine using Admin account. However, using a non-admin account, exporting report to Excel or Word will returned a blank/empty page but PDF was fine.

Solution
Navigate to the folder "C:\Users\<App Pool Identity>\AppData\Local\Temp", edit the security of this folder and add "Authenticated Users" with "Full Control " permissions.

How to check App pool identity?
In IIS Manager, click on Application Pools. Check the Identity for the particular app pool under the Identity column.

Wednesday, August 14, 2013

Textbox with Capital/Uppercase Letter

To convert the text input into the textbox by the user to be converted to capital/uppercase letter:

Design View
<form id="form1" runat="server">
<asp:ScriptManager ID="sc" runat="server"></asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged" AutoPostBack="true"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>

Code Behind
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text.ToUpper();

}

Result

Monday, August 12, 2013

DropDownList

Designer View
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Select a colour : "></asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
</td>
</tr>
</table>

Add / bind data into dropdownlist
1. Manual binding
private void BindDropDownList()
{
DropDownList1.Items.Clear();
DropDownList1.Items.Insert(0, new ListItem("-SELECT-", "-1"));
DropDownList1.Items.Add(new ListItem("Red", "1"));
DropDownList1.Items.Add(new ListItem("Yellow", "2"));
DropDownList1.Items.Add(new ListItem("Green", "3"));
}

2. Using DataTable
private void BindDropDownList()
{
DataTable tableColour = GetTable();

DropDownList1.Items.Clear();
DropDownList1.Items.Insert(0, new ListItem("-SELECT-", "-1"));
DropDownList1.DataSource = tableColour;  //bind the ddp_dataview to dataview
DropDownList1.DataTextField = "Colour";
DropDownList1.DataValueField = "Colour Code";
DropDownList1.DataBind();
}

private DataTable GetTable()
{
DataTable table = new DataTable();
table.Columns.Add("Colour Code", typeof(int));
table.Columns.Add("Colour", typeof(string));

table.Rows.Add(1, "Red");
table.Rows.Add(2, "Yellow");
table.Rows.Add(3, "Green");

return table;
}

Result:

Monday, August 5, 2013

Make People Picker Look Like a TextBox

The default People Picker will look something like this;

So use the following CSS to make it look more like a default TextBox;


.ms-inputuserfield
{
font-size: 8pt;
font-family: Verdana,sans-serif;
}
   
div.ms-inputuserfield a
{
color: #000000;
text-decoration: none;
font-weight: normal;
font-style: normal;
}
   
div.ms-inputuserfield
{
border: 1px solid #a5a5a5;
position: relative;
padding-left: 1px;
padding-top: 2px;
}

As for the the People Picker control:
<SharePoint:PeopleEditor ID="PeopleEditor" CssClass="ms-inputuserfield" Width="360px" runat="server" AllowEmpty="false" MultiSelect="false" />

Exporting DLL from GAC via Command Prompt

To copy or export out a DLL in GAC;
  1. Launch a Command Prompt
  2. Browse to GAC_MSIL folder;
    • cd c:\windows\assembly\GAC_MSIL
  3. Each DLL in GAC will have its own folder, thus to get to the DLL, browse to the DLL folder;
    • cd <the name of the DLL>
  4. Different version of the DLL will be stored in different sub-folders. To check the available sub-folder enter "dir" in the Command Prompt
  5. Once identify the sub-folder, navigate into the sub-folder
    • cd <sub-folder name>
  6. Now you are able to export/copy out the DLL in this folder. To do so, use the following code;
    • copy *.dll C:\<preferred folder>\
  7. Done
Exporting DLL from GAC via Command Prompt