Besides core operations, like list, create, update and delete, many objects and resources in Microsoft Graph support some additional actions. For example, user object supports such actions as sendMail or checkMemberGroups. For details, see "Methods" section in the Microsoft Graph documentation > Users article.
An action can be performed for an Office 365 object or resource by calling a corresponding function method for a PS object returned by Get-CGraph method.
To enumerate all available action methods, call GetMethods() method for a PS object:
$user = Get-CGraph users -Id andy@cayosoft.com
$user.GetMethods()
To execute an action method for an object, call a corresponding method and pass required parameters:
$user.ChangePassword("CurrentPassword!", "NewPassword!")
or
$user.ChangePassword(@{currentPassword = "CurrentPassword!"; newPassword
= "NewPassword"})
Comments
0 comments
Please sign in to leave a comment.