Forum Discussion
bluecoat2020
Mar 13, 2020Copper Contributor
Unable to run across all users in Azure
Hi Just trying to get powershell to update sharepoint which is working if i use an individual account please see the current script Get-Module SharePointPnPPowerShell* -ListAvailable| Select...
- Mar 18, 2020
bluecoat2020 I think you are missing a foreach so you can loop through each user in $aadusers.
Foreach($aaduser in $aadusers) { If('' -ne $aaduser.facsimileTelephoneNumber -and $null -ne $aaduser.facsimileTelephoneNumber) { Set-PnPUserProfileProperty -Account $aaduser.UserPrincipalName -Property 'fax' -Value $aaduser.facsimileTelephoneNumber } }
Regards
Erick Moreno
Erick A. Moreno R.
Mar 18, 2020Iron Contributor
bluecoat2020 I think you are missing a foreach so you can loop through each user in $aadusers.
Foreach($aaduser in $aadusers)
{
If('' -ne $aaduser.facsimileTelephoneNumber -and $null -ne $aaduser.facsimileTelephoneNumber)
{
Set-PnPUserProfileProperty -Account $aaduser.UserPrincipalName -Property 'fax' -Value $aaduser.facsimileTelephoneNumber
}
}
Regards
Erick Moreno
- bluecoat2020Mar 19, 2020Copper Contributor
Thank you very much that has worked really appreciated Erick A. Moreno R.