# ChangeUserName returns SDKError 2

**URL:** <https://devforum.zoom.us/t/changeusername-returns-sdkerror-2/95550>\
**Category:** Windows\
**Created:** [September 21, 2023, 4:23pm UTC](https://devforum.zoom.us/t/changeusername-returns-sdkerror-2/95550 "2023-09-21T16:23:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oren.nahum1](https://avatars.discourse-cdn.com/v4/letter/o/ad7895/32.png) [@oren.nahum1](https://devforum.zoom.us/u/oren.nahum1)\
**Post date:** [September 21, 2023, 4:23pm UTC](https://devforum.zoom.us/t/changeusername-returns-sdkerror-2/95550/1 "2023-09-21T16:23:17Z")

</div>

**Description**  
ChangeUserName (from `IMeetingParticipantsController `) returns SDKError 2, when trying to change my own name (the SDKDemo user).

**Which Windows Meeting SDK version?**  
5.14.5.15340

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Have the SDK demo join any meeting.
2. Inside any callback, e.g. `onUserJoin`, run these lines of code:

```auto
void CMeetingServiceMgr::onUserJoin(IList<unsigned int >* lstUserID, const wchar_t* strUserList)
{
	// virtual SDKError ChangeUserName(const unsigned int userid, const wchar_t* userName, bool bSaveUserName) = 0;
	auto res = m_pUserCtrl->ChangeUserName(ZoomSDKUserId, L"NewName", false);
	std::stringstream s;
	s << "res: " << res;
	::log(s.str());
}

```

**Logs**

```auto
2023-09-21 15:08:45.100 3612909816Chorus911183868F47829455DAED58668858A7184 res: 2

```

**Device (please complete the following information):**

- Device: HP Zenbook laptop
- OS: Windows 10

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [September 22, 2023, 4:13am UTC](https://devforum.zoom.us/t/changeusername-returns-sdkerror-2/95550/2 "2023-09-22T04:13:04Z")

</div>

@oren.nahum1 ,

This method can only be called be used by host or co-host

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/f/ef18fb0dc8af421df06ed4aaf57ed9eb4b39f121.png)

[https://marketplacefront.zoom.us/sdk/meeting/windows/class\_i\_meeting\_participants\_controller.html#a6331a70898b10eb22c8acd5f3e7b6995](https://marketplacefront.zoom.us/sdk/meeting/windows/class_i_meeting_participants_controller.html#a6331a70898b10eb22c8acd5f3e7b6995)

---

<div class="post-metadata">

**Author:** ![oren.nahum1](https://avatars.discourse-cdn.com/v4/letter/o/ad7895/32.png) [@oren.nahum1](https://devforum.zoom.us/u/oren.nahum1)\
**Post date:** [September 24, 2023, 10:42am UTC](https://devforum.zoom.us/t/changeusername-returns-sdkerror-2/95550/3 "2023-09-24T10:42:12Z")

</div>

Thanks @chunsiong.zoom !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 24, 2023, 8:42pm UTC](https://devforum.zoom.us/t/changeusername-returns-sdkerror-2/95550/4 "2023-10-24T20:42:33Z")

</div>

Closed on October 24, 2023, 8:42pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
