Wednesday, May 27, 2009

SP2 is out - But with some "minor" problems...

Be aware for the bug when installing the SP. There is a simple workaround, an hotfix soon to be released.

http://blogs.msdn.com/sharepoint/archive/2009/04/28/announcing-service-pack-2-for-office-sharepoint-server-2007-and-windows-sharepoint-services-3-0.aspx

Sunday, May 17, 2009

SPUserCollection is not including groups ? Or just a Bug in Wss 2.0 Object Model ?

Hey.

I wrote today a small application that need to track down all the administrators of all the websites in my client sharepoint farm ( and write the data into a list with the website url and etc ).

Anyway , just to remind you I was dealing with wss 2.0 ( 2003 ), I was doing very simple stuff as iterating via all web applications->SiteCollections->WebSites.
and then just wanted to get all the users ( including Active directory groups )

 
SPUserCollection colUser = web.AllUsers;
foreach(SPUser user in colUser)
{
// check if admin, update list and blah blah
}


Unfortunately, it gives you back only the regular users, and not the AD groups too. I know you have under the SPWeb object the groups/sitegroups property but both of them are for Sharepoint groups and not for AD group.
Moreover, Under the SPUser object you have the property IsDomainGroup ( like I cant ask for more ) - BUT sorry, it just gives you back regular users all the time, and just "ignore" the AD gorups.

What I did at the end ? Just made a query to the SQL table ( Not so good, cause It's not supported ) - I will try now with WebService, let's hope it work via that.

If you think i'm wrong or you have another idea. Please comment.