Interface IUserProfile
An entry point for the user profile APIs
Assembly: PnP.Core.dll
Syntax
public interface IUserProfile : IDataModel<IUserProfile>, IDataModelParent, IDataModelWithContext, ISupportModules<IUserProfile>, IDataModelGet<IUserProfile>, IDataModelLoad<IUserProfile>
Properties
The link to edit the current user's profile
Declaration
string EditProfileLink { get; }
Property Value
A Boolean value that indicates whether the current user's People I'm Following list is public.
Declaration
bool IsMyPeopleListPublic { get; }
Property Value
Methods
Gets user properties for the current user.
Declaration
IPersonProperties GetMyProperties(params Expression<Func<IPersonProperties, object>>[] selectors)
Parameters
Expression<Func<IPersonProperties, System.Object>>[]
selectors
Specific properties to return
|
Returns
Gets user properties for the current user.
Declaration
Task<IPersonProperties> GetMyPropertiesAsync(params Expression<Func<IPersonProperties, object>>[] selectors)
Parameters
Expression<Func<IPersonProperties, System.Object>>[]
selectors
Specific properties to return
|
Returns
Gets user properties for the specified user.
Declaration
IPersonProperties GetPropertiesFor(string accountName, params Expression<Func<IPersonProperties, object>>[] selectors)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
Expression<Func<IPersonProperties, System.Object>>[]
selectors
Specific properties to return
|
Returns
Gets user properties for the specified user.
Declaration
Task<IPersonProperties> GetPropertiesForAsync(string accountName, params Expression<Func<IPersonProperties, object>>[] selectors)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
Expression<Func<IPersonProperties, System.Object>>[]
selectors
Specific properties to return
|
Returns
Gets the specified user profile property for the specified user.
Declaration
string GetPropertyFor(string accountName, string propertyName)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.String
propertyName
The case-sensitive name of the property to get.
|
Returns
System.String
The specified profile property for the specified user.
|
Gets the specified user profile property for the specified user.
Declaration
Task<string> GetPropertyForAsync(string accountName, string propertyName)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.String
propertyName
The case-sensitive name of the property to get.
|
Returns
Task<System.String>
The specified profile property for the specified user.
|
Gets the user's onedrive max quota
Declaration
long GetUserOneDriveQuotaMax(string accountName)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
Returns
System.Int64
The max quota value
|
Gets the user's onedrive max quota
Declaration
Task<long> GetUserOneDriveQuotaMaxAsync(string accountName)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
Returns
Task<System.Int64>
The max quota value
|
Resets the user's onedrive quota to the default value
Declaration
string ResetUserOneDriveQuotaToDefault(string accountName)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
Returns
System.String
The string outcome
|
Resets the user's onedrive quota to the default value
Declaration
Task<string> ResetUserOneDriveQuotaToDefaultAsync(string accountName)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
Returns
Task<System.String>
The string outcome
|
Sets the user's multi value profile property.
Declaration
void SetMultiValuedProfileProperty(string accountName, string propertyName, IList<string> propertyValues)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.String
propertyName
The case-sensitive name of the property to get.
|
PnP.Core.Model.SharePoint.IList<System.String>
propertyValues
The property values
|
Sets the user's multi value profile property.
Declaration
Task SetMultiValuedProfilePropertyAsync(string accountName, string propertyName, IList<string> propertyValues)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.String
propertyName
The case-sensitive name of the property to get.
|
PnP.Core.Model.SharePoint.IList<System.String>
propertyValues
The property values
|
Returns
Uploads and sets the user profile picture. Users can upload a picture to their own profile only.
Declaration
void SetMyProfilePicture(byte[] fileBytes)
Parameters
System.Byte[]
fileBytes
A byte array representing the file
|
Uploads and sets the user profile picture. Users can upload a picture to their own profile only.
Declaration
Task SetMyProfilePictureAsync(byte[] fileBytes)
Parameters
System.Byte[]
fileBytes
A byte array representing the file
|
Returns
Sets the user's profile property.
Declaration
void SetSingleValueProfileProperty(string accountName, string propertyName, string propertyValue)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.String
propertyName
The case-sensitive name of the property to get.
|
System.String
propertyValue
The property value
|
Sets the user's profile property.
Declaration
Task SetSingleValueProfilePropertyAsync(string accountName, string propertyName, string propertyValue)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.String
propertyName
The case-sensitive name of the property to get.
|
System.String
propertyValue
The property value
|
Returns
Sets the user's onedrive quota
Declaration
string SetUserOneDriveQuota(string accountName, long newQuota, long newQuotaWarning)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.Int64
newQuota
New quota value
|
System.Int64
newQuotaWarning
Quota warning value
|
Returns
System.String
The string outcome
|
Sets the user's onedrive quota
Declaration
Task<string> SetUserOneDriveQuotaAsync(string accountName, long newQuota, long newQuotaWarning)
Parameters
System.String
accountName
The account name, i.e. "i:0#.f|membership|admin@m365x790252.onmicrosoft.com"
|
System.Int64
newQuota
New quota value
|
System.Int64
newQuotaWarning
Quota warning value
|
Returns
Task<System.String>
The string outcome
|
Extension Methods