Table of Contents

Interface IUserProfile

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

An entry point for the user profile APIs

public interface IUserProfile : IDataModel<IUserProfile>, IDataModelParent, IDataModelWithContext, ISupportModules<IUserProfile>, IDataModelGet<IUserProfile>, IDataModelLoad<IUserProfile>
Inherited Members
Extension Methods

Properties

The link to edit the current user's profile

string EditProfileLink { get; }

Property Value

string

IsMyPeopleListPublic

A Boolean value that indicates whether the current user's People I'm Following list is public.

bool IsMyPeopleListPublic { get; }

Property Value

bool

Methods

GetMyProperties(params Expression<Func<IPersonProperties, object>>[])

Gets user properties for the current user.

IPersonProperties GetMyProperties(params Expression<Func<IPersonProperties, object>>[] selectors)

Parameters

selectors Expression<Func<IPersonProperties, object>>[]

Specific properties to return

Returns

IPersonProperties

An instance of IPersonProperties

GetMyPropertiesAsync(params Expression<Func<IPersonProperties, object>>[])

Gets user properties for the current user.

Task<IPersonProperties> GetMyPropertiesAsync(params Expression<Func<IPersonProperties, object>>[] selectors)

Parameters

selectors Expression<Func<IPersonProperties, object>>[]

Specific properties to return

Returns

Task<IPersonProperties>

An instance of IPersonProperties

GetPropertiesFor(string, params Expression<Func<IPersonProperties, object>>[])

Gets user properties for the specified user.

IPersonProperties GetPropertiesFor(string accountName, params Expression<Func<IPersonProperties, object>>[] selectors)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

selectors Expression<Func<IPersonProperties, object>>[]

Specific properties to return

Returns

IPersonProperties

An instance of IPersonProperties

GetPropertiesForAsync(string, params Expression<Func<IPersonProperties, object>>[])

Gets user properties for the specified user.

Task<IPersonProperties> GetPropertiesForAsync(string accountName, params Expression<Func<IPersonProperties, object>>[] selectors)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

selectors Expression<Func<IPersonProperties, object>>[]

Specific properties to return

Returns

Task<IPersonProperties>

An instance of IPersonProperties

GetPropertyFor(string, string)

Gets the specified user profile property for the specified user.

string GetPropertyFor(string accountName, string propertyName)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

propertyName string

The case-sensitive name of the property to get.

Returns

string

The specified profile property for the specified user.

GetPropertyForAsync(string, string)

Gets the specified user profile property for the specified user.

Task<string> GetPropertyForAsync(string accountName, string propertyName)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

propertyName string

The case-sensitive name of the property to get.

Returns

Task<string>

The specified profile property for the specified user.

GetUserOneDriveQuotaMax(string)

Gets the user's onedrive max quota

long GetUserOneDriveQuotaMax(string accountName)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

Returns

long

The max quota value

GetUserOneDriveQuotaMaxAsync(string)

Gets the user's onedrive max quota

Task<long> GetUserOneDriveQuotaMaxAsync(string accountName)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

Returns

Task<long>

The max quota value

ResetUserOneDriveQuotaToDefault(string)

Resets the user's onedrive quota to the default value

string ResetUserOneDriveQuotaToDefault(string accountName)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

Returns

string

The string outcome

ResetUserOneDriveQuotaToDefaultAsync(string)

Resets the user's onedrive quota to the default value

Task<string> ResetUserOneDriveQuotaToDefaultAsync(string accountName)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

Returns

Task<string>

The string outcome

SetMultiValuedProfileProperty(string, string, IList<string>)

Sets the user's multi value profile property.

void SetMultiValuedProfileProperty(string accountName, string propertyName, IList<string> propertyValues)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

propertyName string

The case-sensitive name of the property to get.

propertyValues IList<string>

The property values

SetMultiValuedProfilePropertyAsync(string, string, IList<string>)

Sets the user's multi value profile property.

Task SetMultiValuedProfilePropertyAsync(string accountName, string propertyName, IList<string> propertyValues)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

propertyName string

The case-sensitive name of the property to get.

propertyValues IList<string>

The property values

Returns

Task

SetMyProfilePicture(byte[])

Uploads and sets the user profile picture. Users can upload a picture to their own profile only.

void SetMyProfilePicture(byte[] fileBytes)

Parameters

fileBytes byte[]

A byte array representing the file

SetMyProfilePictureAsync(byte[])

Uploads and sets the user profile picture. Users can upload a picture to their own profile only.

Task SetMyProfilePictureAsync(byte[] fileBytes)

Parameters

fileBytes byte[]

A byte array representing the file

Returns

Task

SetSingleValueProfileProperty(string, string, string)

Sets the user's profile property.

void SetSingleValueProfileProperty(string accountName, string propertyName, string propertyValue)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

propertyName string

The case-sensitive name of the property to get.

propertyValue string

The property value

SetSingleValueProfilePropertyAsync(string, string, string)

Sets the user's profile property.

Task SetSingleValueProfilePropertyAsync(string accountName, string propertyName, string propertyValue)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

propertyName string

The case-sensitive name of the property to get.

propertyValue string

The property value

Returns

Task

SetUserOneDriveQuota(string, long, long)

Sets the user's onedrive quota

string SetUserOneDriveQuota(string accountName, long newQuota, long newQuotaWarning)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

newQuota long

New quota value

newQuotaWarning long

Quota warning value

Returns

string

The string outcome

SetUserOneDriveQuotaAsync(string, long, long)

Sets the user's onedrive quota

Task<string> SetUserOneDriveQuotaAsync(string accountName, long newQuota, long newQuotaWarning)

Parameters

accountName string

The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"

newQuota long

New quota value

newQuotaWarning long

Quota warning value

Returns

Task<string>

The string outcome