0 votes

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.0k points)

1 Answer

0 votes
by (267k points)

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.

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.

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.

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

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

For example, if the scope is a specified OU, running the report will list management history for every object in the OU even if it has had no management operations ... so objects that have not had any recent modifications are excluded from the report results?

asked Aug 13, 2021 by ryan741 (120 points)
0 votes
1 answer

I would like users to use Adaxes to add themselves or others to a group, but instead of it just working, it has to go thru an approval process and be approved by the group owner before they are added. Thanks!

asked Jun 30, 2021 by RayBilyk (230 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 by cewilson (120 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)
3,299 questions
2,997 answers
7,673 comments
544,263 users