r/GraphAPI • • Sep 13 '24

Trying to create a MS list with a "Person or Group" field

2 Upvotes

I have been having the worst luck when trying to create a function that will create a ms list with the graph. I am able to create generic fields just fine with simple text. However, I have looked everywhere for documentation on how to fill out a "Person or Group" type field in a list. I am trying to have more control over what gets created. Previously I was using Power Automate and that was easy enough to create that field. I just needed to supply the user's email. However, now that I am using Python I am not sure what all I need to provide. I keep getting back "error":{"code":"invalidRequest","message":"Invalid request","innerError"

What I first found was that you needed to provide a Sharepoint lookup ID. Which I tried with no luck. Then I provided a dictionary with a number of values such as email, principal name, and display name.

Any help with this would be much appreciated.


r/GraphAPI • • Aug 21 '24

How to check the installed apps of a device using Graph Explorer?

2 Upvotes

I'm having a difficult time in what to put in endpoint URL. I have tried any endpoint URL online but they don't work.


r/GraphAPI • • Aug 20 '24

Universal Print Graph API (Application Permissions)

2 Upvotes

I want to leverage an application to query things related to Microsoft Universal Print.  

The application has the permission: Printer.ReadWrite.All  

But every call listed in the Microsoft documentation regarding the Print API states that Application permissions are not supported.

Why make a permission that is not supported anyways?

Can anyone tell me if it's possible to use Graph with application permissions to request printer usage?


r/GraphAPI • • Aug 14 '24

Differentiate Outlook Contact Email addresses

2 Upvotes

When using the graph api (I'm building a Powerapp) how do you differentiate between the email addresses returned by graph? Its JSON only shows address and name, but in Outlook it shows Personal, Work, and Other.

Response:

HTTP/1.1 200 OK

Content-type: application/json

{

"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('48d31887-5fad-4d73-a9f5-3c356e68a038')/contacts/$entity",

"@odata.etag": "W/\"EQAAABYAAAAiIsqMbYjsT5e/T7KzowPTAAAYc8Bf\"",

"id": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAAiIsqMbYjsT5e-T7KzowPTAAAYbuK-AAA=",

"createdDateTime": "2017-09-04T15:54:01Z",

"lastModifiedDateTime": "2017-09-04T15:54:02Z",

"changeKey": "EQAAABYAAAAiIsqMbYjsT5e/T7KzowPTAAAYc8Bf",

"categories": [],

"parentFolderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAAuAAAAAAAiQ8W967B7TKBjgx9rVEURAQAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAA=",

"birthday": null,

"fileAs": "",

"displayName": "Alex Wilber",

"givenName": "Alex",

"initials": null,

"middleName": null,

"nickName": null,

"surname": "Wilber",

"title": null,

"yomiGivenName": null,

"yomiSurname": null,

"yomiCompanyName": null,

"generation": null,

"imAddresses": [],

"jobTitle": null,

"companyName": null,

"department": null,

"officeLocation": null,

"profession": null,

"businessHomePage": null,

"assistantName": null,

"manager": null,

"homePhones": [],

"mobilePhone": null,

"businessPhones": [],

"spouseName": null,

"personalNotes": "",

"children": [],

"emailAddresses": [

{

"name": "[email protected]",

"address": "[email protected]"

}

],

"homeAddress": {},

"businessAddress": {},

"otherAddress": {}

}

Outlook MacOS


r/GraphAPI • • Aug 13 '24

MgReportOffice365ActiveUserDetail returning what seems to be an hash instead of field

2 Upvotes

I run in a script the command

$dddd = (get-date).AddDays(-4).ToString("yyyy-MM-dd")
Get-MgReportOffice365ActiveUserDetail -Date $dddd -Outfile $TempFile

against two different Azure tenants.

On one tenant the fields User Principal Name and Display Name contain the values in clear text.

On another tenant contain what seems to be a hash of the values:

2AA785CA845322DC121695A5E24EBF52,4D7C56A2DE2A0A8D03229D75AF6C9CC6

Permissions of the PowerShell application are the same on both tenants.

Any idea on how to get the clear text values?

Thank you.


r/GraphAPI • • Aug 06 '24

The Importance of API Development in Modern Software Engineering

Thumbnail
quickwayinfosystems.com
2 Upvotes

r/GraphAPI • • Aug 06 '24

Manage Microsoft Entra objects with Micro Graph Powershell

2 Upvotes

Hello all,

First, I would like to let you all know that I am using Microsoft Graph Powershell for the first time to test out this documentation https://learn.microsoft.com/en-us/training/modules/manage-azure-active-directory-identities/5-manage-azure-active-directory-objects-powershell .

I was able to login to my account using a global administrator account.

After running this powershell script:

$users = Import-Csv -Path "C:\path\to\your\Users.csv"

foreach ($user in $users) {

New-MgUser -UserPrincipalName $user.UserName `

-GivenName $user.FirstName `

-Surname $user.LastName `

-DisplayName $user.DisplayName `

-JobTitle $user.JobTitle `

-Department $user.Department `

-AccountEnabled $true `

-MailNickname $user.FirstName `

-UsageLocation "US" `

-PasswordProfile @{ForceChangePasswordNextSignIn = $true; Password = "Password"}

}

I keep on getting an error message stating that I don't have permissions. I am using a Global admin account to no avail.

Please help!!

Thanks,


r/GraphAPI • • Jul 16 '24

Removing an attachment strips non-Microsoft X-* headers from a message

2 Upvotes

I've run into an odd behavior that doesn't seem to be documented. When I delete an attachment from an email message via Remove-MgUserMessageAttachment, Graph appears to strip all non-Microsoft X-* Internet message headers from the message.

For example, an existing X-Spam header will disapear, but X-MS-Exchange* headers will remain.

Is this behavior documented anywhere either as a bug or a feature? Is it just me?


r/GraphAPI • • Jul 01 '24

Permissions

2 Upvotes

Hello guys

Is there any way to send calendar events to my university account without when i do not have permissions to register applications in azure ?

I made a script that scrapes my university schedule and now I want to send it to office calendar in the university account so when any student uses it sends it to the calendar but i do not find a way if i cannot register the apps in azure, permitions that i do not have. Have anybody been through similar or know a solution to the problem ?


r/GraphAPI • • Jun 10 '24

Experiencing Calendar Access Removal Issue in Outlook 365 – Is This Normal?

Thumbnail self.outlook
2 Upvotes

r/GraphAPI • • Apr 20 '24

Error - deviceIdentityAttestationDetail does not exist when trying to get device info

2 Upvotes

i have PowerBI that used to work last year. i have not used it for a while but now i am getting an error.

DataSource.Error: OData: The property 'deviceIdentityAttestationDetail' does not exist on type 'microsoft.graph.managedDevice'. Make sure to only use property names that are defined by the type or mark the type as open type.
Details:
DataSourceKind=OData
DataSourcePath=https://graph.microsoft.com/beta/deviceManagement/managedDevices

if i change the DataSourcePath to just https://graph.microsoft.com/beta/deviceManagement, i can see the resources under it. i can drill down templates table and see the data. I can also view deviceCategories table and deviceConfigurations table. but when i select managedDevices, i get the deviceIdentityAttestationDetail error. i also get the same error when i select comanagedDevices.

is there anything i can do on the PowerBI side? if it is on the Azure side, any idea what needs to be changed so I can relay it to our admin?

below are steps in PowerBI

let

token_uri = "https://login.windows.net/" & #"Azure AD Tenant ID" & "/oauth2/token",

resource="https://graph.microsoft.com",

tokenResponse = Json.Document(Web.Contents(token_uri,

[

Content = Text.ToBinary(Uri.BuildQueryString(

[

client_id = #"Azure Application Client ID",

resource = resource,

grant_type = "client_credentials",

client_secret = #"Azure Application Client Secret"

]

),)

Headers = [Accept = "application/json"], ManualStatusHandling = {400}

]),)

access_token = tokenResponse[access_token],

Source = OData.Feed("https://graph.microsoft.com/beta/deviceManagement/managedDevices?$filter=operatingSystem eq 'Windows'", [ Authorization = "Bearer " & access_token ], [ ExcludedFromCacheKey = {"Authorization"}, ODataVersion = 4, Implementation = "2.0" ],)

#"Inserted Local Time" = Table.AddColumn(#"Renamed Columns", "lastSyncLocalDate", each DateTimeZone.ToLocal([lastSyncDateTime], type datetimezone))

in

#"Inserted Local Time"


r/GraphAPI • • Mar 27 '24

List all SharePoint sites in a script without an app?

2 Upvotes

Am I understanding the docs here correctly that when it says "Delegated: Not Supported" it means I must create an app to access this data? I've tried in PowerShell and Graph Explorer and I cannot get it to list all SharePoint sites.

I've also tried Get-MgSite and it returns nothing.

Is it because I'm not using an app? Do I really have to?


r/GraphAPI • • Mar 14 '24

Find all licensed users

2 Upvotes

Trying to find all users with a license

This works

https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/$count ne 0&$count=true&$select=displayName,mail,userPrincipalName,id,userType,assignedLicenses&$top=999

This doesn't

and I have no idea why - I have put consistency level = eventual into Graph explorer.

https://graph.microsoft.com/beta/users?$filter=AssignedLicense/$count ne 0&$count=true&$select=Surname,Givenname,Displayname,onpremisesextensionattributes,JobTitle,BusinessPhones,Mobilephone,Faxnumber,mail,streetaddress,city,state,postalcode,manager,department,companyname,officelocation,signinactivity,assignedlicenses&$count=true&$expand=manager($select=displayName)

I get the error:

message: "Expect simple name=value query, but observe property 'assignedLicenses' of complex type 'AssignedLicense'.",

I can get $filter=assignedLicenses/any(x:x/skuId+eq+[number] working but I just need to see all users with a license.


r/GraphAPI • • Mar 13 '24

Reporting upon Graph API usage

2 Upvotes

Looking through Entra ID and Defender, I've found several reports to determine user sign-in activity, application usage reports, etc. etc.

I have not been able to find a report that shows Graph API usage within an environment. To me, this seems like something all administrators should be monitoring closely. Have you guys' generated reports to determine usage of the Graph API?

I'd like to begin rolling out conditional access policies to further restrict API usage, but cannot without knowing current use cases first.


r/GraphAPI • • Mar 04 '24

Setting mailbox permissions using GraphAPI

2 Upvotes

Am I correct in saying you can't currently set read/manage/sendas/etc. permissions of mailboxes using the GraphAPI?

Little rant: Is it me or is a lot of actually useful stuff not yet available in the GraphAPI? MS is slowely pushing everyone over to it which would be fine if it had all the same features available in the suite of Powershell Modules. This makes it almost impossible to create integrations with apps that do now use Powershell.


r/GraphAPI • • Feb 20 '24

Get direct support for Graph Explorer?

2 Upvotes

I think I found a considerable bug in the Graph Explorer UI. I've confirmed it in Edge and Firefox. How do I get support? I went here: https://developer.microsoft.com/en-us/graph/support

When I click "Open a service request" it takes me to my m365 admin portal. Unfortunately we purchased through a reseller. I know they're not going to be able to help so I don't want to go that route. What are my options?

And I did already post in https://learn.microsoft.com/en-us/answers/questions/ but I'm not sure that's the best way.


r/GraphAPI • • Jan 30 '24

General Gripe against the very undercooked GraphAPI

2 Upvotes

Is it just me, or is it STILL half baked?

I took over my clients Entra Portal and I just want to get a list of all the Cloud Only Accounts through PowerShell. They have over 60k accounts between EntraID Connect and Cloud Only Accounts and they want to get some governance over the cloud only stuff.

Get-MgUser doesn't return ANYTHING unless you specify what you want. Like, the "OnPremImmutableID" attribute is empty unless you specify that you want it! And if you specify it you don't get other attributes.

Despite the fact that that I generally force myself to use the "Mg" PowerShell command I find myself constantly going back to the "AzAD" and "AzureAD" commands.

Anyone else have the same gripes?


r/GraphAPI • • Jan 23 '24

Intune get installed apps on a device PowerShell Graph API

2 Upvotes

$TenantID="xxx"
$ClientID="yyy"
$Secret= "zzz"
$uri="https://login.microsoftonline.com/$TenantID/oauth2/token"
$body= @{
grant_type="client_credentials"
client_id = $ClientID
client_secret=$secret
resource="https://graph.microsoft.com/"
}
$resp=Invoke-RestMethod -Method Post -Uri $uri -Body $body -ContentType "application/x-www-form-urlencoded"
$token=$resp.access_token
Write-Host $resp.access_token

$targetParameter = (Get-Command Connect-MgGraph).Parameters['AccessToken']
if ($targetParameter.ParameterType -eq [securestring]){
Connect-MgGraph -AccessToken ($token |ConvertTo-SecureString -AsPlainText -Force)
}
else {
Connect-MgGraph -AccessToken $token
}
Connect-MgGraph -Scopes "User.Read.all", "  DeviceManagementManagedDevices.ReadWrite.All"

Get-MgDevice | Select-Object * | where {$_.DisplayName -eq "NYC-kPGJXIgO8N2"}

# I am able to get the device but how do i get installed apps

Please help


r/GraphAPI • • Jan 11 '24

Can I start a content search with GraphAPI?

2 Upvotes

Hi,

I want to start a Content search using the Graph API just like I can using the Powershell. I want to basically do the following:

  Connect-IPPSSession

  New-ComplianceSearch -Name $SearchName -ExchangeLocation All -ContentMatchQuery $Filter

  New-ComplianceSearchAction -SearchName $SearchName -Purge -PurgeType SoftDelete -Confirm:$false -Force

Is it possible to do this yet?


r/GraphAPI • • Jan 09 '24

Why do I need Graph to generate the most basic report?

2 Upvotes

If you copy and paste this link, you should have a view of all your users with a Last Interactive sign-in time column (Tenant Global Admin role or other needed to view).

https://portal.azure.com/#blade/Microsoft_AAD_UsersAndTenants/UserManagementMenuBlade/search//filter/%257B%257D/select/displayName%2CuserType%2CsignInActivity

All I want is a report on blank or > 12-month-old logins. I can filter on 12-month-old logins, but not blank. You can't sort the column for some reason, and if you Download Users, it doesn't include the relevant columns.

Everything I read online (AI included) is telling me to use Graph API. Is this true? I can't tell you how frustrating it is to see the data but not get it out to the people who need it. I've already manually copied and pasted user by user for a report for the last two quarters, but I want to start fresh for 2024 and do this right. Any tips?


r/GraphAPI • • Dec 18 '23

Flagging emails automatically using Graph.

2 Upvotes

Hello everyone, I appreciate all help that can be given.

Part of our teams responsibilities is handling emergency meeting. I already have flows that can:

  • notify the team of incoming meetings.

  • gather details from the invite and catalogue them in a spreadsheet

  • assign these meetings to users in the spreadsheet, marking them as the facilitator

  • create reports of active meetings so management and others can follow along until the issue has been resolved.

Management also requires us to flag these emails with outer names. This is where I need help. I have experimented with the Graph API and I know I can flag an email, but I can only get it to flag with the generic message saying 'Follow up'.

How can I use Graph to flag the email with a custom value? I am sending the http request via power automate. This well be included in the flow that assigns users, so I will be able to use O365 lookup to get their name. I just need to be able to flag the email with their name.

Thank you in advance for any help you can provide.


r/GraphAPI • • Nov 29 '23

Cannot find "Meeting_id" to be used in "Get All Recordings" API endpoint call for microsoft teams.

2 Upvotes

I am trying to run the "Get All Recordings" endpoint call on Postman. https://graph.microsoft.com/v1.0/me/onlineMeetings/{meeting_id}/recordings The above call needs a Meeting_id which I cannot find from any other endpoint call or from Microsoft Teams UI. I tried to create a meeting, get the response of it and using meeting_id from response but it gives me following error: "message": "No iCalUid found for the meeting. This API is supported only for calendar backed OnlineMeeting."

One of the meeting_id is what you get from meeting detail page on MS Teams but that is not acceptable.

Is there a way we can get the meeting_id to run Get all Recordings call?


r/GraphAPI • • Sep 21 '23

b2cUserFlows removed from MS Graph API /identity ?

2 Upvotes

Hello

i had played around with Entra Exporter and noticed, that user data / flows from B2C are not exported / backed up. i had a look in the module and in Graph explorer and, for ver 1.0 and the beta, it was removed.

Instead there is now B2xUserFlows which, it self, do nothing.

github itselfs have no comments / updates for a while now for the projekt and actually i dont see currently any alternative to do it.

Am i missing something ?


r/GraphAPI • • Aug 23 '23

Invalid value specified for property 'mailNickname' of resource 'User'

2 Upvotes

Hey, would like some help with this specific error:

New-MgUser_CreateExpanded:
Line |
   2 |  New-MgUser -DisplayName $User.FullName `
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Invalid value specified for property 'mailNickname' of resource 'User'.

Status: 400 (BadRequest)
ErrorCode: Request_BadRequest

Trying to add a bulk of new users using csv file. Using this code:

Foreach ($User in $New_users){
New-MgUser -DisplayName $User.FullName `
-PasswordProfile $PasswordProfile `
-AccountEnabled `
-MailNickname $User.NickName `
-UserPrincipalName $User.Email `
-Department $User.Dep `
-JobTitle $User.Title `
-Surname $User.Sur `
-GivenName $User.Giv `
}

Checked csv, no illegal symbols, seperation by comma and I can add users just fine manualy (copy all the info). Anyone could give any advice? Powershell 7 btw.

Thank you.