> For the complete documentation index, see [llms.txt](https://o2oa.gitbook.io/course/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://o2oa.gitbook.io/course/ping-tai-shi-shi/zu-zhi-guan-li/untitled/ren-yuan-xin-xi.md).

# 人员信息

### **1.  获取人员信息：getPerson**

| **函数说明**                                                                                   | var personObj = this.org.getPerson(name)                       |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| **参数说明**                                                                                   | name : （string）必选，人员的distinguishedName \| id \| unique \| name |
| **返回值**                                                                                    | personObj 返回人员的对象                                              |
| **脚本示例**                                                                                   |                                                                |
| <p>var personObj = this.org.getPerson("林玲@linling\@P");</p><p>return personObj.mobile;</p> |                                                                |

### &#xD;**2. 查询下级人员：listSubPerson**

| **函数说明**                                                     | var person\_array = this.org.listSubPerson (name,\[true\|false]) |    |        |                                                        |
| ------------------------------------------------------------ | ---------------------------------------------------------------- | -- | ------ | ------------------------------------------------------ |
| **参数说明**                                                     | <p>name : （string）必选，人员的distinguishedName                        | id | unique | name</p><p>nested  布尔  true嵌套下级；false直接下级；默认false；</p> |
| **返回值**                                                      | person\_array 返回人员的对象数组                                          |    |        |                                                        |
| **脚本示例**                                                     |                                                                  |    |        |                                                        |
| var person\_array = this.org.listSubPerson ("林林@linlin\@P"); |                                                                  |    |        |                                                        |

### &#xD;**3. 查询上级人员：listSupPerson**

| **函数说明**                                                    | var person\_array = this.org.listSupPerson(name,\[true\|false]) |    |        |                                                        |
| ----------------------------------------------------------- | --------------------------------------------------------------- | -- | ------ | ------------------------------------------------------ |
| **参数说明**                                                    | <p>name : （string）必选，人员的distinguishedName                       | id | unique | name</p><p>nested  布尔  true嵌套上级；false直接上级；默认false；</p> |
| **返回值**                                                     | person\_array 返回人员的对象数组                                         |    |        |                                                        |
| **脚本示例**                                                    |                                                                 |    |        |                                                        |
| var person\_array = this.org.listSupPerson("林林@linlin\@P"); |                                                                 |    |        |                                                        |

### &#xD;**4. 获取群组的所有人员：listPersonWithGroup**

| **函数说明**                                                  | var person\_array = this.org.listPersonWithGroup(name); |
| --------------------------------------------------------- | ------------------------------------------------------- |
| **参数说明**                                                  | name : （string）必选，群组名                                   |
| **返回值**                                                   | person\_array 返回人员的对象数组                                 |
| **脚本示例**                                                  |                                                         |
| var person\_array = this.org.listPersonWithGroup ("人力组"); |                                                         |

### &#xD;&#x35;**. 获取角色的所有人员：listPersonWithRole**

| **函数说明**                                                    | var person\_array = this.org.listPersonWithRole(name); |
| ----------------------------------------------------------- | ------------------------------------------------------ |
| **参数说明**                                                    | name : （string）必选，角色名                                  |
| **返回值**                                                     | person\_array 返回人员的对象数组                                |
| **脚本示例**                                                    |                                                        |
| var person\_array = this.org.listPersonWithRole("Manager"); |                                                        |

### **6.获取指定身份的所有人员：listPersonWithIdentity**

**函数说明**

| var person\_array = this.org.listPersonWithIdentity(name);                                         |                          |
| -------------------------------------------------------------------------------------------------- | ------------------------ |
| **参数说明**                                                                                           | name : （string）必选，身份唯一编码 |
| **返回值**                                                                                            | person\_array 返回人员的对象数组  |
| **脚本示例**                                                                                           |                          |
| var person\_array = this.org.listPersonWithIdentity("李杰@114849cc-eb77-4217-bd15-00b449acbdbb\@I"); |                          |

### &#xD;**7. 查询组织成员的人员：listPersonWithUnit**

| **函数说明**                                                                                                                            | var person\_array = this.org.listPersonWithUnit (name,\[true\|false]);                |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **参数说明**                                                                                                                            | <p>name : （string）必选，组织的DN或者唯一编码</p><p>nested  布尔  true嵌套的所有成员；false直接成员；默认false；</p> |
| **返回值**                                                                                                                             | person\_array 返回人员的对象数组                                                               |
| **脚本示例**                                                                                                                            |                                                                                       |
| <p>var name ="内控管理部@2462e85b-ebad-4cfe-b264-866e80c349bf\@U";</p><p>var person\_array = this.org.listPersonWithUnit(name,true);</p> |                                                                                       |
