To create a new object in Office 365, use the New-CGraph command and specify object properties in the -Properties parameter as a hashtable of property name / property value pairs:
$properties = @{
accountEnabled = $false;
displayName = "Alice Smith";
mailNickname = "asmith";
userPrincipalName = "asmith@cayosoft.onmicrosoft.com";
passwordProfile = @{
forceChangePasswordNextSignIn = $true;
password = "Qwerty123456!";
}
}
New-CGraphResource users -Properties $properties
Comments
0 comments
Please sign in to leave a comment.