• Dear Expert,

    Can we do self expunge instead of admin?


    joe
  • If You are a PDMS user with Security set as Free.
    You can do the expunge instead of ADMIN.

    The user needs to have Free access in order to enter Admin and use the expunge option.
  • If your admin have experience in PML and CMD, you may ask him to write some script for this action :)
    That will use free [COLOR=#333333]access user to expunge your user..[/COLOR]
  • [QUOTE=me_hungry;106786]If your admin have experience in PML and CMD, you may ask him to write some script for this action :)
    That will use free [COLOR=#333333]access user to expunge your user..[/COLOR]

    Do you know if there is any way to do this in C#?
  • You can get a list of sessions using PML command from C#:
    ![COLOR=#0000cd]asesSessions  [/COLOR]= [COLOR=#ff0000]SESSIONS [/COLOR][COLOR=#696969]$* 1234-UserName = pid[/COLOR]

    then compare current host name and info from last part of ![COLOR=#0000cd]asesSessions[/COLOR],
    and expunge user by value of ![COLOR=#0000cd]asesSessions[/COLOR]:
    [COLOR=#ff0000]EXPUNGE [/COLOR]'$![COLOR=#0000cd]pid[/COLOR]'


    And of course, run all this in Admin module...
    [COLOR=#daa520](Don't forget to hide all passwords and other stuff) [/COLOR]
  • [QUOTE=me_hungry;106816]You can get a list of sessions using PML command from C#:

    then compare current host name and info from last part of ![COLOR=#0000cd]asesSessions[/COLOR],
    and expunge user by value of ![COLOR=#0000cd]asesSessions[/COLOR]:


    And of course, run all this in Admin module...
    [COLOR=#daa520](Don't forget to hide all passwords and other stuff) [/COLOR]
    I am not clear on how to get PML variable back into C#. I know how to run a command but how do you bring the result into the C# code?
  • You may try:

    [COLOR=#333333]_currentProjectNum = [/COLOR][COLOR=#333333][COLOR=#a31515][COLOR=#a31515]""[/COLOR][/COLOR][/COLOR][COLOR=#333333];[/COLOR]
    [COLOR=#333333][COLOR=#0000ff][COLOR=#0000ff]var[/COLOR][/SIZE][/COLOR][/COLOR][COLOR=#333333] projNumComm = Command.CreateCommand([/COLOR][COLOR=#333333][COLOR=#a31515][SIZE=2][COLOR=#a31515]"var !!PROJNUM project number"[/COLOR][/COLOR][/COLOR][COLOR=#333333]);[/COLOR][COLOR=#333333][COLOR=#008000]
    [/COLOR]
    [/COLOR][COLOR=#333333][COLOR=#0000ff][COLOR=#0000ff]if[/COLOR][/COLOR][/COLOR][COLOR=#333333] (projNumComm.RunInPdms())[/COLOR]
    [COLOR=#333333]{[/COLOR][COLOR=#333333][COLOR=#008000]
    [/COLOR]
    [/COLOR][COLOR=#333333]_currentProjectNum = projNumComm.GetPMLVariableString([/COLOR][COLOR=#333333][COLOR=#a31515][COLOR=#a31515]"PROJNUM"[/COLOR][/COLOR][/COLOR][COLOR=#333333]);[/COLOR]
    [COLOR=#333333]}[/COLOR]
  • You may try:


    Thank you. Does it have to be a global variable?
  • Yes, it need to be global :(
    This method can be applied only to string, bool, real.

    Arrays may be return using this workaround...:black_eyed:

    PML code to test:
    import 'GetMyHashTable'
    handle any
    endhandle
    using namespace 'GetMyHashTableNS'
    !asd = object GetMyHashTable()
    !asd.Test('SESSIONS')