wip
This commit is contained in:
@@ -37,7 +37,7 @@ function GetMailFromSAMAccountName {
|
||||
|
||||
# Vérifie si le mail existe
|
||||
$mail = if ($user.mail) { $user.mail } else { "" }
|
||||
|
||||
|
||||
# Retourne le SamAccountName et l'email de chaque utilisateur
|
||||
$result = [PSCustomObject]@{
|
||||
Success = $true
|
||||
|
||||
+15
-5
@@ -1,17 +1,27 @@
|
||||
function GetContactsFromListBrevo {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$IdListe
|
||||
)
|
||||
|
||||
$headers = @{
|
||||
"accept" = "application/json"
|
||||
"api-key" = ""
|
||||
"api-key" = "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"
|
||||
}
|
||||
|
||||
$response = Invoke-WebRequest `
|
||||
-Uri 'https://api.brevo.com/v3/contacts/lists/9/contacts?limit=50&offset=0&sort=desc' `
|
||||
-Uri "https://api.brevo.com/v3/contacts/lists/$($IdListe)/contacts?limit=50&offset=0&sort=desc" `
|
||||
-Method GET `
|
||||
-Headers $headers
|
||||
|
||||
return $response.Content | ConvertFrom-Json
|
||||
}
|
||||
|
||||
$contacts = GetContactsFromListBrevo
|
||||
$contacts.count
|
||||
$contacts.contacts | ForEach-Object { $_.email }
|
||||
# $contacts = GetContactsFromListBrevo
|
||||
# $contacts.count
|
||||
# $contacts.contacts | ForEach-Object { $_.email }
|
||||
|
||||
# foreach ($email in $contacts.contacts) {
|
||||
# Write-Output $email.email
|
||||
# }
|
||||
Reference in New Issue
Block a user