How can I read extension email addresses with PowerShell?

Status
Not open for further replies.

hardywo1

Free User
Joined
Mar 21, 2021
Messages
4
Reaction score
3
I am writing a program to check each extension folder for the self_id_prompt.wav file and would like to automatically email any extensions that do not have that setup. Any suggestions on how I can pull those email addresses into my script directly from the 3CX files?
 
You can't unless you access the database which is not recommended and not supported.
 
It might be possible with the upcoming REST API, but no ETAs are known yet.
 
Thanks for letting me know! It would definitely be nice to future proof this and have my script run regularly, but I will just run it manually for now and send the necessary emails myself. Please reply though if you hear anything different and I am definitely open to suggestions if any others have them.
 
  • Like
Reactions: Evolute IT
You could potentially export the extensions info from the Management Console in a .csv format and have your script/program use that. You would of course have to update the file manually by exporting it again every now and then depending on how frequently changes are made to extensions or their emails, etc.
 
  • Like
Reactions: Evolute IT
Thank you for the suggestion, Chris! It was only about forty extensions that needed to be contacted so I just pulled the report, put them on the BCC line of an email, and sent out the message and instructions for now. I will definitely keep an eye out though for api access updates though as this would work best to be run and contact new extensions automatically.
 
I encourage you to take a look at our 3CX Auto Self-ID tool. This tool monitors extensions and auto-creates missing self identification messages. We use Amazon Polly as the voice which is surprisingly good. Then your users do not need to do anything. It runs as a service so newly created extensions get updated automatically.
 
Thanks for the offer, but I would prefer to do this in-house with PowerShell. How are you able to read extension data such as the name of the person on the extension? If I could pull the name and email, that would be sufficient for my needs.
 
We use our VoIPTools Relay to communicate with the 3CX Call Control API, and a Windows service written in c#. I have no idea how you would do that in PowerShell.
 
Status
Not open for further replies.