<script type="text/javascript">
var Key = {
a : "hello",
b: "world"
}
alert(Key.a);
alert(Key.b);
</script>
Friday, February 28, 2014
JavaScript Key Array
Today I discovered that javascript now supports Key Value Arrays....sweeeet.
Wednesday, February 26, 2014
My Microsoft Certified Professional(MCP) Card
This is how my Microsoft Certified Professional(MCP) Card looks like:
Monday, February 24, 2014
SharePoint 2013 - User Profile Cleanup Timer Job
Diagrams below explain how the user profiles are getting imported by User Profile Application in SharePoint 2013 and then how they are deleted from the SharePoint.
MySites is created when user accesses the MySite Host Site.


MySites is created when user accesses the MySite Host Site.

After the profiles are marked deleted in the UserProfile_Full table, Cleanup job takes care of the dirty work.

Monday, January 27, 2014
Publishing SSRS 2008 Reports in SharePoint
In this post, I will talk about publishing and viewing SSRS 2008 reports in SharePoint 2007.
Pre Req: You should have at least one report ready to publish. I have explained how to build a report by fetching data from a SharePoint list in this post.
Following are the configuration steps you need on SQL side as well as on SharePoint side:
Pre Req: You should have at least one report ready to publish. I have explained how to build a report by fetching data from a SharePoint list in this post.
Following are the configuration steps you need on SQL side as well as on SharePoint side:
- Launch Reporting Service Configuration Manager from Start menu.
- Go to Database Setup tab, change Server Mode to SharePoint Integrated. It will ask you to create a new SSRS database. Go ahead and create it.
- Go to SharePoint Integration tab and then launch SharePoint 2007 Central Admin.
- In SharePoint Central Admin, go to Applications -> Reporting Services section
- Under Reporting Services, select Manage integration settings and provide Reporting Server URL (http://ServerName
) and Authentication Type as Windows Authentication in dev box (Trusted Connection in production environment)./ReportServer - Under Reporting Services, select Grant database access and provide Server Name (with farm login credentials)
- Go to the Site Collection features of SharePoint site collection where you want to publish/run the reports and activate Report Server Integration Feature feature.
- Create a Reporting Document Library and upload report file RDL and Datasource file RSDS in it. This is the document library where we will store our reports and datasources.
You can also publish the reports and data source directly from BI Studio by these steps:
http://technet.microsoft.com/en-us/library/bb326285 - Create a new blank web part page and add SQL Server Reporting Services Report Viewer web part on it. Then configure the web part properties to point to the RDL file in the document library.
- Save and publish the page and you should see the report in the Report Viewer web part...BOOM.
Friday, January 24, 2014
Displaying SharePoint List Data in SSRS 2008 Report
In this post, I am going to explain how to fetch data from SharePoint 2007 list and then display it in SQL Server Reporting Services (SSRS) 2008 to build a report or a dashboard.
Pre Requisite: This article assumes that following components are installed on the Windows Server:
Pre Requisite: This article assumes that following components are installed on the Windows Server:
- SharePoint 2007
- SQL Server 2005
- Visual Studio 2005/2008
- SQL Server Reporting Service 2008
With the installation of SSRS 2008, following two virtual directories will be created under default website in IIS:
- Reporting Server: http://localhost/ReportServer
- Reports Manager: http://localhost/Reports (We will be using this)
You can get configuration information about SSRS by launching Reporting Services Configuration Manager from Start menu.
Let's create a report now.
Let's create a report now.
- Launch SQL Server Business Intelligence Development Studio from Start menu.
- Select File -> New -> Project and select Report Server Project.
- Once the project is created, you will see two folders: Shared Data Sources and Reports. I don't need to explain these two folders...right? :o).
- Create Data Source: In this step we have to define that our data source is a SharePoint 2007 List and we will connect to that list using SharePoint web services.
Add New Data Source by r-clicking the Create Data Sources folder and specify the name as SharePointDataSource, type as XML and Connection string as https://<sharepointsite>/_vti_bin/lists.asmx - Create Report: We have a custom list List9 in our SharePoint Site which we want to show in the report. Here is how the data in List9 looks like:
R-click Reports folder and select Add New Report. This will launch Report Wizard. In the Report Wizard specify the data source (SharePointDataSource) created in the step 4 here. - Publish: Lets publish the report on the Reporting Manager/Server.
Go to the project folder and upload Report1.rpt and SharePointDataSource.rds files to http://localhost/Reports. I have renamed my datasource file to ds_SPList on the Reporting Server.
Click Report1 and you should see the data from SharePoint List 9.
In the next screen provide the Query String specifying the List Name and columns etc.
Here is a sample XML:
<Query>
<SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
<Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
<Parameters>
<Parameter Name="listName">
<DefaultValue>List9</DefaultValue>
</Parameter>
<Parameter Name="viewName">
<DefaultValue></DefaultValue>
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="Choice" />
</ViewFields>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
In the next screen choose TabularIn the next screen, under Details add ows_Title and ows_Choice columns.
In the next screen select the Table Style
hit last Next and then Finish.
You will see your first report as follow
Hit Preview tab to run the report and see the data from List9 list from SharePoint.
Now is the time to make report pretty e.g. change title, add graphs or add additional columns.
Tuesday, January 14, 2014
Export Sharepoint User Profiles to CSV
I was looking for PowerShell script to export SharePoint User Profile data to a CSV and found this beautiful script by John Lynch.
I have made following little modification to the script:
I have made following little modification to the script:
- Export users which have special characters in their name by applying the UTF8 encoding.
- Check for manager field and show their display name instead of network id.
# Export Sharepoint User Profiles to CSV file
# Created: John Lynch 2013
# Updated: Tahir Naveed 2014
# MIT License
$siteUrl = "http://MySite.com"
$outputFile = "G:\UPAExport\UPAexport_20140428.csv"
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Function GetDisplayName($UserName)
{
$serviceContext = Get-SPServiceContext -Site $siteUrl
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$userProfile = $upm.GetUserProfile($UserName);
$FullName = $userProfile.DisplayName
return $FullName
}
$serviceContext = Get-SPServiceContext -Site $siteUrl
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$profiles = $profileManager.GetEnumerator()
$fields = @(
"UserName"
"FirstName",
"LastName",
"PreferredName",
"WorkPhone",
"MobilePhoneFromAD",
"HomePhone",
"CellPhone",
"Fax",
"localTelephone",
"SPS-Birthday",
"WorkEmail",
"PersonalSpace",
"PictureURL",
"Office",
"title",
"department",
"manager",
"SPS-School",
"PersonalInterests",
"LocationExperience",
"HomeTown",
"Assistant"
)
$collection = @()
foreach ($profile in $profiles)
{
$user = "" | select $fields
foreach ($field in $fields)
{
if($profile[$field].Property.IsMultivalued)
{
$user.$field = $profile[$field] -join "|"
}
else
{
if ($field -eq "manager" -or $field -eq "Assistant")
{
$DomainName = $profile[$field].Value;
if ($DomainName -ne $null)
{
$DisplayName = GetDisplayName $DomainName
$user.$field = $DisplayName
}
}
else
{
$user.$field = $profile[$field].Value
}
}
}
$collection += $user
Write-Host $user.UserName
}
$collection | Export-Csv $outputFile -NoTypeInformation -Encoding UTF8
$collection | Out-GridView
Monday, January 13, 2014
Happy New Year
Starting 2014 with @Harvard's famous @CS50. #CS50x
— Tahir Naveed (@NooriNath) January 9, 2014
Subscribe to:
Posts (Atom)
-
Scenario: Updating the Master Page for SharePoint Online is not recommended by Microsoft now.....fine. So how do we change the UI then? And...
-
Microsoft introduced Office Graph a couple of months back which uses machine learning techniques to connect people to the relevant content,...
-
Recently I came across this amazing article of Claudio ( http://www.endusersharepoint.com/2009/04/20/finally-dynamic-charting-in-wss-no-code...
Official SharePoint Documentation
I have recently contributed to the official SharePoint documentation for developement. Check it out here: https://docs.microsoft.com/en-us...