$uri = "https://mail-test.technologytoolbox.com/admin/api/v1/boxes"
$userPassword = "{specify test mail password here}"
$adminUsername = "[email protected]"
$adminPassword = "{specify Poste.io admin password here}"
$credentials = "${adminUsername}:${adminPassword}"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($credentials)
$encodedCredentials = [System.Convert]::ToBase64String($bytes)
$headers = @{ Authorization = "Basic $encodedCredentials" }
Get-ADUser -Filter { EmailAddress -like "*@*" } -Properties Name, EmailAddress |
foreach {
$body = @{
name = $_.Name
email = $_.EmailAddress
passwordPlaintext = $userPassword
}
Invoke-RestMethod -Uri $uri -Headers $headers -Method Post -Body $body
}
Created
February 25, 2020 18:10
-
-
Save jeremy-jameson/8a0d0e618dcc21cf1a174b7b7925d6fb to your computer and use it in GitHub Desktop.
Bulk Create Test E-mail Accounts in Poste.io Using PowerShell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment