From what I know, there are two Active Directory attributes: msIIS-FTPRoot, msIIS-FTPDir.
From Technet
Basically, the user's home folder is determined upon authentication by querying the msIIS-FTPRoot and msIIS-FTPDir attributes of the user object in Active Directory. The concatenation of the msIIS-FTPRoot and msIIS-FTPDir values results in the path to the user's home folder.
An example may look like this:
msIIS-FTPRoot = D:\FTP Users
msIIS-FTPDir = \JohnSmith
This will result in "D:\FTP Users\JohnSmith" as the home folder for the user.
Code to traverse all the users and there default directories:
static void Main(string[] args)
{
string domain = Environment.GetEnvironmentVariable("USERDNSDOMAIN");
string dc = GetDC(domain);
string ldap = String.Format("LDAP://{0}/{1}", domain, dc);
DirectoryEntry e = new DirectoryEntry(ldap);
DirectorySearcher src = new DirectorySearcher(e, "(objectClass=user)");
SearchResultCollection res = src.FindAll();
foreach (SearchResult r in res)
{
DirectoryEntry f = r.GetDirectoryEntry();
Console.WriteLine(f.Name + "\t" + f.Properties["msIIS-FTPRoot"].Value + f.Properties["msIIS-FTPDir"].Value);
}
Console.ReadKey();
}
private static string GetDC(string domain)
{
StringBuilder sb = new StringBuilder(domain);
sb.Replace(".", ",DC=");
sb.Insert(0, "DC=");
return sb.ToString();
}