X Blogs

who you gonna call?

Display members of AD group in SharePoint 2010 - Updated

clock January 3, 2012 22:19 by author Robi

Hi,

I updated the Display members of AD groups in ShaePoint 2010. Now the solution has a new look and as what one of my friends, Christian Stahl suggested I added links to members of groups and groups to display detailed info about user.

If you use SharePoint Server 2010 and you have my sites configured, you will be redirected to my site host for details about a user.

If user have permission to see members of SharePoint group, the group displays link to group membership page or group settings if you will. You can see the link in the bottom part of the picture.

AD groups now have a new icon, which you can see by the »CORP\sg_finance« AD group.

When you click on the group link you are redirected to a People and Groups page:

 

Users that are members of the site, not AD groups also have links to details view. If you use SharePoint Foundation 2010 you are redirected to a »Users« list if you use My Sites you are redirected to user's my site.

Installation instructions:

Install solution

If you want to install the new version of solution, downlod the wsp file from Codeplex:

http://sp2010adgroupmembers.codeplex.com/releases/view/79845

On your SharePoint Server run SharePoint 2010 Management Shell as Administrator and then run the command:

Add-SPSolution -LiteralPath C:\Users\sp_farm\Desktop\Skupine_Web_Part.wsp

To deploy the solution go to Central Administration, System settings, Manage Farm Solutions, click on »Skupine_Web_part.wsp« and click Deploy Solution.

You can also deploy the solution with PowerShell by running the following command:

Install-SPSolution -Identity skupine_web_part.wsp -GACDeployment -AllWebApplications

Activate solution

What you need to do next is go to your site collection where you want to use this solution and Activate the »Skupine Web part« solution on the »Site collection features« page:

Add web part to a page

To insert a web part to your page, click Edit page button and then Add a Web Part.

In the »KompasXnet« category, you will find »Xnet Diplay Group Members« web part.

Click Add.

When you web part is on the page, it is going to be empty. From a web part menu, select »Edit web part«

Enter a user name. This can be any domain user, without any special privileges. In the format domain\username.

Enter password for this user.

Enter domain information for querying your domain. If you have a special users container, you can specifiy just the Organizational Unit.

For example, if you would like to query just the OU »Zaposleni« you can enter:

 

OU=Zaposleni,DC=CORP,DC=XNET,DC=SI

Enter the Fully qualified domain name of domain controller where query will be sent to:

»Xnet-DC01.corp.xnet.si«

Click OK.

Click Stop Editing on the Ribbon on the Page tab.

When you click Stop Editing, the Web part will still be empty. What you need to do is click Browse on the Ribbon and navigate to the page where the Web part is.

Hope you find the improved version of my solution useful. If you have any comments or suggestions please send me email to:

robi@kompas-xnet.si



Display members of AD group in SharePoint 2010

clock December 10, 2011 02:16 by author Robi

Hi,

Because I got a question so many times if you can show members of AD groups on SharePoin site, I decided to build a web part that would replace the Site Users web part.

 

The usage is pretty simple, what you need to do is deploy a wsp package that you can find inside the bin\release folder.

 

Next step is to add a web part to your site and what you need to do is enter some information to access the Active Directory.

 

You need to enter:

  • user name to connect to AD in the format:
    • domain\username
  • domain information for LDAP query in format of:
    • DC=corp,DC=xnet,DC=si
  • you need to enter FQDN of a domain controller to which the ldap query will be sent:
    • xnet-dc01.corp.xnet.si

Hopefully some one will find this web part usefull.

You can find solution attached in a zip file.

 

For comments and suggestions please contact me at:

robi@kompas-xnet.si

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 

There were some bug fixes so I published a new version of a Web Part.

 

Skupine Web Part_1.2.zip (219.37 kb)



Script for Exporting and importin all webs in site Collection

clock November 15, 2011 20:27 by author Robi

I needed to export and import all web in site collection to a new Site collection, which was based on a different language template.

In order to automate the process I, of course, used PowerShell. I was trying to figure out, what would be the best way to name the exported webs and found this article on TechNet Forums:

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/65e5e221-4d1f-428c-8803-f46f98171651/

 

This lead me to write script for exporting webs to be:

 

#Get all webs in site collection

$webs=Get-SPSite http://razvoj/sites/ang |Get-SPWeb -limit all

#Export-Spweb

foreach($web in $webs){$filename=$web.url.replace("http://","").replace("-","--").replace("/","-")+".cmp"; Export-SPWeb $web -Path c:\export\$filename -IncludeVersions all -IncludeUserSecurity -Verbose}

 

When you create new Site collection on a team site for example, there are some list and libraries which I found is best to delete them to avoid errors when importing webs.

#Delete lists and libraries on a new site collection to avoid errors when importing
for($i=0;$i -lt $seznami.Count;$i++){$seznami.delete($seznami[$i].id)}

The next step is to get all files in a c:\Export folder which has the extension of ».cmp«. For this I wrote a script:

#Get all files in folder with .cmp extension
$list=Get-ChildItem c:\export | where {$_.extension -eq ".cmp"}

And the final step is to import all webs to a new site collection:

#Import all files and use file name as reference to where web should be created
foreach($listitem in $list){$importweb=$listitem.name.replace("razvoj-","http://razvoj/").replace("-","/").replace("ang","slo").replace(".cmp",""); import-spweb $importweb -UpdateVersions overwrite -Path c:\export\$listitem -Force -IncludeUserSecurity -Verbose}

Hope this helps.

Robi Vončina



SharePoint Server 2010 Service Pack 1 PowerShell Changes

clock June 30, 2011 20:24 by author Robi

Here are some PowerShell Changes that came with SP1 for SharePoint Server 2010.

New cmdlets are:

  • Add-SPProfileLeader
  • Get-SPProfileLeader
  • Remove-SPProfileLeader
  • Remove-SPProfileSyncConnection
  • Add-SPProfileSyncConnection
  • Disable-SPHealthAnalysisRule
  • Enable-SPHealthAnalysisRule
  • Get-SPHealthAnalysisRule
  • Get-SPDeletedSite
  • Remove-SPDeletedSite
  • Restore-SPDeletedSite
  • Move-SPSocialComments

There are of course some changes to the existing cmdlets and here are a few that will be useful when configuring SharePoint Server 2010:

Used to move an RBS-enabled site collection from one RBS-enabled content database to another RBS-enabled content database without moving the underlying BLOB content. If the content database has more than one RBS provider associated with it, you must specify all providers. The same providers must be enabled on the target content database and the source content database."

    • New Parameter:AnalyticResultCacheMinimumHitCount <Int32>
    • New Parameters:DatabaseServer <string>,DatabaseName <string>,DatabaseFailoverServer <string>,DatabaseSQLAuthenticationCredential <PSCredential>

      This was the only Service Application that didn't allow us to set the database information when we created it so we were left with this nasty GUID in the name.

    • New Parameter:AnalyticResultCacheMinimumHitCount <Int32>
    • New Parameters:DatabaseServer <string>,DatabaseName <string>,DatabaseFailoverServer <string>,DatabaseSQLAuthenticationCredential <PSCredential>,DatabaseUseWindowsAuthentication
    • New Switch Parameter:Recycle


SharePoint 2010 Updates

clock June 30, 2011 19:22 by author Robi

To update your SharePoint environment it is recommended to install Cumulative Updates.

You can find all CUs as well as Service Packs and info on how updates should be applied on this page:

http://technet.microsoft.com/en-us/sharepoint/ff800847

To get better knowledge on applying patches it is recommended to read this TechNet article:

Software updates overview (SharePoint Server 2010)

One important information when updating your server farm or administering server farm is to know on which patch level it is.

To get build number, you simply open Central Administration and click »Manage Servers in this Farm«:

You can compare Farm build number to the table bellow which I borrowed from Todd Klindt

Build

Release

Component

14.0.4763.1000

RTM

All components

14.0.4762.1000

RTM

Farm Build Version

14.0.5114.5003

June 2010 CU

SharePoint Foundation 2010

14.0.5114.5003

June 2010 CU

Microsoft Shared Components

14.0.5114.5003

June 2010 CU

Microsoft SharePoint Portal

14.0.5114.5003

June 2010 CU

Microsoft User Profiles

14.0.5114.5003

June 2010 CU

Microsoft Search Server 2010 Core

14.0.5114.5003

June 2010 CU

Microsoft Web Analytics Web Front End Components

14.0.5123.5000

August 2010 CU

SharePoint Foundation 2010

14.0.5123.5000

August 2010 CU

SharePoint Server 2010

14.0.5128.5000

October 2010 CU

SharePoint Server 2010

14.0.5130.5002

December 2010 CU

SharePoint Foundation 2010

14.0.5130.5002

December 2010 CU

SharePoint Server 2010

14.0.5136.5002

February 2011 CU

SharePoint Foundation 2010

14.0.5136.5002

February 2011 CU

SharePoint Server 2010

14.0.5138.5000

April 2011 CU

SharePoint Foundation 2010

14.0.5138.5000

April 2011 CU

SharePoint Server 2010

14.0.5138.5000

April 2011 CU

Project Server 2010

14.0.6029.1000

Service Pack 1

SharePoint Server 2010

14.0.6029.1000

Service Pack 1

Office Web Apps

14.0.6029.1000

Service Pack 1

Project Server 2010

14.0.6029.1000

Service Pack 1

SharePoint Foundation 2010

14.0.6105.5000

June 2011 CU

SharePoint Server 2010

14.0.6105.5000

June 2011 CU

SharePoint Foundation 2010

14.0.6105.5000

June 2011 CU

Project Server 2010

Hope it helps.



SLOWUG - marec 2011

clock March 10, 2011 20:33 by author Robi

Pozdravljeni,

objavljam prezentacijo, ki sem jo uporabil na SloWUG srečanju o namestitvi in konfiguraciji SharePoint 2010 Serverja.

SLOWUG-SharePoint 2010 install_Config.pptx (2,30 mb)



SharePoint Print List Item

clock March 1, 2011 00:05 by author Robi

Hi,

 

I received a question how to easily create a print form for a SharePoint list item.

This is the easiest way I can think of.

  1. Open SharePoint Designer and open your list files. Create new aspx page.

2. Edit your newly created aspx page in Advanced mode.

3.Open you aspx page in split mode and click in to the design window. From the ribbon, choose Insert/SharePoint and select Custom List Form.

4.Select the list you want to create new list form for and select Display Form.

5. Insert HTML button and insert on click event handler to "window.print()"

6. Go to Allitems.aspx and open it in Advanced mode. Add column to the right and just type "Print Preview".

7. Add hyperlink to your text.

8.Browse to your custom list form and add "?ID={@ID}.

9. Try it out...

 

Hope it helps!!



SharePoint User Code Service not starting

clock January 17, 2011 20:42 by author Robi

I tried to publish a sandbox solution on SharePoint Server and was getting error that Sandbox Code service server was not found. I checked in Central Administration and found out, that Microsoft SharePoint Foundation Sandboxed Code Service was running and that SharePoint 2010 User Code Host Service was set to automatic but not running.

In the event logs, I found out, that I have errors in system logs:

  • Event Id: 7031, 7034;
  • source: Service Control Manager;
  • details: The SharePoint 2010 User Code Host service terminated unexpectedly.

I found out, that service account that was running Sandbox code service needs to have access to performance counters on the server. So what you need to do is pretty simple, you need to grant service account access to counters and you can do it by adding service account as a member of local group Performace Monitor Users in Server Manger.

 

Voila, after adding user to Performace Monitor Users everything works as expected.



About the author

Rok Bermež is Slovenian Windows Azure MVP, he works as a Software Engineer and Microsoft Certified Trainer at Kompas Xnet. His primary interests include cloud computing and web development. With extensive experience in development and architecture he participated in many projects and since the CTP release of Windows Azure much of those projects are based on Windows Azure platform. Rok has been delivering courses, writing code and speaking at conferences and community events on Microsoft technologies for the last couple of years. You can also find him on Twitter (@Rok_B).

Month List

Sign In