Created
January 8, 2016 17:14
-
-
Save nikuyoshi/e4416f7b8783c22b8c95 to your computer and use it in GitHub Desktop.
Active Directory Service Interface(ADSI)を使用したプライマリグループの変更 ref: http://qiita.com/nikuyoshi/items/0a9d6bc47de81ae7b5eb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$primaryGroup = [adsi]"LDAP://CN=group1,OU=ou1,dc=hoge,dc=local" | |
$primaryGroup.GetInfoEx(@("primaryGroupToken"), 0) | |
$primaryGroupToken = $primaryGroup.Get("primaryGroupToken"); | |
$user = [adsi]("LDAP://CN=user1,OU=ou1,dc=hoge,dc=local") | |
$user.Put("primaryGroupId", $primaryGroupToken) | |
$user.SetInfo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment