Page 1 of 1
AssignClientToGroup() after AddClient()
Posted: Wed Aug 31, 2011 7:12 am
by maps
Hi guys,
I just tried to create a excel sheet where a admin kann add new users to the system. Via a action button a process gets startet which adds the new user, psw and adds him to Groups.
To add the user works perfectly. But the Groups are not added automatically. But when I run the process a second time it works. here is the code of the process.
Proglog:
Code: Select all
AddClient(clientname);
AssignClientPassword(clientname, psw);
AssignClientToGroup(clientname, group1);
AssignClientToGroup(clientname, group2);
AssignClientToGroup(clientname, group3);
AssignClientToGroup(clientname, group4);
...
Because it didn't work I added some SecurityRefresh-statements but it didn't effect the process. The problem remains...
Code: Select all
AddClient(clientname);
AssignClientPassword(clientname, psw);
SecurityRefresh;
AssignClientToGroup(clientname, group1);
AssignClientToGroup(clientname, group2);
AssignClientToGroup(clientname, group3);
AssignClientToGroup(clientname, group4);
...
SecurityRefresh;
Any ideas?
Re: AssignClientToGroup() after AddClient()
Posted: Wed Aug 31, 2011 7:43 am
by rmackenzie
I think you should try splitting the statements between the Prolog and the Epilog. This is because TM1 will not commit metadata changes until the end of the script block. You can't perform a function on the new client because the change hasn't been committed to the }Clients dimension. It is the same thing as if you were creating a new dimension element and then trying to CellPut against it in the Prolog. The reason it works the second time is because the new client already exists so the 'commit problem' is no longer an issue and the permission is simply set against an existing client (or the cellput is performed against an intersection including existing elements).
Also, I think you only need the one SecurityRefresh statement.
Prolog:
Epilog:
Code: Select all
AssignClientPassword(clientname, psw);
AssignClientToGroup(clientname, group1);
AssignClientToGroup(clientname, group2);
AssignClientToGroup(clientname, group3);
AssignClientToGroup(clientname, group4);
SecurityRefresh;
Re: AssignClientToGroup() after AddClient()
Posted: Wed Aug 31, 2011 8:14 am
by maps
Thanks a lot for your help. It works now!
Re: AssignClientToGroup() after AddClient()
Posted: Thu Aug 08, 2013 2:40 pm
by LutherPaul
Hi All,
How do we assign Maximum ports and unique ID thru script?
We are using 9.5.2.
Thanks,
Luther.
Re: AssignClientToGroup() after AddClient()
Posted: Thu Aug 08, 2013 2:46 pm
by declanr
LutherPaul wrote:Hi All,
How do we assign Maximum ports and unique ID thru script?
We are using 9.5.2.
Thanks,
Luther.
Take a look at the }ClientProperties cube.
Re: AssignClientToGroup() after AddClient()
Posted: Thu Aug 08, 2013 3:06 pm
by LutherPaul
Thanks for the reply Declan.
I am looking for a script as I want to automate the process.
Thanks,
Luther.
Re: AssignClientToGroup() after AddClient()
Posted: Thu Aug 08, 2013 3:12 pm
by qml
LutherPaul, the code to do what you need is not very complicated. You have received help from declanr, this should be enough to get you started. Try writing this script yourself and when you run into any specific issues, you can always come back for more help. No-one here will write this code for you, especially with your attitude.
Re: AssignClientToGroup() after AddClient()
Posted: Thu Aug 08, 2013 3:58 pm
by LutherPaul
Thanks QML for pointing out. Did not know I was showing attitude.
I will try to write better.
Thanks,
Luther.
Re: AssignClientToGroup() after AddClient()
Posted: Sun Aug 11, 2013 12:06 am
by Darkhorse
Hi Luther
I came across the same issue I believe your facing, your TI won't commit,
You need to right click on the TI before opening it and click on security setting its a tick option, this will then allow your TI to write to port settings,
Re: AssignClientToGroup() after AddClient()
Posted: Tue Aug 20, 2013 12:31 pm
by LutherPaul
Thanks Darkhorse!
We clould easily set these without a big program.
CellPutS('MyPwd@0123','}ClientProperties', vClientName , 'UniqueId');
Luther.