Skip to content

Instantly share code, notes, and snippets.

@davejlong
Created December 7, 2020 15:14
Show Gist options
  • Save davejlong/fa35e37a53a0b2cdadf257784543aabe to your computer and use it in GitHub Desktop.
Save davejlong/fa35e37a53a0b2cdadf257784543aabe to your computer and use it in GitHub Desktop.
Get all of the contacts in Atera along with the customer address information.
$Output = "$env:HOME\Contacts.csv"
$Customers = Get-AteraCustomers
$Contacts = Get-AteraContacts
# If you only want key contacts:
# $Contacts = Get-AteraContacts | Where IsContactPerson
foreach($Contact in $Contacts) {
$Customer = $Customers | Where CustomerID -eq $Contact.CustomerID
[PSCustomObject]@{
customer = $Customer.CustomerName
Address = $Customer.Address
City = $Customer.City
State = $Customer.State
Country = $Customer.Country
FirstName = $Contact.FirstName
LastName = $Contact.LastName
Email = $Contact.Email
Phone = $Contact.Phone
} | Export-Csv -Path $Output -Append -IncludeTypeInformation $false
}
@bogdanlogic
Copy link

Can you please be more specific ? I went to app.atera.com/apidocs#/ log in with the key, then what I need to do ? Im checking for 2h already each of the agent, contact, customer docs. Where do i need to go, what are the next steps please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment