<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1285803282961005804</id><updated>2011-07-28T14:47:00.801-07:00</updated><category term='C#'/><category term='Vaderland. SharePoint Blog'/><category term='Eric Land'/><category term='SharePoint; Properties; UserProfile'/><title type='text'>Eric's Dev Blog of Creamy Goodness.</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ericlands.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ericlands.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eric Land</name><uri>http://www.blogger.com/profile/02347414493756468655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_MMehgHc1Olo/SrvAQLFTXtI/AAAAAAAAAAU/bGxd1eQ0s8I/S220/4simpsons1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1285803282961005804.post-2752007541796073438</id><published>2011-06-02T13:53:00.000-07:00</published><updated>2011-06-02T15:09:22.325-07:00</updated><title type='text'>SharePoint 2010: Adding List Attachments as Links in a DataView Webpart</title><content type='html'>As silly as it seems to me, providing links to list attachments in a data view is still not an OOB option in SharePoint 2010. I read a lot about how you should just use document libraries instead, and while that may be a better option in some ways, it doesn't always provide the best user experience, especially when you want to provide a non technical user a way to have files associated with a custom list item, or in my case, as Task List item. The only OOB way to link a list to a document library such that you could later provide a filtered view of the documents was to link up some sort of common data point (such as a project number, or a list item ID number). While that's not a big deal usually, the goal to achieve as little effort for the end user is always paramount in my firm. Feel free to comment on how best to automatically link an item(s) to a document library without custom code or a third party solution. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For me, the easiest thing for my users, is to simply attach to the list. No worries for them... No trouble shooting for me when things don't show up in a view somewhere. I have seen a lot of posts on how to add this link to a view or a data view in SharePoint Designer 2010, and it honestly took me a while to figure out where the markup I found actually needed to go. I will attempt to show you how I did this as clear as I can for someone who is new to SharePoint 2010 Designer as I am.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first thing I do is &lt;a href="http://office.microsoft.com/en-us/sharepoint-designer-help/create-sharepoint-site-pages-HA101782505.aspx"&gt;create a new web part page&lt;/a&gt;, doesn't matter where, just some where inside the site where your list lives. This page will just be testing/build page for our dataview.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once created, edit the new page (Advanced mode is optional). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Important: &lt;/span&gt;&lt;span class="Apple-style-span"&gt;This is the silly part, &lt;/span&gt;but if you aren't aware of the new interface subtleties, it can haunt you for hours, as it did me. :P&lt;/div&gt;&lt;div&gt;Click in a web part zone in the editor, then on the ribbon, the "INSERT" tab should be available, Click the "DATA VIEW" and choose "Empty Data View". The reason for this is, over choosing the list directly from this menu, is that the XSL template code is different (and hidden by default) than what you may be used to in 2007. &lt;/div&gt;&lt;div&gt;&lt;img src="http://2.bp.blogspot.com/-CLAwdPHBuoE/TegCCjsVLtI/AAAAAAAAABg/OAlDQCaEAgQ/s320/DVMenu.jpg" style="cursor:pointer; cursor:hand;width: 176px; height: 320px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5613739178481495762" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From here you click on the empty data view to choose a data source (this is where you pick your list) and then the fields from that list you want to display. For this exercise you will at least need the "&lt;b&gt;Attachments&lt;/b&gt;" field.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/-RXLgDpq01uU/TegDWMYB8xI/AAAAAAAAABo/i4_XGrZq6ow/s320/DataFields.JPG" style="cursor:pointer; cursor:hand;width: 319px; height: 262px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5613740615331345170" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once your Attachments field is on your data view, we can now go into the XSL in code view and add some simple markup.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you can see at several posts I've found (&lt;a href="http://sharepointjim.wordpress.com/2009/08/23/display-attachments-in-sharepoint-dataview-webpart-using-sharepoint-designer/"&gt;Jim Mathew's Blog being one of them&lt;/a&gt;) you simply need to add: &lt;p&gt;&amp;lt;SharePoint:AttachmentsField ControlMode=”Display” ItemId=”&lt;a href="mailto:{@ID"&gt;{@ID&lt;/a&gt;}” EnableViewState=”true” FieldName=”Attachments”  runat=”server”/&amp;gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As seen below in the XSL test block... in this case, the default content in this block is the word "Yes". I replaced the word "Yes" with the markup:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/-dIwG9OoKi9s/TegIWAGOyYI/AAAAAAAAAB4/30oM3NrP8l8/s1046/AttachmentLinkCode.JPG" style="cursor:pointer; cursor:hand;width: 1046px;  border=" alt="" id="BLOGGER_PHOTO_ID_5613746109593602434" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Save the page, browse to it and your attachment(s) links should display.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I took it a step further and added query string value filtering for use within the system I was building, so that you could see all attachments for all list items for a specific project.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this helps!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1285803282961005804-2752007541796073438?l=ericlands.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ericlands.blogspot.com/feeds/2752007541796073438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ericlands.blogspot.com/2011/06/sharepoint-2010-adding-list-attachments.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/2752007541796073438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/2752007541796073438'/><link rel='alternate' type='text/html' href='http://ericlands.blogspot.com/2011/06/sharepoint-2010-adding-list-attachments.html' title='SharePoint 2010: Adding List Attachments as Links in a DataView Webpart'/><author><name>Eric Land</name><uri>http://www.blogger.com/profile/02347414493756468655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_MMehgHc1Olo/SrvAQLFTXtI/AAAAAAAAAAU/bGxd1eQ0s8I/S220/4simpsons1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-CLAwdPHBuoE/TegCCjsVLtI/AAAAAAAAABg/OAlDQCaEAgQ/s72-c/DVMenu.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1285803282961005804.post-3424566124857695777</id><published>2009-10-09T10:15:00.000-07:00</published><updated>2009-10-09T10:15:44.589-07:00</updated><title type='text'>ReBlog: Things that Should be Easy: Presence Awareness in WSS V2 and WSS V3</title><content type='html'>&lt;a href="http://thingsthatshouldbeeasy.blogspot.com/2008/08/presence-awareness-in-wss-v2-and-wss-v3.html"&gt;Things that Should be Easy: Presence Awareness in WSS V2 and WSS V3&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I found this post today when working out some issues I seem to be having on my machine while looking at the presence of users. There's some good stuff in here. When I get the issues worked out, I will detail my findings as a follow up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1285803282961005804-3424566124857695777?l=ericlands.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ericlands.blogspot.com/feeds/3424566124857695777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ericlands.blogspot.com/2009/10/reblog-things-that-should-be-easy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/3424566124857695777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/3424566124857695777'/><link rel='alternate' type='text/html' href='http://ericlands.blogspot.com/2009/10/reblog-things-that-should-be-easy.html' title='ReBlog: Things that Should be Easy: Presence Awareness in WSS V2 and WSS V3'/><author><name>Eric Land</name><uri>http://www.blogger.com/profile/02347414493756468655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_MMehgHc1Olo/SrvAQLFTXtI/AAAAAAAAAAU/bGxd1eQ0s8I/S220/4simpsons1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1285803282961005804.post-1007920894188582002</id><published>2009-10-01T14:50:00.001-07:00</published><updated>2009-10-01T14:53:51.890-07:00</updated><title type='text'>A simple method for finding Active Directory user information using C# with LDAP</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;I spent hours trying to find a simple way to get user data our of AD from an LDAP query. Turns out you don't need to do a lot of crazy stuff, and looking at my code when I was done, it turned out to be a lot easier than it seemed when I started out.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The only thing I need to pass in to my function was the name of the property (&lt;a href='http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory.htm'&gt;see the list here&lt;/a&gt;), and the username. In my case it was coming from some other logic I had to write to get the users of a group that was a member of a SharePoint site.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Also the ldapPath I pass in to the DirectorySearcher constructor was simply "LDAP://mydomain.com"&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This returns the value of the property of the user that you specify as a string. Example:&lt;br /&gt;&lt;/p&gt;&lt;p style='margin-left: 27pt'&gt;getValidADProps("mail", "Ima User") will return the AD email address for Ima User. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;In the function, I used a try/catch in the instance that the property you are trying to find isn't there, you will get a index out of range error.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I will say that this is not the more lightweight method, according to my findings. For a more specific return set from the searcher you may want to look into the &lt;a href='http://msdn.microsoft.com/en-us/library/system.directoryservices.directorysearcher.propertiestoload.aspx'&gt;PropertiesToLoad&lt;/a&gt; Property of the class.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        public string getValidADProps(string _prop, string _username)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        {&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            DirectorySearcher ds = new DirectorySearcher(ldapPath);&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            ds.SearchScope = SearchScope.Subtree;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            ds.Filter = "samaccountname=" + _username;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            SearchResult sr = ds.FindOne();&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            try&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            {&lt;br /&gt;&lt;/p&gt;&lt;p&gt;                if (!string.IsNullOrEmpty(sr.Properties[_prop][0].ToString()))&lt;br /&gt;&lt;/p&gt;&lt;p&gt;                {&lt;br /&gt;&lt;/p&gt;&lt;p&gt;                    return sr.Properties[_prop][0].ToString();&lt;br /&gt;&lt;/p&gt;&lt;p&gt;                }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            catch (Exception)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            {&lt;br /&gt;&lt;/p&gt;&lt;p&gt;                return string.Empty;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;            return  string.Empty;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        }&lt;br /&gt;&lt;/p&gt;&lt;p&gt; &lt;br /&gt; &lt;/p&gt;&lt;p&gt;HTH,&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Eric&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1285803282961005804-1007920894188582002?l=ericlands.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ericlands.blogspot.com/feeds/1007920894188582002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ericlands.blogspot.com/2009/10/simple-method-for-finding-active.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/1007920894188582002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/1007920894188582002'/><link rel='alternate' type='text/html' href='http://ericlands.blogspot.com/2009/10/simple-method-for-finding-active.html' title='A simple method for finding Active Directory user information using C# with LDAP'/><author><name>Eric Land</name><uri>http://www.blogger.com/profile/02347414493756468655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_MMehgHc1Olo/SrvAQLFTXtI/AAAAAAAAAAU/bGxd1eQ0s8I/S220/4simpsons1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1285803282961005804.post-8994499826594800104</id><published>2009-09-23T19:10:00.000-07:00</published><updated>2009-09-23T20:15:39.018-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint; Properties; UserProfile'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>A cool way to use Properties in a SharePoint Web Part</title><content type='html'>Properties are nothing new in OOP, but something that I stumbled upon not too long ago was a cool thing that you could do with properties. My work was SharePoint web part related, but I imagine that it would work with any customized object that can be called in your page.&lt;br /&gt;&lt;br /&gt;I needed a way to reuse a webpart that was accessing a single User Profile field so that I could display any field I wished, as many as I wanted just by simply dropping a new custom web part on my page in SPD and simply adding a name/value pair to the HTML.&lt;br /&gt;&lt;br /&gt;The idea here is to build your web part with a property:&lt;br /&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;        public string CustomProperty&lt;br /&gt;        {&lt;br /&gt;           &amp;nbsp;&amp;nbsp;get { return _CustomProperty; }&lt;br /&gt;            &amp;nbsp;&amp;nbsp;set { _CustomProperty= value; }&lt;br /&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Nothing crazy here but later in the code we check the CustomProperty property for a value and if it's valid, we go and grab the field from the User Profile database and then display it in the web part:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;WpNs0:ProfilePropertyPart runat="server" CustomProperty="FirstName" .../&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So the trick to making this work is to make sure you use the correct nomenclature for the value you pass into the CustomProperty property.&lt;br /&gt;&lt;br /&gt;The value you need is found on  View Profile page (found here - Central Admin/Shared Services/User Profiles and Properties/View Profile Properties).&lt;br /&gt;&lt;br /&gt;Find the field in the "Property Name" column, click it and chose "Edit" and in the Property Settings block, you should see a "Name" field and a "Display Name" field. &lt;span style="font-weight: bold;"&gt;You want to use the "NAME" field. SharePoint uses this as it's logical name and it is the value you need to pass into the CustomProperty property of the web part declaration!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this case with the "First Name" field, the SharePoint logical field is actually "FieldName" with no spaces. Some fields use the same value for 'Name' and 'Display Name', others are close like the 'First Name' but slightly different. and others still can have prefixes that don't make sense, ie. if you create a custom field, the value that SharePoint gave me for the 'Name' of the field was "SPS-Skills", which is what I passed in to the CutsomProperty property.&lt;br /&gt;&lt;br /&gt;Of course you'll need admin rights on the server to get to that page.&lt;br /&gt;&lt;br /&gt;I will go more into accessing values from the User Profile database in a future posting, but I thought this was a really cool thing you could do for an easy way to customize a web part so that you could reuse it and get different output simply by changing the value of a property in your html in designer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1285803282961005804-8994499826594800104?l=ericlands.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ericlands.blogspot.com/feeds/8994499826594800104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ericlands.blogspot.com/2009/09/cool-way-to-use-properties-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/8994499826594800104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/8994499826594800104'/><link rel='alternate' type='text/html' href='http://ericlands.blogspot.com/2009/09/cool-way-to-use-properties-in.html' title='A cool way to use Properties in a SharePoint Web Part'/><author><name>Eric Land</name><uri>http://www.blogger.com/profile/02347414493756468655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_MMehgHc1Olo/SrvAQLFTXtI/AAAAAAAAAAU/bGxd1eQ0s8I/S220/4simpsons1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1285803282961005804.post-3081403827637378140</id><published>2009-09-22T15:29:00.000-07:00</published><updated>2009-09-22T15:57:51.958-07:00</updated><title type='text'>Get users of AD group for use in SharePoint webpart.</title><content type='html'>Welcome to my first technical posting.&lt;br /&gt;&lt;br /&gt;My task here was simple, create a web part that displays the users of an Active Directory OU (Organizational Unit or group basically) which will have been added to a SharePoint site. This is our model internally going forward on how we are managing access to sites within our farm, so basically every site will only have one member... an AD group. This way we can manage (or let someone else manage) access through AD.&lt;br /&gt;&lt;br /&gt;I won't get into how to create a web part in this post (&lt;a href="http://msdn.microsoft.com/en-us/library/ms452873.aspx"&gt;you can start here if you like&lt;/a&gt;), but more of the guts of what I used to get what I needed out of .NET in a web part. This is really basic to the rendered output is nothing fancy.&lt;br /&gt;&lt;br /&gt;Basically I got the site's userlist from the site context, iterated the user list, checked to see if the user was a group, if so, called code to give me the AD users of that group and output the user list.&lt;br /&gt;First add a reference to:&lt;br /&gt;&lt;strong&gt;System.DirectoryServices.AccountManagement;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Here's the code:&lt;br /&gt;First: this code was inside the&lt;br /&gt;protected override void CreateChildControls() function.&lt;br /&gt;&lt;br /&gt;string currentUrl = System.Web.HttpContext.Current.Request.Url.ToString();&lt;br /&gt;SPSecurity.RunWithElevatedPrivileges(&lt;br /&gt;delegate()&lt;br /&gt;{&lt;br /&gt;using (SPSite site = new SPSite(currentUrl))&lt;br /&gt;{&lt;br /&gt;SPWeb web = site.OpenWeb();&lt;br /&gt;SPGroupCollection grps = web.Groups;&lt;br /&gt;foreach (SPGroup group in grps) &lt;br /&gt;{&lt;br /&gt;if (group.Name == web.AssociatedMemberGroup.ToString())  //This gets the users/group from the current site&lt;br /&gt;{&lt;br /&gt;Controls.Add(new LiteralControl("&lt;strong&gt;" +&lt;/strong&gt; group.Name &lt;strong&gt;+ "&lt;/strong&gt;&lt;br /&gt;"));&lt;br /&gt;foreach (SPUser user in group.Users)&lt;br /&gt;{&lt;br /&gt;if (user.IsDomainGroup)&lt;br /&gt;{&lt;br /&gt;string groupName = user.Name.Remove(0,5);&lt;br /&gt;using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domainName))&lt;br /&gt;{&lt;br /&gt;if (ctx != null)&lt;br /&gt;{&lt;br /&gt;GroupPrincipal gp = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, groupName);&lt;br /&gt;if (gp != null)&lt;br /&gt;{&lt;br /&gt;foreach (Principal p in gp.GetMembers(true))&lt;br /&gt;{&lt;br /&gt;Controls.Add(new LiteralControl(p.Name + "&lt;br /&gt;")); ....(bracketd removed for brevity)&lt;br /&gt;&lt;br /&gt;Sorry for the lame code spit out, I'm still new to blogspot.&lt;br /&gt;One thing I wanted to point out here was:&lt;br /&gt;&lt;br /&gt;string groupName = user.Name.Remove(0,5); You can manipulate the string however you like (Substring etc.) but what took me a while to figure out was that GroupPrincipal.FindByIdentity expects the group name &lt;strong&gt;without&lt;/strong&gt; the domain\ prefix, so in my case my domain name is only four letters and a '\'. This took me way too long to figure out, and no offence to M$, but sometimes the documentation just doesn't specify that in easy to understand terms.&lt;br /&gt;&lt;br /&gt;Also, &lt;a href="http://blogs.technet.com/brad_rutkowski/archive/2008/04/15/c-getting-members-of-a-group-the-easy-way-with-net-3-5-discussion-groups-nested-recursive-security-groups-etc.aspx"&gt;here's a link to Brad Rutkowski's blog &lt;/a&gt;where I found the base code for getting members out of a group.&lt;br /&gt;&lt;br /&gt;Hope this helps someone out there.&lt;br /&gt;&lt;br /&gt;-Eric&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1285803282961005804-3081403827637378140?l=ericlands.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ericlands.blogspot.com/feeds/3081403827637378140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ericlands.blogspot.com/2009/09/get-users-of-ad-group-for-use-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/3081403827637378140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/3081403827637378140'/><link rel='alternate' type='text/html' href='http://ericlands.blogspot.com/2009/09/get-users-of-ad-group-for-use-in.html' title='Get users of AD group for use in SharePoint webpart.'/><author><name>Eric Land</name><uri>http://www.blogger.com/profile/02347414493756468655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_MMehgHc1Olo/SrvAQLFTXtI/AAAAAAAAAAU/bGxd1eQ0s8I/S220/4simpsons1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1285803282961005804.post-7315985725305066951</id><published>2009-09-22T15:14:00.000-07:00</published><updated>2009-09-22T15:28:42.360-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eric Land'/><category scheme='http://www.blogger.com/atom/ns#' term='Vaderland. SharePoint Blog'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Allow myself to introduce... myself.</title><content type='html'>Blogspot, here we go!&lt;br /&gt;&lt;br /&gt;Okay, so I have a MySpace page, facebook, friendster, twitter, Tumblr, and now a blogspot account. The reason for this new blog for me is that I never really had a place to put things about what I learn in my career anywhere. All that other stuff is fun and cool for keeping in the loop about all things viral and fun, but none of them are really places that I could put anything of substance.&lt;br /&gt;&lt;br /&gt;My goal for this blog is to mainly put things up here that I learn about my chosen profession of web development. I have been a professional developer for about 4 years now, so not too awful long considering I graduate 4 years ago fresh into the industry. I know some things, and not a lot about a lot more, but hopefully, I can help someone following in my footsteps find the answers, in layman's terms to some difficult, and maybe not so difficult programming and web development issues, most of which going forward will probably be about programming web parts in Share Point 2007 and the upcoming (very soon) 2010. Most of my posts may seem very rudimentary to seasoned .NET professionals, but I surmise that no one person can know everything there is to know (well, except maybe for &lt;a href="http://www.scottgu.com/"&gt;Scott Guthrie&lt;/a&gt;) and we all have to start somewhere.&lt;br /&gt;&lt;br /&gt;Sit back and enjoy. I hope to post lots, but we'll see how that goes as time permits. I already have one post I want to share but I had to get this one out of the way.&lt;br /&gt;&lt;br /&gt;Thank you,&lt;br /&gt;Eric&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1285803282961005804-7315985725305066951?l=ericlands.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ericlands.blogspot.com/feeds/7315985725305066951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ericlands.blogspot.com/2009/09/allow-myself-to-introduce-myself.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/7315985725305066951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1285803282961005804/posts/default/7315985725305066951'/><link rel='alternate' type='text/html' href='http://ericlands.blogspot.com/2009/09/allow-myself-to-introduce-myself.html' title='Allow myself to introduce... myself.'/><author><name>Eric Land</name><uri>http://www.blogger.com/profile/02347414493756468655</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_MMehgHc1Olo/SrvAQLFTXtI/AAAAAAAAAAU/bGxd1eQ0s8I/S220/4simpsons1.jpg'/></author><thr:total>0</thr:total></entry></feed>
