Desktop productivity for business analysts and programmers

Develop EG custom task: how to get current user id

Accepted Solution Solved
Reply
Contributor
Posts: 47
Accepted Solution

Develop EG custom task: how to get current user id

I can get current server by these codes, but how to get current user id used to connect the AssignedServer?

server = consumer.AssignedServer;

ws = consumer.Workspace(server) as SAS.Workspace;

Please answer it as soon as possible, thank you!


Accepted Solutions
Solution
‎02-09-2012 08:20 AM
Community Manager
Posts: 2,889

Develop EG custom task: how to get current user id

Hi,

If using EG 4.3, the easiest way is this:

SAS.Tasks.Toolkit.Helpers.SasMetadataProfile.GetActiveProfile().UserID;

Otherwise, you might want to use SAS code to determine, as described here:

http://blogs.sas.com/content/sasdummy/2010/03/15/multiple-identities-for-all-of-the-people-you-are/

Chris

View solution in original post


All Replies
Contributor
Posts: 47

Develop EG custom task: how to get current user id

Is it so difficult? I just wanna get the metadata user id singed on.

Solution
‎02-09-2012 08:20 AM
Community Manager
Posts: 2,889

Develop EG custom task: how to get current user id

Hi,

If using EG 4.3, the easiest way is this:

SAS.Tasks.Toolkit.Helpers.SasMetadataProfile.GetActiveProfile().UserID;

Otherwise, you might want to use SAS code to determine, as described here:

http://blogs.sas.com/content/sasdummy/2010/03/15/multiple-identities-for-all-of-the-people-you-are/

Chris

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 630 views
  • 0 likes
  • 2 in conversation