-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging - capture more information about a user (user name, domain, remote?, system?) #615
Comments
We already capture this. |
Ok - is it both a variable and logging? |
Cool - looking for the same pattern with the others if possible and a bit of choco unique logging text. |
Would also be cool to show all the indicator variables choco takes pains to set - in the default template produced by "choco new". May prevent a lot of packagers taking time to find their own methods - methods which may not cover all use cases their package will end up in. |
This will be in 0.10.6 |
There is a way to know if choco is running inside of a terminal services (remote desktop context). However it doesn't appear there is a way for anything to know it is being run over PowerShell Remoting (outside of the entered PowerShell session, which will know that it is running something like |
The one thing we may be able to do is see $env:SESSIONNAME is completely empty and not "Console" and guess it may have something to do with not being a local session... it's not very deterministic though. |
@DarwinJS probably more deterministic from PowerShell - https://twitter.com/anthonymastrean/status/857399759895744512 From @AnthonyMastrean |
Capture the following additional information about a user: * Username * User domain * User is System? * User is Remote?
* stable: (35 commits) (GH-1238) Save extra info about installed packages (maint) allow overrides (GH-1253)(GH-1263) List/Search returns Summary and Release Notes (GH-1101) Search results by relevance by default (GH-1004) Ensure choco info returns results (maint) Note on install if auto-uninstall possible (maint) look for licensed assembly based build-type (GH-615) capture more user information (GH-1145) show inner exception message (GH-1267) API - get configuration (maint) Resources proj does not produce pdb file (doc) update nuspec authors (doc) update licensed release notes (build) ILMerge pdb files (GH-1247) ensure xml documentation (maint) note force install is for same version (GH-1243) Update Chocolatey shims (GH-1243)(shimgen) upgrade to 0.8.x (maint) fix copyright double period (log) show exit code when running -v ...
_Let Me Know If You Want This Broken Up and if so, How Many Issues to Break It Into_
It would be helpful if for each of these choco
[a] Set a Variable
[b] reported all of these near each other in the log
[c] if each log entry included unique text that could be searched and/or configured in a log highlighter.
Username
Variable: $env:username
Log example: Chocolatey is running under account username:
SYSTEM Account Context
Also would be nice if Choco reported explicitly whether it thinks it is running under SYSTEM.
I think this API call is the best way - but I have not researched whether it catches alternative SYSTEM accounts:
Log example: Chocolatey is running in SYSTEM account context. (Also exposed in variable $IsSystem)
PLEASE DO NOT REPOST CONTENT WITHOUT PERMISSION. Training and Tools to Make Apps Run on Win7 and Virtualization => http://CSI-Windows.com
ELEVATED Administrator Rights
Reporting System Admin rights or not would also be helpful.
Most reliable way I know is the following - this SID only appears if the current session IS ELEVATED. So you don't need to goof around with methods that tell you the user is in the admins group - but still not elevated:
Log example: Chocolatey is running in an ELEVATED ADMIN context. (Also exposed in variable $IsElevated)
REMOTING Context
Get-host could be helpful here. I know of one stumbling block. (Get-Host).Name can contain the string "remote" for some scheduled jobs. (Get-host).runspace may be more reliable, but I have not tested it in scheduled jobs
Log example: Chocolatey is running in a REMOTE SESSION. (Also exposed in variable $IsRemoting)
The text was updated successfully, but these errors were encountered: