forked from zincarla/AdobeUMInterface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSyncExample.ps1
24 lines (18 loc) · 1.29 KB
/
SyncExample.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#Import Module
$ScriptDir = split-path -parent $MyInvocation.MyCommand.Definition
Import-Module "$ScriptDir\AdobeUMInterface.psm1"
#Load cert for auth
#$SignatureCert = Import-AdobeUMCert -Password "MyPassword" -CertPath "$ScriptDir\Private.pfx"
$SignatureCert = Import-AdobeUMCert -CertThumbprint "00000000000000000000000000000000" -CertStore "LocalMachine"
#Client info from https://console.adobe.io/
$ClientInformation = New-ClientInformation -APIKey "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -OrganizationID "xxxxxxxxxxxxxxxxxxxxxxxx@AdobeOrg" -ClientSecret "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
-TechnicalAccountID "[email protected]" -TechnicalAccountEmail "[email protected]"
#Required auth token for further adobe queries. (Is placed in ClientInformation)
Get-AdobeAuthToken -ClientInformation $ClientInformation -SignatureCert $SignatureCert
#Sync AD Group to Adobe
#You can get the groupid by running Get-AdobeGroups
$Request = New-SyncADGroupRequest -ADGroupName "My-AD-Group" -AdobeGroupName "All Apps Users" -ClientInformation $ClientInformation
#ToReview, uncomment
#Write-Host ($Request | ConvertTo-JSON -Depth 10)
#Send the generated request to adobe
Send-UserManagementRequest -ClientInformation $ClientInformation -Requests $Request