How do I retrieve Job Info from Azure AD via MS Graph? - azure-active-directory

Hello and thanks in advance
I'm new to MS Graph and need to retrieve Job Information in particular the Employee ID from our Azure AD. See Image. Im not sure what the GET statement would be. I will be using the query in Power Automate.
Desc of AZ Fields

By default, Microsoft Graph only returns a limited set of properties.
But you can use the $select to get other data:
https://graph.microsoft.com/v1.0/me?$select=employeeId,department,jobTitle
https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http#example-3-users-request-using-select

In Ms Graph you can find the Job Information of a user by jobtitle property.
For example,
https://graph.microsoft.com/v1.0/users/{users UPN or object id}
Responce
Also, You can use filter query to retrieve an Azure Ad user with particular job title.
For example,
https://graph.microsoft.com/v1.0/users?$filter=(jobtitle eq 'Sr Prog/Anal')

Related

How to list only A specific group in AAD using ms graph api?

I'm using this query:
mail ge '' and securityEnabled eq true
but i want to pull only the mail address from users that in a specific group
So you want to get all users email of a specific group. It is straight forward in MS Graph.
In MS Graph,
https://graph.microsoft.com/v1.0/groups/0023c709-3556-4296-a6ab-6df2a0a1113c/members?$select=id,mail
Reference here.

On premise AD objectGUID is different than object id in Microsoft Graph

I have a question similar to: On premise Active Directory ObjectId is different than Azure Active Directory ObjectId
We used objectGUID in AD to uniquely identify the users and groups. We also maintain the group memberships using objectGUID. When querying Microsoft tenant using Microsoft Graph, what we see for the id from User or Group objects is different from what we get from the on-prem AD. This makes it difficult to correlate the AAD and AD resources.
I tried to use onPremisesImmutableId using the request below, only to find that this id is my employee id.
/v1.0/me?$select=id,userPrincipalName,onPremisesSecurityIdentifier,displayName,onPremisesImmutableId
Any idea how to retrieve the same objectGUID in the AAD world? I could not find anything close by looking at the User documentation.
Also for Group objects, I could not find the property onPremisesDomainName, similar to that in User objects. Is this by design?
That was the correct answer back when was written but things have changed a bit since then. There is an excellent blog post at Azure AD Connect: objectGUID vs. mS-DS-ConsistencyGuid that discusses this change. Specifically this bit:
Before Azure AD Connect version 1.1.524.0, Azure AD Connect (but also Azure AD Sync and DirSync) defaulted to the objectGUID attribute for objects as the source anchor. Azure AD Connect version 1.1.553.0, and beyond, defaults to the mS-DS-ConsistencyGuid for user objects, but objectGUID for groups and computer objects.
In your case, it sounds like your particular tenant mapping was configured differently (i.e. your employee id).
Given the issues raised in the blog post, I'd recommend against using objectGUID for this purpose altogether. If you're looking for a single property across both User and Group resources, I'd suggest looking at onPremisesSecurityIdentifier instead. This holds the SID from your on-prem AD.

How do I access the Sharebuilder UserID in SQL Server Report Builder

I am trying to pull the Sharepoint UserID out so I can use it as a parameter to control what the user of a dashboard can see. I have tried setting up a UserID parameter using the built-in field UserID and used that in a query to get a list of personnel but Report Builder gives me an error that I am trying to use a forward reference. How can I access the UserID in such a way that I can use to pull up the user's information from a SQL Server database? Thank you in advance for your help.
I fixed this problem by moving my UserID parameter to the top of my parameter list. Thanks

Can I let my LDAP search fail when group in filter doesn't exist?

My .Net 4.5 C# application queries an MS AD server via LDAP using DirectoryServices.Protocols. One of the queries needs to find all users for a given AD group, using an externally provided filter string like this:
(&(objectclass=user)(objectcategory=person)(memberof=CN=Gorillas,OU=Users,DC=example,DC=local))
When the given usergroup does not exist at all in the AD tree, I want the query to fail. Currently it just returns 0 results.
Is there a way to modify the query or filter, or add LDAP controls to let the AD server fail this query when the group doesn't exist?
One alternative I can think of is parsing the provided filter string and getting all referenced 'memberof' groups, and doing separate queries to the AD server to verify their existence, but I'd rather let the server do the filter parsing to prevent mistakes.
No, it's not possible to get an error back from LDAP, if the search is successful but returns no result. The only case you can get an error for a search filter, is when the filter is invalid.

Retrieve a Customized Report to many Users

Goal:
Every user, who has a AD account shall retrieve a customized and personal report, that is filtrerad data of their personal name, sent to their email account.
Problem:
Based on my searching you can send same report to many AD users by using data-driven subscription in SSRS report server. Please look at the picture.
My request is to enable to filtrate the dataset, containing the list of data, that user can read their own data only, not the others. The list of user is based on data from AD account.
Is it possible to do it? If yes, how to do it?
Information:
*You are enable to retrieve their e-mail that is based on their AD account.
*Data source is SSAS.
*Using SQL server 2008 R2.
*The database is a data mart.
Create two Datasets:
Dataset 1 Employee Information
Select
Your Fields here for the report
From your Table(s) Where employeeid = #Employeeid
Dataset 2 Filtered information
Select employeeid
From Table – This should be the same table as from the Dataset 1
Create your report based on Dataset 1
Set a filter on the Report: Use Dataset 2 as the available values for the Parameter (#Employeeid) of the report.
This will give you the filtered information that you need in your report.
You can then use this link to set up your data subscription email: Creating a Parameter Subscription
Hope that helps.

Resources