DirectoryServices.AccountManagement用户配置文件配置文件路径

时间:2013-06-20 16:21:32

标签: vb.net

我正在尝试使用VB.NET DirectoryServices.AccountManagement在Active Directory中添加用户配置文件配置文件路径信息,但似乎无法执行此操作。我可以添加我需要的所有其他字段,包括Logon Script,它与Profile Path在同一个标​​签中。

我一直在关注UserPrincipal at MS但我看不到与Profile Path有关的任何内容。

相关代码:

    Dim ctx As New PrincipalContext(ContextType.Domain, "sometext", "OU=Domain Objects,DC=sometext,DC=local")

    Dim user As New UserPrincipal(ctx, "NewUser", "pass@1w0rd01", True)

    user.GivenName = "GivenName"
    user.Surname = "Surname"
    user.HomeDirectory = "\\MyHomeDirectory\"
    user.HomeDrive = "Z:"

    user.ExpirePasswordNow()

    user.Save()

0 个答案:

没有答案
相关问题