2013-06-20 3 views
1

나는 VB.NET DirectoryServices.AccountManagement 사용하여 Active Directory에 사용자 프로필 프로필 경로 정보를 추가하기 위해 노력하고있어하지만 그것을 할 수있을 것 같지 않습니다. 프로필 경로와 동일한 탭에있는 로그온 스크립트를 포함하여 필요한 다른 모든 필드를 추가 할 수 있습니다. DirectoryServices.AccountManagement 사용자 프로필 프로필 경로

나는 UserPrincipal at MS에서 찾고 있었어요하지만 난 길을 프로필에 관한 아무것도 볼 수 없습니다.

관련 코드 :

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

    Dim user As New UserPrincipal(ctx, "NewUser", "[email protected]", True) 

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

    user.ExpirePasswordNow() 

    user.Save() 

답변

1

이 늦은 하루에 작은하지만 단지 경우 다른 사람에서 찾고있다.

UserPrincipal 클래스는 어떤 이유로이 속성을 가지고 있지 않습니다. 당신은 UserPrincipal을 저장 후 기본 디렉토리 엔트리 를 얻을 수 있습니다.

DirectoryEntry entry = (DirectoryEntry)user.GetUnderlyingObject(); 
entry.Properties["profilePath"].Value = "somepath"; 
entry.CommitChanges();