Try as i might, i cannot get my powershell script to execute from a TI.
The TM1 service runs under a CognosAdmin user account (if that is the correct way to describe it) and when logging into the TM1 server directly with this account and running the script it works fine. The problem appears to just be the executing of it from a TI process.
I can execute the send-mailmessage and rename-item Powershell commands from a TI and they work fine. It just appears to be the executing of the ps1 script.
I have tried with numerous Powershell commands and switches, none of which have made a difference, including -noprofile -noninteractive and -exceptionpolicy bypass. The simplest form of the command i am trying to run is as follows:
PowerCmd = 'PowerShell.exe -file O:\convertcsvtoxlsx.ps1';
ExecuteCommand( PowerCmd,1);
I have also tried the "& O:\convertcsvtoxlsx.ps1" version, but to no avail.
Anyone got any ideas on what i might be missing or if there is some other server permissions issue we need to address? Again, the script works fine when run manually under the CognosAdmin account, which should be the one that the TM1 service is running under.
Thanks.
Execute Powershell Script from TI
-
- Posts: 5
- Joined: Thu Aug 21, 2014 4:09 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2007-2016
Re: Execute Powershell Script from TI
While I don't pretend to be an expert when it comes to Powershell scripts, I do execute a few in various models. The Powershell script reference has always been initiated without issue using the syntax below (in TM1 versions 10.1 - 10.2.2):
ExecuteCommand( 'Powershell E:\Restore\Planning_Prod.ps1', 0 );
Best of luck!
ExecuteCommand( 'Powershell E:\Restore\Planning_Prod.ps1', 0 );
Best of luck!
-
- Posts: 24
- Joined: Mon Aug 26, 2013 8:39 am
- OLAP Product: PAx & PAW
- Version: PA 2.0.8
- Excel Version: Excel 2019
Re: Execute Powershell Script from TI
Hi Art83,
Thanks for this. Though I don't think it will solve my problem, I think setting the command to not wait with the 0 parameter is probably a good idea, as I have found myself with a few stuck processes while trying solve this which I have not been able to kill via TM1 Top.
Thanks for at least confirming the basic syntax of my command is correct. Can only think it is a permissions thing somewhere, but struggling to pin it down.
I shall soldier on...
Of note, I'm on CX 10.2.2 running on Windows Server 2008 R2, which I probably should have stated in the initial post.
Thanks again.
Thanks for this. Though I don't think it will solve my problem, I think setting the command to not wait with the 0 parameter is probably a good idea, as I have found myself with a few stuck processes while trying solve this which I have not been able to kill via TM1 Top.
Thanks for at least confirming the basic syntax of my command is correct. Can only think it is a permissions thing somewhere, but struggling to pin it down.
I shall soldier on...
Of note, I'm on CX 10.2.2 running on Windows Server 2008 R2, which I probably should have stated in the initial post.
Thanks again.
-
- Community Contributor
- Posts: 219
- Joined: Mon Jul 23, 2012 8:31 am
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2010
Re: Execute Powershell Script from TI
We had access to run scripts on our Servers using the TM1 but our IT boffins decided to turn something off so that only proper User ID's can run script, not system ID's.
Might be worth checking if the server admin is managed by another team.
Might be worth checking if the server admin is managed by another team.
-
- Posts: 24
- Joined: Mon Aug 26, 2013 8:39 am
- OLAP Product: PAx & PAW
- Version: PA 2.0.8
- Excel Version: Excel 2019
Re: Execute Powershell Script from TI
Hi RJ!
I think this might be it, although my boffins are struggling to find where this control might be. It seems we can get these scripts to run anywhere except when called from a TI process. Even when we log in with the same ID that TM1 uses it works, just not when TM1 uses it on its own.
Will update as and when we get to the bottom of it.
Thanks again for the lead.
I think this might be it, although my boffins are struggling to find where this control might be. It seems we can get these scripts to run anywhere except when called from a TI process. Even when we log in with the same ID that TM1 uses it works, just not when TM1 uses it on its own.
Will update as and when we get to the bottom of it.
Thanks again for the lead.
-
- Posts: 24
- Joined: Mon Aug 26, 2013 8:39 am
- OLAP Product: PAx & PAW
- Version: PA 2.0.8
- Excel Version: Excel 2019
Re: Execute Powershell Script from TI
Finally found the solution.
Turns out the script was in fact running, but the Excel object that was being referenced was doing nothing. If logged in with the same account that TM1 uses it worked, but Excel knows if someone is actually logged in or if the object is being called from a task or, in this case, a TI process. The work around solution was to create these two folders:
(32Bit, always)
C:\Windows\System32\config\systemprofile\Dektop
(64Bit)
C:\Windows\SysWOW64\config\systemprofile\Desktop
As soon as these were created it worked.
Turns out the script was in fact running, but the Excel object that was being referenced was doing nothing. If logged in with the same account that TM1 uses it worked, but Excel knows if someone is actually logged in or if the object is being called from a task or, in this case, a TI process. The work around solution was to create these two folders:
(32Bit, always)
C:\Windows\System32\config\systemprofile\Dektop
(64Bit)
C:\Windows\SysWOW64\config\systemprofile\Desktop
As soon as these were created it worked.
-
- Posts: 9
- Joined: Fri May 11, 2012 1:38 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2007
Re: Execute Powershell Script from TI
In my opinion this is the best solution. We also use this method here.art83 wrote:While I don't pretend to be an expert when it comes to Powershell scripts, I do execute a few in various models. The Powershell script reference has always been initiated without issue using the syntax below (in TM1 versions 10.1 - 10.2.2):
ExecuteCommand( 'Powershell E:\Restore\Planning_Prod.ps1', 0 );
Best of luck!