Ever needed to recover a TM1 user's password when using native security i.e. mode 1?

Post Reply
User avatar
gtonkin
MVP
Posts: 1202
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Ever needed to recover a TM1 user's password when using native security i.e. mode 1?

Post by gtonkin »

The below script uses some undocumented functions to do the decryption.
These are not recognized in PAW but save and just ignore the error or use Architect.

Create a new process with a string parameter called pClient then add the following to the prolog section:

Code: Select all

IF(pClient@='');
  pClient=TM1User;
ENDIF;

sKey='}@BujrF]uxPmWkqw}&t]MeOwNOx{tvYO,eD';
sPassword='';
sCipher=CellGetS('}ClientProperties', pClient, 'PASSWORD');
sCipher=EncodePassword(sCipher);
sModifier=INT(LOG(Long(sCipher)+1))-2;
sModifier=IF(sModifier<0, 2, 0);

nIndex=Long(sKey);
While(nIndex>2);
  If(Mod(nIndex-sModifier,3)=0);
    sCharacter=SUBST(sKey,nIndex-2,1);
    nCode=CODEW(sCharacter,1);
    sCharacter=CHAR( nCode- INT(nIndex/3));
    sPassword=sCharacter | sPassword;
  
  Endif;
nIndex=nIndex-1;
End;

TextOutput('password.txt',pClient, sCipher, sPassword);
Save and run the process, giving it a valid client or leave blank for your user.
After the run completes, view the password.txt file located in your data folder for the result.
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Ever needed to recover a TM1 user's password when using native security i.e. mode 1?

Post by Wim Gielis »

It works but I didn’t know that all my coworkers use the same password :shock:
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply