System Center 2012 R2 Orchestrator Runbook

OK my question is related to MS System Center 2012 R2 and Orchestrator.
I have created a RunBookto do simple task. This problem is how I get the name of the user and the name of the computer used to run the RunBook.

Example : My runbook server is called RBookServ and runbooks run under a service account call RunbookSVC.  

Tom Smith (TSMITH) launches the RunBook from his workstation called WS108.

How can I get TSMITH and WS108 passed as a variable?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
I use %username% and %computername% i.e
create a variable called USERNAME (for example) and set the value to %USERNAME%
Leon TaljaardSystem Center Specialist - ArchitectureCommented:
Hi There,

Have a look at these 2 links which should explain in detail on how to get and report on who did what. This should point you in the right direction.

Audit Trail - Technet

Who Did That? Auditing in Orchestrator

Hope that helps

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SLPowersEngineerAuthor Commented:
David I have read several people say that is a solution. In runbook tester that works but once I run the runbook it reports the username of the accout it runs under.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Leon TaljaardSystem Center Specialist - ArchitectureCommented:

Did you manage to have a look at the links I provided ?
SLPowersEngineerAuthor Commented:
I am working on that now.  so far the first link is a dead end but I may be doing something wrong.
Leon TaljaardSystem Center Specialist - ArchitectureCommented:
Leon TaljaardSystem Center Specialist - ArchitectureCommented:
it will only work if you run it normally, not in "Runbook Tester"  the above link is only once checked in and then run normally
SLPowersEngineerAuthor Commented:
Thank both of you so so much. No lie I wanted David's to work so bad as it would be so simple and easy to do,  It seems they would make this easy to script.  Still never the less I could not make it work.  In runbook tester it worked fine but when running it only reports the service account the runbook runs as.
Leon you have been very kind and patient and I did get the fist link to the work.  The SQL query was out of my league.  I am far to new and could not make it work.  I will circle back to that I am sure.

Still with the reporting enabled and knowing I can use some light PowerShell and pull the username from the log it will work.  

Just seems like MS dropped the ball on such a important piece.  A activity that could pull the local computer and user of the person running the program seems like a no brainer but it is what it is.

Thanks so much again to all.
Leon TaljaardSystem Center Specialist - ArchitectureCommented:
Hi there,

It is only a pleasure and it has also made me want to look at David's solution and perhaps try find out why it would only work on the tester and not when triggered normal, if i find something i will let you know.

I know Orchestrator well and have had to do may workarounds, especially with the .Net activity.

But if you ever need some extra help or assistance don't be shy, I would be more than happy to help.
SLPowersEngineerAuthor Commented:
where would he create it?


SLPowersEngineerAuthor Commented:
%ENVVAR%: This variable returns the value of the environment variable between the percent (%) symbols. The environment variable is based on the runbook server computer where the runbook is running, and it is not case-sensitive. All system variables can be resolved. Any user variables are resolved in the context of the service account on the runbook server. If the environment variable does not exist, the text specified within the variable is returned as-is (that is, if you type %ENVVAR% and no environment variable named ENVVAR exists, the text ‘%ENVVAR%’ is returned).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.