I'm looking at this onliner Set-AdmUser -Identity $DN -Replace @{AADPHoto = $photoBytes} -AdaxesService localhost -Server. I get an illegal operation error. Wondering what I am getting wrong maybe the attribute?

image.png

Trying to set up automation to set the photo in AD and Azure at the same time to avoid waiting for synchronization.

by (1.2k points)

1 Answer

by (310k points)
0 votes

Hello,

Have a look at the folowing script from our repository: https://www.adaxes.com/script-repository/upload-user-photo-to-office-365-s327.htm. However, there is currently no stable approach exiting. The Set-MgUserPhotoContent cmdlet can give errors without any actual reason.

by (1.2k points)
0

I'm trying to avoid automation that requires running a script on 7,000 users each day when there is only 5 or 6 new pictures each day. So the script is self contained and doesn't run in a user's context. How do I target the user's azure identity or bind to it so this script you suggested will run correctly. We can user the version at the top of the article you sent where we use the AD thumbnail picture as the rest of my script will set that first.

by (310k points)
0

Hello,

Sorry for the confusion, but we are not sure what exactly you mean. The scripts run for the target user and update both the on-premises and the Microsoft 365 photo. As a solution, you can create a custom command configured for the User object type and manually execute it for the users you need.

by (1.2k points)
0

I don't understand why I would create a custom command and then script the execution of that command when we could simply bind to the target object. I'll figure this out and show you I guess.

Related questions

Hello, I'm trying to create a business rule that will update a user account expiry date when that user logs in for the first time. I'm new to Adaxes, so I don't have a ... updated by a user's action, such as "Last Logon". Is it possible to make this work?

asked Mar 6, 2024 by sjjb2024 (60 points)
0 votes
1 answer

Is there a way to have the Create User trigger to run a command to trigger the update user flag/trigger to be hit? The goal is to have specific Create User tasks to also go through the same tasks as the Update user.

asked Mar 2, 2023 by mobosys (290 points)
0 votes
1 answer

At user creation, when the inbox is created, I'd like to be able to format the address as firstname.lastname@domain.com for some users. Other users firstnameintial.lastname@domain.com, is this possible? Envornment is hybrid O365. Thanks!

asked Jan 4, 2024 by cewilson (300 points)
0 votes
1 answer

Is there a way to get the name of the user who approved a request and supply that to a step inside of a custom command? For example, HR submits a status change for an employee. ... and pass it as a param in a custom command that is called in one of the steps?

asked May 12, 2021 by davfount90 (20 points)
0 votes
1 answer

During the creation of a new user I want to be able to select the job title from a drop-down list which populates different values based on which Department is selected. Is there a way to achieve this? Thanks. Dario.

asked Oct 2, 2020 by winstonsmith (40 points)
0 votes
1 answer