1
Event Domain->Domain Added not firing
Problem reported by Dave Lerner - 3/4/2017 at 4:06 PM
Submitted
SM 15.5.6222
Added Domain Event for Domain Added, with no conditions, but tick box for Enabled. On Actions tab, I put in a simple batch file just to create a text file (verified it works manually). When I create a new domain on the server, the even does not trigger the batch file. The server runs as System, so permissions aren't an issue. And, I have several other batch files and powershell scripts to do various things upon various events, and they all work...but not this one.
I want to have a batch file run every time a domain is created to put in some specific things we like to configure for all domains, like hostmaster/abuse/postmaster aliases, etc. Nothing complicated. The script works fine...when run manually, but again, won't run from the Event trigger.
Has anyone seen this with this specific event? So odd all my other events work fine, just not this one.
Thoughts, ideas? Thanks!

2 Replies

Reply to Thread
0
Dave Lerner Replied
Allright, was just gonna delete this because I forgot about a quirk of these things...so maybe this will help someone else. Whenever you write these command processor things, you have to always change the directory. SM will execute these things in whatever folder its running in, NOT the folder in which your script is located. So, if your script is in c:\etc then just put the following in your batch file:
c:
cd \etc
....and then follow with the reset of your script. So, this works, and I'm able to get my stuff to run no issue. I don't write these often enough to remember this little quirk.
0
Dave Lerner Replied
Of, of course, more of a doh... just use CD /D %~dp0

Reply to Thread