2014-12-22 2 views
2

PowerShell을 통해 AD 사용자를 가져 오는 클라이언트와 함께 작업하고 있습니다. 다음 명령은 초기 검사로 사용되는 :PowerShell을 사용하여 Active Directory hashedPassword 필드를 자동으로 채우는 방법

이 그것을 올바르게 AD 사용자를 생성하는에, 일을 표시
New-ADUser -Name "John Smith" ` 
      -SamAccountName Smithbor ` 
      -GivenName John ` 
      -Surname Smith ` 
      -EmailAddress [email protected] ` 
      -Path 'OU=Users,DC=stackoverflow,DC=com' ` 
      -ChangePasswordAtLogon $false ` 
      -Enabled $true ` 
      -AccountPassword (ConvertTo-SecureString -AsPlainText "foo12345678" -Force) 

는, 그러나 hashedPassword 필드가 채워되지 않고,이 hashedPassword 필드는 몇 가지 더 필요합니다 완성. 이 단계에서 hashedPassword 필드를 자동으로 채우는 방법이 있습니까?

답변

1

암호 정책 제한으로 인해 암호 설정이 실패 할 수 있습니다. 계정을 만든 후에 Set-ADAccountPassword을 사용하여 암호를 설정할 수 있습니다.

Set-ADAccountPassword -Identity username -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "password" -Force) 
관련 문제