Monday 21 November 2011

SharePoint 2010 - Move Log Files

By default the SharePoint Logs are located within the hive at:

“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS”

In order to mitigate the risk of running out of disk space on the C drive you may wish to change to location of the log files.

This can be achieved through either Central Administration or PowerShell.

Central Administration

Within Central Administration click Monitoring then Configure diagnostic logging

Configure Diagnostic Logging

Within the diagnostic logging page,  scroll down to the Trace Log section and change the log file Path

Diagnostic Logging

PowerShell

You can check the current location of the log files using:

  • Get-SPDiagnosticConfig

Get-SPDiagnosticConfig

You can set the location of the log files using:

  • Set-SPDiagnosticConfig –LogLocation “Path”

Thursday 17 November 2011

Visual Studio 2010 - Run with administrator privileges

 

Visual Studio needs to be run with Administrator privileges in order to interact with SharePoint.  i.e to deploy features.

If you aren’t running with administrator privileges you get the following error message:

ElevatedPrivalages

With the following message in the output console:

“To interact with SharePoint projects in Visual Studio, your system user account must have administrator privileges.”

In order to avoid this you can get Visual Studio to open up by default with administrator privileges:

Step 1

Right click on the Visual Studio shortcut icon and choose properties

STEP 2

Click on Advanced

Visual Studio Properties

STEP 3

Select Run as administrator then click OK

Advanced Properties

Tuesday 8 November 2011

InfoPath 2010 - Using UserProfileService.asmx

“This blog details the steps for using the user profile service.  Click here for details on how to create a connection to retrieve information”

The following steps outline how to pull through the logged in users “preferred name” from the User Profile Service web service.

STEP 1 

Right click a field within the fields data source and chose properties

1

STEP 2

Within the text box properties window click the formulas button

2

STEP 3

Within the insert formulas window click Insert Field or Group

3

STEP 4

Within the Select a field or group window choose the GetUserProfileByName data source.  Expand the data fields and select Value then click Filter Data

4

STEP 5

Within Filter data click Add

5

STEP 6

With specify filter connection window click Select Field or group

6

STEP 7

Within Select a field or group window select Name and click OK

7

STEP 8

Within the specify filter conditions window enter a text filter: e.g “PreferredName”

Then click OK

8

STEP 9

The filter window should now show the following:

Name = “PreferredName”

Within the filter data window click OK

9

STEP 10

Within the Select a field or group window click OK

10

STEP 11

The insert formula window should now show:

Value[Name="PreferredName"]

Click OK

11

STEP 12

The text box properties window should now show formula.  Then click OK

12

As well as the preferred name other information you can get from the user profile service are include in the table bellow:

AccountName
FirstName
LastName
WorkPhone
Manager
UserName
WorkEmail

InfoPath 2010 - UserProfileService.asmx

“This blog details the steps for setting up a connection to this service.  See here for details on how to use the connection to retrieve information”

User Profile Service

The user profile service web service provides a means by which to read user profiles. 

Within applications like InfoPath it can be used to provide a codeless method for accessing information about the user filling in the form.

The User Profile Service web service can be accessed through the following URL:

http://<server>/_vti_bin/UserProfileService.asmx

The following steps can be used to add the link to the web service within InfoPath 2010

Step 1

Within the Ribbon click on the Data tab then Data Connections

InfoPath Ribbon

Step 2

A list of all the current data connection available within InfoPath will be displayed.  Click on Add

Add Connection

Step 3

The data connection wizard will now launch providing a means to create connections to submit and retrieve data.   Select Retrieve Data and click Next

Connection Wizard Data Source Type

STEP4

The next window within the wizard allows you to specify which type of data source you wish to retrieve data from.  As the User Profile Service is a web service the select SOAP Web Service and click Next

Retrieval Type

STEP 5

After selecting the data source type the next step is its location.  For the User Profile Service this is:

http://<server>/_vti_bin/UserProfileService.asmx?WSDL

Enter the location and click Next

Web Service Url

STEP 6

After providing the link to the User Profile Service web service the wizard next displays all the operations that are available within it.   To retrieve information about the current logged user select GetUserProfileByName the click Next

Web Service Method

STEP 7

As we want information about the current user the next screen within the wizard can be left with the default value.  Click Next

Default Value

STEP 8

The next screen within the wizard can be left with the default values. Click Next

Wizard Default

STEP 9

Within the final screen of the wizard provide a name for the new data connection.

Check the box to Automatically retrieve data when form is opened

Then click Finish

Connnection Name

A data connection for retrieving information from the User Profile Service should now have been created.