我正在尝试使用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()