Skip to content

Commit

Permalink
Adds command 'tenant people profilecardproperty add'. Closes #5617
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlingstuyl committed Nov 2, 2023
1 parent d9292ff commit bb45f87
Show file tree
Hide file tree
Showing 7 changed files with 612 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const dictionary = [
'audit',
'bin',
'builder',
'card',
'catalog',
'checklist',
'client',
Expand Down Expand Up @@ -68,6 +69,7 @@ const dictionary = [
'permission',
'place',
'policy',
'profile',
'property',
'records',
'recycle',
Expand Down
171 changes: 171 additions & 0 deletions docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# tenant people profilecardproperty add

Adds a custom attribute as a profile card property

## Usage

```sh
m365 tenant people profilecardproperty add [options]
```

## Options

```md definition-list
`-n, --name <name>`
: The name of the property to add. Allowed values: `userPrincipalName`, `faxNumber`, `streetAddress`, `postalCode`, `state`, `mailNickname`, `customAttribute1`, `customAttribute2`, `customAttribute3`, `customAttribute4`, `customAttribute5`, `customAttribute6`, `customAttribute7`, `customAttribute8`, `customAttribute9`, `customAttribute10`, `customAttribute11`, `customAttribute12`, `customAttribute13`, `customAttribute14`, `customAttribute15`

`-d, --displayName [displayName]`
: The display name of a property, only use together with custom extension attributes.
```

<Global />

## Remarks

:::info

To use this command you must be either **Tenant Administrator** or **Global Administrator**.

:::

:::info

You can specify localized values for the `displayName` as well. These can be entered by suffixing the displayName option with a language code: `--displayName-nl-NL "Kostencentrum" --displayName-de "Kostenstelle"`.

:::

## Examples

Add the UPN as a profile property to the profile cards

```sh
m365 tenant people profilecardproperty add --name userPrincipalName
```

Add a custom extension attribute Cost Center as a profile property to the profile cards

```sh
m365 tenant people profilecardproperty add --name customAttribute1 --displayName 'Cost Center'
```

Add a custom extension attribute Cost Center as a profile property to the profile cards with a dutch localization

```sh
m365 tenant people profilecardproperty add --name customAttribute1 --displayName 'Cost Center' --displayName-nl-NL 'Kostencentrum'
```

## Response

### Standard response

<Tabs>
<TabItem value="JSON">

```json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity",
"directoryPropertyName": "userPrincipalName",
"annotations": []
}
```

</TabItem>
<TabItem value="Text">

```text
@odata.context : https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity
annotations : []
directoryPropertyName: userPrincipalName
```

</TabItem>
<TabItem value="CSV">

```csv
@odata.context,directoryPropertyName
https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity,userPrincipalName
```

</TabItem>
<TabItem value="Markdown">

```md
# tenant people profilecardproperty add --name 'userPrincipalName'

Date: 11/2/2023

Property | Value
---------|-------
@odata.context | https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity
directoryPropertyName | userPrincipalName
```

</TabItem>
</Tabs>

### Response with an customAttribute

When we make use of one of the customAttributes, the response will differ.

<Tabs>
<TabItem value="JSON">

```json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity",
"directoryPropertyName": "customAttribute1",
"annotations": [
{
"displayName": "Cost center",
"localizations": [
{
"languageTag": "nl-NL",
"displayName": "Kostenplaats"
}
]
}
]
}
```

</TabItem>
<TabItem value="Text">

```text
@odata.context : https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity
annotations : [{"displayName":"Cost center","localizations":[{"languageTag":"nl-NL","displayName":"Kostenplaats"}]}]
directoryPropertyName: customAttribute1
```

</TabItem>
<TabItem value="CSV">

```csv
@odata.context,directoryPropertyName
https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity,customAttribute1
```

</TabItem>
<TabItem value="Markdown">

```md
# tenant people profilecardproperty add --name 'customAttribute1' --displayName 'Cost center' --displayName-nl-NL 'Kostenplaats'

Date: 11/2/2023

Property | Value
---------|-------
@odata.context | https://graph.microsoft.com/v1.0/$metadata#admin/people/profileCardProperties/$entity
directoryPropertyName | customAttribute1
```

</TabItem>
</Tabs>

## More information

- https://learn.microsoft.com/en-us/graph/add-properties-profilecard
9 changes: 9 additions & 0 deletions docs/src/config/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,15 @@ const sidebars = {
}
]
},
{
"people": [
{
type: 'doc',
label: 'people profilecardproperty add',
id: 'cmd/tenant/people/people-profilecardproperty-add'
}
]
},
{
report: [
{
Expand Down
1 change: 1 addition & 0 deletions src/m365/tenant/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const prefix: string = 'tenant';
export default {
ID_GET: `${prefix} id get`,
INFO_GET: `${prefix} info get`,
PEOPLE_PROFILECARDPROPERTY_ADD: `${prefix} people profilecardproperty add`,
REPORT_ACTIVEUSERCOUNTS: `${prefix} report activeusercounts`,
REPORT_ACTIVEUSERDETAIL: `${prefix} report activeuserdetail`,
REPORT_OFFICE365ACTIVATIONCOUNTS: `${prefix} report office365activationcounts`,
Expand Down
Loading

0 comments on commit bb45f87

Please sign in to comment.