I'm trying to match two users for a secure print scenario:
a) the owner of a printjob, logged in on a windows client and performing a print job to a secure print system via LPR The windows client is connected directly to an azure AD
b) to fetch the printjob from the secure print system I am performing an authentication via graph API, the user is logging in with the UPN but I can get some attributes like displayName etc.
On the windows 10 client
-> Login via UPN
Whoami /USER returns: MaxMusterman_rcai04e
Whoami /UPN returns [email protected]
The "owner" of the printjob printed by LPR is "MaxMusterman_rcai04e"
So far I have not found a way to "find" this user detail via graph api to be able to "match" the user logged in on the secure print system with the actual owner of the printjob.
This is also a test what happens if two users have the same displayName.
Another account exists:
User1:
UPN: [email protected]
DisplayName: Max Mustermann
PrintjobOwner: MaxMustermann
User2:
UPN: [email protected]
DisplayName: Max Mustermann
PrintjobOwner: MaxMusterman_rcai04e
What I have tried:
https://developer.microsoft.com/en-us/graph/graph-explorer
https://graph.microsoft.com/v1.0/me
https://graph.microsoft.com/v1.0/users/[email protected]/identities
I cannot find the desired owner of the print job or any way to deduce it programatically so far.
• You can surely get the owner of the desired print job through Microsoft Graph API by querying a particular print job owner. But you
cannot get the list of print jobs by filtering or mentioning the name of the print job owner
. Thus, you can get the whole list of print jobs that have been given through a printer and then you can filter the output for the jobs of a particular print job owner as below: -Command for getting the list of print jobs for a printer: -
• Output for the above command includes the section for ‘createdBy’ for every print job displayed in the results. Thus, we can
filter the jobs based on owner name by modifying the graph API query
as by applying filter based on the UPN as below: -Where ‘{upn}’ is the user principal name of the associated user.
To get more detailed information regarding the above commands, kindly refer to the documentation link below: -
https://learn.microsoft.com/en-us/graph/api/printer-list-jobs?view=graph-rest-1.0&tabs=http