Created
December 7, 2020 15:14
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ?