Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Aktualisieren sie die Eigenschaften eines profilePropertySetting-Objekts .
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
PeopleSettings.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
PeopleSettings.ReadWrite.All |
Nicht verfügbar. |
Wichtig
Um delegierte Berechtigungen für diesen Vorgang verwenden zu können, muss der angemeldete Benutzer über die Rolle Personen-Administrator verfügen.
HTTP-Anforderung
PATCH /admin/people/profilePropertySettings/{profilePropertySettingId}
Anforderungstext
Geben Sie im Anforderungstext nur die Werte für zu aktualisierende Eigenschaften an. Vorhandene Eigenschaften, die nicht im Anforderungstext enthalten sind, behalten ihre vorherigen Werte bei oder werden basierend auf Änderungen an anderen Eigenschaftswerten neu berechnet.
In der folgenden Tabelle sind die Eigenschaften angegeben, die aktualisiert werden können.
| Eigenschaft |
Typ |
Beschreibung |
| allowedAudiences |
organizationAllowedAudiences |
Eine Datenschutzeinstellung, die die zulässige Zielgruppe für die konfigurierte Eigenschaft widerspiegelt. Mögliche Werte sind: me, organization, federatedOrganizations, everyone, unknownFutureValue. |
| isUserOverrideForAudienceEnabled |
Boolean |
Definiert, ob ein Benutzer die Datenschutzeinstellung des Mandantenadministrators außer Kraft setzen darf. |
| name |
Zeichenfolge |
Der Name der Einstellung auf Eigenschaftsebene. |
| prioritizedSourceUrls |
String collection |
Eine Sammlung priorisierter Profilquell-URLs, sortiert nach Datenrangfolge innerhalb eines organization. |
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 200 OK Antwortcode und ein aktualisiertes profilePropertySetting-Objekt im Antworttext zurück.
Beispiele
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/admin/people/profilePropertySettings/00000000-0000-0000-0000-000000000001
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.profilePropertySetting",
"prioritizedSourceUrls": [
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr2')"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new ProfilePropertySetting
{
OdataType = "#microsoft.graph.profilePropertySetting",
PrioritizedSourceUrls = new List<string>
{
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr2')",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.People.ProfilePropertySettings["{profilePropertySetting-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewProfilePropertySetting()
prioritizedSourceUrls := []string {
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr2')",
}
requestBody.SetPrioritizedSourceUrls(prioritizedSourceUrls)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
profilePropertySettings, err := graphClient.Admin().People().ProfilePropertySettings().ByProfilePropertySettingId("profilePropertySetting-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ProfilePropertySetting profilePropertySetting = new ProfilePropertySetting();
profilePropertySetting.setOdataType("#microsoft.graph.profilePropertySetting");
LinkedList<String> prioritizedSourceUrls = new LinkedList<String>();
prioritizedSourceUrls.add("https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr1')");
prioritizedSourceUrls.add("https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr2')");
profilePropertySetting.setPrioritizedSourceUrls(prioritizedSourceUrls);
ProfilePropertySetting result = graphClient.admin().people().profilePropertySettings().byProfilePropertySettingId("{profilePropertySetting-id}").patch(profilePropertySetting);
const options = {
authProvider,
};
const client = Client.init(options);
const profilePropertySetting = {
'@odata.type': '#microsoft.graph.profilePropertySetting',
prioritizedSourceUrls: [
'https://graph.microsoft.com/beta/admin/people/profileSources(sourceId=\'contosohr1\')',
'https://graph.microsoft.com/beta/admin/people/profileSources(sourceId=\'contosohr2\')'
]
};
await client.api('/admin/people/profilePropertySettings/00000000-0000-0000-0000-000000000001')
.version('beta')
.update(profilePropertySetting);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\ProfilePropertySetting;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ProfilePropertySetting();
$requestBody->setOdataType('#microsoft.graph.profilePropertySetting');
$requestBody->setPrioritizedSourceUrls(['https://graph.microsoft.com/beta/admin/people/profileSources(sourceId=\'contosohr1\')', 'https://graph.microsoft.com/beta/admin/people/profileSources(sourceId=\'contosohr2\')', ]);
$result = $graphServiceClient->admin()->people()->profilePropertySettings()->byProfilePropertySettingId('profilePropertySetting-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement
$params = @{
"@odata.type" = "#microsoft.graph.profilePropertySetting"
prioritizedSourceUrls = @(
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr1')"
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr2')"
)
}
Update-MgBetaAdminPeopleProfilePropertySetting -ProfilePropertySettingId $profilePropertySettingId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.profile_property_setting import ProfilePropertySetting
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ProfilePropertySetting(
odata_type = "#microsoft.graph.profilePropertySetting",
prioritized_source_urls = [
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr2')",
],
)
result = await graph_client.admin.people.profile_property_settings.by_profile_property_setting_id('profilePropertySetting-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.profilePropertySetting",
"id": "00000000-0000-0000-0000-000000000001",
"name": null,
"userOverridePrivacy": null,
"allowedAudiences": null,
"prioritizedSourceUrls": [
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr1')",
"https://graph.microsoft.com/beta/admin/people/profileSources(sourceId='contosohr2')"
]
}