October 10, 2009

Happy Saturday!

Happy Saturday everyone!

October 9, 2009

Crazy Production Issues Today!

We are seeing really odd things in our production environment! Logs say nothing, servers look fine, db looks fine, developers are saying it's not code :)

Ughh!

October 8, 2009

WebsiteSpark Program

I first read about it here. This is going to be helpful for me as I continue to work on my current project. It will be very nice to get a few free licenses as that will help keep costs down. An excerpt:

WebsiteSpark is designed for independent web developers and web development companies that build web applications and web sites on behalf of others. It enables you to get software, support and business resources from Microsoft at no cost for three years, and enables you to expand your business and build great web solutions using ASP.NET, Silverlight, SharePoint and PHP, and the open source applications built on top of them.

October 7, 2009

Free CDN from Microsoft

Microsoft is giving us a content delivery network for ajax and jquery! This is really cool and very helpful. You can read all about it here.

October 6, 2009

WebDeploy Auto-Complete UI

This is cool...check it out!

October 5, 2009

Working with Active Directory and C# -- sample code

After 8 posts on this, I think it makes sense to just give the link to the files here:

The ADLib code can be found here. This contains:

1. AdGroup: interface (IADsGroup) for group
2. AdUser: interface (IADsUser) for user
3. GroupType: enum of group types in AD
4. AdDomain: Policy, Password, Group and User Interaction within AD
5. Go here for the dotnetdevguide...and buy the book as well!

Active Directory and C# VII

Time to continue this series of posts on the domain side. You can download all the files from here. I will upload this file from this post this week. You can see the first post related to this class file here. This post refers to policy and password in AD.
 public DateTime GetPasswordLastChanged(DirectoryEntry entry)
{
return ((IADsUser)entry.NativeObject).PasswordLastChanged;
}

public DateTime GetPasswordExpirationDate(DirectoryEntry entry)
{
return ((IADsUser)entry.NativeObject).PasswordExpirationDate;
}

public bool ChangePasswordAtNextLogon(DirectoryEntry entry)
{
// MSDN: pswLastSet
// If this value is set to 0 and the User-Account-Control attribute
// does not contain the UF_DONT_EXPIRE_PASSWD flag, then the user must
// set the password at the next logon.

if (PasswordNeverExpires(entry))
return false;

Int64 val = 0;

try
{
val = UnboxAdsiInt64(entry.Properties["pwdLastSet"].Value);
}
catch (Exception)
{
val = 0;
}

return (val == 0);
}

public bool PasswordNeverExpires(DirectoryEntry entry)
{
return GetUserAccountControlFlag(entry, ADS_USER_FLAG.ADS_UF_DONT_EXPIRE_PASSWD);
}

public bool GetUserAccountControlFlag(DirectoryEntry entry, ADS_USER_FLAG flag)
{
int userAccountControl = (int)entry.Properties["userAccountControl"].Value;
return (userAccountControl & (int)flag) != 0;
}

///
/// Gets the Password Expiration
/// Date for a domain user
/// Returns MaxValue if never expiring
/// Returns MinValue if user must
/// change password at next logon
///

///
///
public DateTime GetPasswordExpiration(DirectoryEntry user)
{
return new PasswordExpires(GetPolicy()).GetExpiration(user);
}

private DomainPolicy GetPolicy()
{
lock(this)
{
if(_policy == null)
_policy = new DomainPolicy(OpenRootDSE());

return _policy;
}
}

October 4, 2009

Great Weekend!

I hope everyone is enjoying the weekend!