TI Process to execute VBScript

Post Reply
jimicron
Posts: 110
Joined: Tue Oct 30, 2012 5:21 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: 2007 SP2 MSO
Location: Boise, ID

TI Process to execute VBScript

Post by jimicron »

Hi all,

I wasn't sure if I should add to another thread or create a new one. I figured less harm in creating a new one? Hopefully this is the right thing to do.

I, like it appears many others have, am struggling with executing VBScript from a TI Process. I have looked at other threads and have tried quite a few things but nothing seems to be working.

I have a VBScript file that I can execute without problems when I double-click on it, or when executing from a command prompt. The VBScript does two things: it pings a server/table to retrieve the amount of records and then sends an email with those results.

The TI Process has absolutely nothing in it except the following and it's on the Epilog tab:

Code: Select all

ExecuteCommand('"C:\windows\system32\cscript.exe" "\\analyst-app\libraries\TM1\Common\Scripts\TM1 TEST.vbs"',1);
I read in other threads that you can't execute VBScript directly from a process and instead, you have to add the C:\windows\system32\cscript.exe as shown above.

I have tried changing it to sysWOW64 as well and no luck. I have also added a folder named "Desktop" in the following locations: C:\Windows\SysWOW64\config\systemprofile\ and C:\Windows\System32\config\systemprofile\ per another thread. I then also just physically rebooted the server and tried again.

No luck :(

I am not sure if maybe I need to install "Blat" on the server? The VBScript I am using is using Outlook currently and I have outlook installed on my desktop (but then again, it's also installed on the server). I'm a bit confused as to next steps? Why it works directly and via command prompt, but not via TI Process.

Any ideas? Thanks as always!
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TI Process to execute VBScript

Post by tomok »

Smells like security. Think about it for a minute. When you run the script through a command prompt whose security account is it running under? Yours. When it runs in a TI process which account does it run under? The same account that the TM1 service is running under. Are you certain this account has all the necessary privileges it needs?
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
jimicron
Posts: 110
Joined: Tue Oct 30, 2012 5:21 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: 2007 SP2 MSO
Location: Boise, ID

Re: TI Process to execute VBScript

Post by jimicron »

I'm definitely thinking down those lines now Tomok. I've been looking and thinking since I posted (just read some more threads) and was JUST looking at that when I was notified you posted. I went onto the server and looked to see who it was running under (tm1) and it's WINNTDOM\TM1Service. I then reached out to our windows security team and was told that user has RWED privs on the folder where the VBScript is located. I then logged into the server and opened Windows Explorer to make sure when logged in as TM1Service that I could indeed get to the VBScript. Yes, I could. My next thought was, okay, let me double-click on it while logged in as TM1Service.

When I double-clicked on it, I was asked "Do you want to open this file?" (options of either "Open" or "Close"). I am NOT asked this when I do it. Hmmm.

But, even if I click Open when logged in as TM1Service and run it, it still doesn't work. However, it DOES work for me.

You may or may not be able to help at this point since this is looking like it's outside of TM1 with this latest info :(
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TI Process to execute VBScript

Post by tomok »

jimicron wrote:But, even if I click Open when logged in as TM1Service and run it, it still doesn't work. However, it DOES work for me.(
Then the problem is with the privileges of the account that TM1 is running under and has absolutely nothing to do with TM1 itself. Until you can figure out what that is I wouldn't waste any more time running it via a TI process. First of all, does the account have security rights to execute VBScript code? Many companies restrict this because of the dangers inherent in it. Does it have security rights to PING? Does it have security rights to send the email?
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: TI Process to execute VBScript

Post by jim wood »

Try giving the users full control rather than any other setting. Also make sure any subfolder inherits the same setting.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
jimicron
Posts: 110
Joined: Tue Oct 30, 2012 5:21 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: 2007 SP2 MSO
Location: Boise, ID

Re: TI Process to execute VBScript

Post by jimicron »

Thanks guys!

I got it to work!! :)

It's working with the above script. No change there. And, still only on the Epilog tab, etc. The 'TM1Service' DID have access to everything come to find out. So, wasn't security. It's an admin type of account.

What it ended up being is in the VBScript, the script uses Outlook (i.e. Dim objOutlk, objMail, etc.). The user "TM1Service" does not have an Outlook account. Thus, wasn't working, whereas I do have an Outlook account.

I changed the VBScript and now it's working just as expected with that code.

And, it's working from our Prod server, which I did not add those folders to. I only had done that on Test and rebooted Test server. So, for us, it appears that we didn't need to add the folder. Merely the code is good enough :)

Thanks again!
Post Reply