I recently posted an article how to setup FTP User Isolation and Active Directory together. Here is the article. In the post, I mentioned you’ll need to engage your AD administrator to update the two attributes. Here is a script using Powershell 1.0. You could expand the script to take parameters (domain controller, distinguishedName and the two attributes). The user account that runs the script needs the proper permissions in Active Directory.
$objUser = [ADSI]”LDAP://192.168.1.1/CN=UserNameHere,OU=People,DC=SteveSchofield,DC=local“
$objUser.Put(“msIIS-FTPDir”, “UserNameHere”)
$objUser.Put(“msIIS-FTPRoot”, “\ServerShare”)
$objUser.setInfo()
I tested the script on a w2k8 domain controller and from my Windows XP machine (I used the Runas command)
Cheers,
Steve Schofield
Microsoft MVP – IIS
This is a great thing for one user. I have one question though, if I need to run this for a large number of users in a domain how would I accomplish that?
define large? I would think you would expand on what the article does. I can see using this for a large number of users.
Oh sorry, I mis-understood. Ignore my reply. You’ll have to add some logic to recurse AD to get the user object and loop through running this logic.