Hello @NZ ,
You could use graph api to get all users, then loop through the users, use @pnp/sp/profiles to get user properties for each user. Below is my sample code for you:
this.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient): void => {
client.api('/users').get(async (error, users: any, rawResponse?: any) => {
//console.log(users.value);
for(let user of users.value){
console.log(user.userPrincipalName);
let loginName="i:0#.f|membership|"+user.userPrincipalName;
const profile = await sp.profiles.getPropertiesFor(loginName);
console.log(profile);
}
});
});
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.