Powershell 1.0 script to update Active Directory FTP User isolation attributes (msIIS-FTPDir, msIIS-FTPRoot)

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


 

3 thoughts on “Powershell 1.0 script to update Active Directory FTP User isolation attributes (msIIS-FTPDir, msIIS-FTPRoot)”

  1. 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?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s