> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XUserGetAgeGroup

> XUserGetAgeGroup

Returns the age group of a user.

## Syntax

```cpp theme={null}
HRESULT XUserGetAgeGroup(  
         XUserHandle user,  
         XUserAgeGroup* ageGroup  
)  
```

### Parameters

*user*   \_In\_\
Type: XUserHandle

The user to get the age group of.

*ageGroup*   \_Out\_\
Type: [XUserAgeGroup\*](https://docs.xbox.com/reference/system/xuser/enums/xuseragegroup.md)

Contains the age group of the user.

### Return value

Type: HRESULT

HRESULT success or error code.

| Return Code | Description |
| - | - |
| S\_OK | The operation succeeded. |
| E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED | The user must use a UI to resolve the issue. Call [XUserResolveIssueWithUiAsync](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveissuewithuiasync.md) to display the UI to the user. |

## Remarks

Retrieves the user's [XUserAgeGroup](https://docs.xbox.com/reference/system/xuser/enums/xuseragegroup.md). **E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED** indicates there is a problem that the user needs to resolve using system UI before the code can retrieve the property. In that case, [XUserResolveIssueWithUiAsync](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveissuewithuiasync.md) can be used to trigger the system UI needed to resolve the issue.

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, Steam Deck, XBOX One family consoles and XBOX Series consoles

## See also

[XUser](https://docs.xbox.com/reference/system/xuser/xuser_members.md)

[XUserResolveIssueWithUiAsync](https://docs.xbox.com/reference/system/xuser/functions/xuserresolveissuewithuiasync.md)


## Related topics

- [XUserAgeGroup](https://docs.xbox.com/reference/system/xuser/enums/xuseragegroup.md)
- [XUserGetGamertag](https://docs.xbox.com/reference/system/xuser/functions/xusergetgamertag.md)
- [XUserGetMaxUsers](https://docs.xbox.com/reference/system/xuser/functions/xusergetmaxusers.md)
- [XUserGetLocalId](https://docs.xbox.com/reference/system/xuser/functions/xusergetlocalid.md)
- [XR-013 Linking Microsoft Accounts with Publisher Accounts](https://docs.xbox.com/publishing/certification/xr/xr-013.md)
