Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds command 'tenant people profilecardproperty add'. Closes #5617 #5624

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
174 changes: 174 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,174 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# tenant people profilecardproperty add

Adds an additional attribute to the profile card properties

## 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`, `Fax`, `StreetAddress`, `PostalCode`, `StateOrProvince`, `Alias`, `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 this together with a custom extension attribute.
```

<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"`.

:::

Jwaegebaert marked this conversation as resolved.
Show resolved Hide resolved
:::caution

When adding an attribute to a profile card, it takes up to 24 hours for the addition to be displayed.

:::

## Examples

Add the UPN as a profile property to the profile cards properties

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

Add a custom extension attribute _Cost Center_ as a profile property to the profile cards properties

```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 properties 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
{
"directoryPropertyName": "UserPrincipalName",
"annotations": []
}
```

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

```text
annotations : []
directoryPropertyName: UserPrincipalName
```

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

```csv
directoryPropertyName
UserPrincipalName
```

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

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

Date: 11/2/2023

Property | Value
---------|-------
directoryPropertyName | UserPrincipalName
```

</TabItem>
</Tabs>

### Response with a customAttribute

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

<Tabs>
<TabItem value="JSON">

```json
{
"directoryPropertyName": "customAttribute1",
"annotations": [
{
"displayName": "Cost center",
"localizations": [
{
"languageTag": "nl-NL",
"displayName": "Kostenplaats"
}
]
}
]
}
```

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

```text
directoryPropertyName: customAttribute1
displayName : Cost center
displayName nl-NL : Kostenplaats
```

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

```csv
directoryPropertyName,displayName,displayName nl-NL
customAttribute1,Cost center,Kostenplaats
```

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

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

Date: 11/2/2023

Property | Value
---------|-------
directoryPropertyName | customAttribute1
displayName | Cost center
displayName nl-NL | Kostenplaats
```

</TabItem>
</Tabs>

## More information

- https://learn.microsoft.com/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