To be continued…
Monday, September 21, 2009
Event full weekend
To be continued…
Tuesday, September 15, 2009
Internal names should be used in SPQuery
I wanted to change the display names of my fields and after doing that I renamed all the usages of that field name in my web part code.
After deploying the solution I got the error message "One or more field types are not installed properly. Go to the list settings page to delete these fields"
I had no clue what so ever when you read that error message.This is not the only error message that share point generates which we cannot figure out by looking at this.
I spent considerable amount of time debugging the solution until I decided to Google the error message.
Then found that in one of the msdn forums that the internal names of the fields should be used in the CAML queries.
And that was indeed the trick.
Monday, September 14, 2009
US Open 2009 Men’s single final
Who would have thought, the world number 6 seed Juan Martin Del Porto , Argentinean, will storm into final , by beating Rafael Nadal in straight sets to face non other than world number one Roger Federer who never loss at US Open since 2004.Without a doubt Federer will do everything to make it 6 in a row at Flushing Meadows.
Even though Federer has a 6:0 winning ratio against Del Porto , he will be a tough opponent in this final.I cannot wait to see this match which is schedule at not before 16:00Hrs which is early tomorrow morning in my time.That’s a worrying sign for me.
more info at www.usopen.org
Wednesday, September 09, 2009
SharePoint 2007 and WSS 3.0 Dispose Patterns by Example
It is a good practice to make sure your solution is free of memory leaks.
Check this out :
Use the SPDisposeCheck utility to examine your code.
Further references on this subject
http://msdn.microsoft.com/en-us/library/aa973248.aspx
http://furuknap.blogspot.com/2009/08/spdisposecheck-in-visual-studio.html
Wednesday, September 02, 2009
How to create active directory users programmatically
Recently one of my colleagues wanted a piece of code which can be created 500 users in Active Directory for some testing purposes.Knowing that this won’t be a big challenge I said I will give it a try.
Frankly speaking, initially I thought this will be a easy walk in the park.Creating the user in AD part was a piece of cake but the created user was not enabled by default.
I had to figure out how to enable a user account programmatically.That was the only tricky part.
Check the user enabling code segment in the code.(Setting the "userAccountControl" property of the user)
Here is the code
References :string ldapPath = "LDAP://" + server + "/cn=Users,dc=ec,dc=test";
DirectoryEntry entry = new DirectoryEntry(ldapPath, user, pwd);
for (int i = 0; i < userCount; i++)
{
string tempName = userPrifix + i;
DirectoryEntry newUser = entry.Children.Add("CN=" + tempName, "user");
newUser.Properties["givenName"].Add(tempName);
newUser.Properties["userPrincipalName"].Add(tempName + "@ec.test");
newUser.Properties["sAMAccountName"].Add(tempName);
newUser.Password = userPwd;
newUser.CommitChanges();
// Enabling the above created account
int flags = (int)newUser.Properties["userAccountControl"].Value;
newUser.Properties["userAccountControl"].Value = flags & ~0x2;
newUser.CommitChanges();
newUser.Close();
entry.Close();
}
http://www.codeproject.com/KB/system/everythingInAD.aspx
http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory.htm