Tuesday, March 4, 2014

Exporting User Profiles Property in Sharepoint 2010 into excel


((Reference: http://csefi.blogspot.com/2012/02/sharepoint-2010-user-profile-export-to.html))

Don't you often hear the question from users: "How can I export the user profile to excel?" Many clients use the SharePoint user profile to synchronize user data from diffent directory services into SharePoint so everyone can find all the necessary information at one place. The only thing that customers miss is the built in functionality to export all the user information.

I've written a small application which has four functionalities:
  • Connect User Profile and list the properties and their types
  • Export user profiles into CSV with the selected user profile properties
  • Generate powershell script to export user profiles into CSV with the selected properties
  • List user's properties 
I hope you find the application helpfull.

You can download the application from here.
and...
you can download the source code from here.

Cheers,
Cséfi

Afterwords
This blog is not intend to explain how you can work with user profile store, because there are many blogs already about this topic. Just bing for it. In nutshell there are three ways how you can work with user profiles. You can use powershell script or object model to get the required data.
Object model

By adding Microsoft.Office.Server.UserProfiles.dll to your project, you will be able to use UserProfileManager class and get all the information you need. There are many blogs that explain how to use these classes so I'm not going to do it agian.

Web service

SharePoint 2010 has a built in user profile webservice. You just need to add as a Web reference to your project. The URL of the webservice is: http://yourserver/_vti_bin/userprofileservice.asmx
After you've added the reference to your project you will have a UserProfileService proxy class and you will be able to do all kind of things just as with object model, like getting User Profile properties, user profiles, etc.

Powershell script

You can do almost everything with Powershell scripts and it is not different when it comes to user profiles. Here is a little example to get user profiles  from User Profile:

$serviceContext = Get-SPServiceContext -Site http://server
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$profiles = $profileManager.GetEnumerator()
foreach($userProfile in $profiles)
{
 #Do something
 #$propertyName = "Title"
 #Write-Host $userProfile[$propertyName];

}

Friday, February 28, 2014

InforPath Quick Design Tips

1) Want to Open InfoPath Forms in full page & not a dialogue from within Sharepoint? 2 major steps, from Central Administration & 2nd from the library settings.

InfoPath Forms Services Setting

Regardless whether an InfoPath form template has been forced to open in a browser through the SharePoint Form Library setting discussed in the previous section or not, if an administrator has disabled the setting to Render form templates that are browser-enabled by users from SharePoint Central Administration, users will not be able to open InfoPath forms in a browser.

Figure 2. "Render form templates that are browser-enabled by users" setting in SharePoint Central Administration
To enable this setting:
  1. Open SharePoint Central Administration.
  2. Click the Application Management tab.
  3. On the Application Management page under the InfoPath Forms Services category, click Configure InfoPath Forms Services.
  4. On the Configure InfoPath Forms Services page under the User Browser-enabled Form Templates category, check Render form templates that are browser-enabled by users.

SharePoint Form Library Setting

If the InfoPath client application has been installed on a PC, it will be used by default to open forms that have been stored in a SharePoint Form Library unless the setting Display as a Web page has been set on that SharePoint Form Library. This setting will force forms to open in a browser even if the InfoPath client has been installed on the PC from where the form is being opened.

Figure 1. "Display as a Web page" setting of a Form Library.
To enable this setting:
  1. Go to the Form Library to which you published the InfoPath form template.
  2. Click Settings on the Form Library menu bar and choose Form Library Settings from the drop-down menu.
  3. On the Customize <Form Library Name> page under the General Settings category, click Advanced settings.
  4. On the Form Library Advanced Settings: <Form Library Name> page under the Browser-enabled Documents category, choose Display as a Web page.

Infopath
File - > Info -> Advanced Form Options -> uncheck Show commands in Ribbon..

Tuesday, January 28, 2014

Sharepoint & PDF

We all needed @ sometime to preview a pdf document instead of downloading it, let's make a tour of what.
IE8
 When we try to open PDF file in IE 8. It won’t open but ask us to save it or Cancel instead of opening the pdf.
Reason :  In Internet Explorer 8 Microsoft added a security feature, a mechanism to help prevent the untrusted content from compromising your site’s security. When the new X-Download-Options header is present with the value no open, the user is prevented from opening a file download directly; instead, they must first save the file locally. SharePoint 2010 utilizes this enhanced security feature in IE 8 to block the opening of file types it considers vulnerable to scripting or other attacks, such as PDFs.
Solution #1:
  •  Go to Central Admin à Application Management à Manage Web Application
  •    Select  the  Web Application for which you want to make changes
  •    In Ribbon, Go to General Settings àGeneral Settings àBrowser File Handling
  •    By default, the option “Default” will be checked. Change it to “Permissive” à Select OK.

  •  Do an IISRESET, refresh the page and try to open PDF Document.
  •   PDF document will be opened.


Solution #2:
  • Open Adobe PDF from Start button
  •  Go to Edit à Preference à Categories à  Internet à uncheck Display PDF in Browser option
  • Save and close it.

Refresh your page and Now Click PDF. It will ask for open option or will be opened in adobe\IE.

 ***///***///***

In Other hand,

Here's a free PDF Viewer webpart:
  • http://pdfviewer.codeplex.com/
Want some other essays?
  • http://mssharepointtips.com/tip.asp?id=1187
  • https://www.foxitsoftware.com/shopping/checkout.php?action=view

Sunday, January 26, 2014

How to create rich HTML email message in Sharepoint Designer 2010 workflow ?

I was very happy when i first saw sharepoint designer 2010 workflow HTML email then i become frustrated because i cannot able to add images and tables directly from editor. i thought rich HTML is not supported with this version but i found a quick way to add rich HTML in email body message.
Here is the steps:
  • First create your HTML in dreamweaver or any other HTML editing tool
    (NOTE: Try to avoid spacing & <br/>’s )
  • Then open your workflow in SPD 2010
  • Add “Send email” workflow action from ribbon
  • Keep “Send Email” action selected/highlighted
  • Then navigate to ribbon and select advanced properties
  • Select last option Body
  • Click on the button (3 dotted button) to open the text pad
  • paste your html including head,body,DTD from dreamweaver
  • Click OK and open the action from workflow step
  • Then add your lookups and test it.
  • Done!
 Thanks to Jim Mathew's blog

Wednesday, January 22, 2014

Sharepoint Useful Blogs

Jamil Haddadin's Blog
http://jamilhaddadin.com/category/sharepoint/sharepoint-how-to/

Set New Policies Settings in a document library
http://www.collaboris.com/blogs/collaboris-blog/policy-management/2013/02/27/how-to-set-default-column-values-on-a-document-in-sharepoint#.UuDA-_tBveh

Intro to SP very good for serious
http://www.bizsupportonline.net/blog/2011/04/basic-sharepoint-2010-components-master-infopath-2010-free-online-resources/

Some Free & Trial Webparts
http://www.boostsolutions.com/sharepoint-2010.html

Great Rich blog, esp. in infopath
http://www.bizsupportonline.net/blog/2011/ 

http://suehernandez.wordpress.com/ 

Books to read:
Designing Forms for SharePoint and InfoPath

Publish your intranet sharepoint site
http://www.sharepointconfig.com/2010/03/configuring-a-sharepoint-website-to-allow-ssl-connections/

Change Column default value in a Document library

Friday, January 3, 2014

Importing and displaying user pictures from Active Directory into MySite Sharepoint

 Importing and displaying user pictures from Active Directory into MySite Sharepoint
Check this
http://www.sharepointdiary.com/2013/01/import-user-pictures-from-active-directory-to-sharepoint-2010-mysite.html

 You have JPG pictures in AD, stored with the users thumbnailPhoto attribute.
 You try to import pictures for a user profile from the Active Directory thumbnailPhoto attribute,
 to store within the Picture attribute in Microsoft SharePoint Server 2010.

3 steps to do:
  • Create an import PictureURL mapping
  • Perform a full profile synchronization
  • Run the Update-SPProfilePhotoStore PowerShell command:
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://<YourServerName>/my

So after updating the pics in AD, you have to repeat the 2nd & the 3rd steps
-----

 You have set up an import Picture URL mapping.

create the Mapping in SP2010 or SP2013:

 go to Central Admin->Application Management->Manage Service Applications
 select your User Profile Service Application
 select the People->Manage User Properties tab
 in the left-hand column, look down and select the Picture property.
 edit this - down the bottom is 'Add New Mapping' and via the dropdown on Attribute, select thumbnailPhoto.
 it should then look like this:
   User Profile Synch Connection
   thumbnailPhoto
   Import
go back to the Manage User Properties and you should now see
   Picture    URL   thumbnailPhoto
OK, so now Synchronization->Start Profile Synchronization. Let that run through.
Next you will want to double-check your MySiteHostLocation.
select My Site Settings->Setup My Sites
grab the entry from My Site Host Location - that is what we need for the MySiteLocation parameter.
so, on the SharePoint box, launch a SharePoint PowerShell, (run as administrator).
the command will be as per below, with your path replacing "http://<YourServerName>/my"

Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://<YourServerName>/my

Now, go back to your mysite, select your profile and... voila!!  the new picture has been pulled in from AD.
 Things that can go wrong:
  • Be on current Cumulative Updates. (Post Dec 2011 absolute minimum!)
  • User Profile Synch service has to be running/enabled/OK!
  •  Permissions:
    •  Service Applications->User Profile Service Application, click Permissions. 
          Add your account and check the Full Control checkbox.
    •  Service Applications->User Profile Service Application, click the Administrators
          Add your account there and check the Manage Profiles.
  • Site Collection Administrator for the My Site host
  • DBO access to the DB containing mysite host.
  • run powershell with 'Run as Administrator'

Thursday, December 19, 2013

Open with Explorer

Troubleshooting Open With Explorer.

Server Side

make sure of those steps
1. Desktop Experience Feature should be enabled for sure. (see the pic below)
2. WebClient service was disabled in Server 2008 R2. This service should be running to modify any internet based files.
3. The sharepoint site should be under Trusted Sites in IE Settings.

 

Client Side

There are two very common issues when attempting to use the Open with Explorer feature.
1) The first is the easiest to solve.
Grayed Out Open with Explorer Button -->> Solution You are not using Internet Explorer :)

2) The more common and difficult issue encountered when attempting to ‘Open with Explorer’ is the following:
“Your client does not support opening this list with Windows Explorer”
This error can be received for many reasons, and sometimes no reason at all. Below are several troubleshooting steps which can be taken in an attempt to resolve this issue. After completing the steps in teach fix, retry the  button.

A.      Try Again

In some instances, when you click the  action will give an error on the first attempt, but will work the second time. Simply try clicking the  button again and confirm whether it opens or not.

B.     Restart WebClient Service

a)       Click Start > Run
b)       Enter ‘services.msc’
c)       Find the WebCient service and select Restart

C.     Check Internet Explorer Version

Windows XP – 2008R2: Make sure you are using Internet Explorer version 7.0 through 9.0, in 32-bit mode. The 64-bit mode will not work with the  feature.
Windows 7: Internet Explorer 10 is not yet compatible with the  feature. You will need to revert to Internet Explorer 9.
Windows 8: Internet Explorer 10 is compatible, so you should not have an issue with this OS and browser version combination.

  D.     Add to Trusted Sites

a)       Open Internet Explorer and click ‘Tools’ or  to get to ‘Internet options’
b)       Select the ‘Security’ tab
c)        Click on ‘Trusted Sites’
d)       Ensure  is unchecked
e)       Click ‘Sites’
f)        Add your intranet/internet site:

E.      Lower UAC Setting

The User Account Control must be set to the lowest setting in order for  to function. Instructions for modifying the UAC are available here:
 http://technet.microsoft.com/en-us/library/cc709691(v=ws.10).aspx#BKMK_S3

F.      Set Internet Explorer to Automatic Logon

a)       Open Internet Explorer and click ‘Tools’ or  to get to ‘Internet options’
b)       Select the ‘Security’ tab
c)        Click on 
d)       Scroll to the bottom, and change the ‘User Authentication – Logon’ setting to:
         Automatic Logon with user & password.
 

Wednesday, November 27, 2013

Useful Blogs
  • Jim Mathew's Blog
http://sharepointjim.wordpress.com/
  • Jamil Haddadin 's blog
http://jamilhaddadin.com/category/sharepoint/sharepoint-how-to/