다음을 통해 공유


고객의 사용자 암호 다시 설정

암호를 재설정하는 것은 고객의 기존 사용자 계정에서 다른 세부 정보를 업데이트하는 것과 유사합니다.

전제 조건

  • 자격 증명(파트너 센터 인증에서 설명). 이 시나리오는 앱 + 사용자 자격 증명을 사용한 인증만 지원합니다.

  • 고객 ID (customer-tenant-id). 고객의 ID를 모르는 경우 파트너 센터에서 조회할 수 있습니다. 파트너 센터 홈페이지에서 고객 작업 영역을 선택합니다. 고객 목록에서 고객을 선택한 다음, 계정을 선택합니다. 고객의 계정 페이지에서 고객 계정 세부 정보 섹션에서 Microsoft ID를 찾습니다. Microsoft ID는 고객 ID(customer-tenant-id)와 동일합니다.

GDAP 역할

다음 GDAP 역할 중 하나 이상이 필요합니다.

  • 사용자 관리자
  • 권한 있는 인증 관리자

C#

지정된 고객 사용자의 암호를 다시 설정하려면 먼저 지정된 고객 ID와 대상 사용자를 검색합니다. 그런 다음, 기존 고객에 대한 정보를 포함하지만 새 PasswordProfile 개체를 사용하여 새 CustomerUser 개체를 만듭니다. 그런 다음, IAggregatePartner.Customers 컬렉션을 사용하고 ById() 메서드를 호출합니다. 그런 다음 Users 속성, ById() 메서드 및 Patch 메서드를 호출합니다.

// IAggregatePartner partnerOperations;
// string selectedCustomerId;
// CustomerUser specifiedUser;

var selectedCustomer = partnerOperations.Customers.ById(selectedCustomerId).Get();
var userToUpdate = new CustomerUser()
   {
      PasswordProfile = new PasswordProfile() { ForceChangePassword = true, Password = "newPassword" },
      DisplayName = "Roger Federer",
      FirstName = "Roger",
      LastName = "Federer",
      UsageLocation = "US",
      UserPrincipalName = Guid.NewGuid().ToString("N") + "@" + selectedCustomer.CompanyProfile.Domain.ToString()
   };

// update customer user information
User updatedCustomerUserInfo = partnerOperations.Customers.ById(selectedCustomerId).Users.ById(specifiedUser.Id).Patch(userToUpdate);

콘솔 테스트 앱. 프로젝트: PartnerSDK.FeatureSamples 클래스: CustomerUserUpdate.cs

REST 요청

요청 구문

메서드 요청 URI
패치 {baseURL}/v1/customers/{customer-tenant-id}/users/{user-id}/resetpassword HTTP/1.1

URI 매개 변수

다음 쿼리 매개 변수를 사용하여 올바른 고객을 식별합니다.

입력 종류 필수 설명
customer-tenant-id guid Y 값은 재판매인이 재판매인에 속한 지정된 고객에 대한 결과를 필터링할 수 있도록 하는 GUID 형식 의 customer-tenant-id 입니다.
user-id guid Y 값은 단일 사용자 계정에 속하는 GUID 형식 의 사용자 ID 입니다.

요청 헤더

자세한 내용은 파트너 센터 REST 헤더를 참조하세요.

요청 예제

PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/users/<user-id>/resetpassword HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: b1317092-f087-471e-a637-f66523b2b94c
MS-CorrelationId: 8a53b025-d5be-4d98-ab20-229d1813de76
{
     "passwordProfile":{
        password: "Renew456*",
        forceChangePassword: true
      },

      "attributes": {
        "objectType": "CustomerUser"
      }
}

REST 응답

성공하면 이 메서드는 업데이트된 암호 정보와 함께 사용자 정보를 반환합니다.

응답 성공 및 오류 코드

각 응답에는 성공 또는 실패와 추가 디버깅 정보를 나타내는 HTTP 상태 코드가 함께 제공됩니다. 네트워크 추적 도구를 사용하여 이 코드, 오류 유형 및 추가 매개 변수를 읽을 수 있습니다. 전체 목록은 오류 코드를 참조하세요.

응답 예제

HTTP/1.1 200 OK
Content-Length: 31942
Content-Type: application/json
MS-CorrelationId: 8a53b025-d5be-4d98-ab20-229d1813de76
MS-RequestId: b1317092-f087-471e-a637-f66523b2b94c
Date: June 24 2016 22:00:25 PST
{
  "usageLocation": "AX",
  "id": "95794928-9abe-4548-8b43-50ffc20b9404",
  "userPrincipalName": "aaaa4@abcdefgh1234.onmicrosoft.com",
  "firstName": "aaaa4",
  "lastName": "aaaa4",
  "displayName": "aaaa4",
  "passwordProfile": {
    "forceChangePassword": false,
    "password": "Renew456*"
  },
  "lastDirectorySyncTime": null,
  "userDomainType": "none",
  "state": "active",
  "softDeletionTime": null,
  "links": {
    "self": {
      "uri": "/customers/eebd1b55-5360-4438-a11d-5c06918c3014/users/95794928-9abe-4548-8b43-50ffc20b9404",
      "method": "GET",
      "headers": [

      ]
    }
  },
  "attributes": {
    "objectType": "CustomerUser"
  }
}