/build/static/layout/Breadcrumb_cap_w.png

Do Online Kscripts, ran as logged in user, return the values for %username% and %userdomain% windows environment variables?

Is it possible to run an Online Kscript (ran as the logged on user) and have it return the logged on user's username and domain values with %username% and %userdomain%?

If the kscript is being run as the logged on user then shouldn't those %username% and %userdomain% return that user's username and domain.

This is preventing the desired outcome from my kscript.

Thanks in advance

 


0 Comments   [ + ] Show comments

Answers (2)

Posted by: jverbosk 12 years ago
Red Belt
0

From some of the other posts I've seen, variables tend to be a mixed bag.  One thing to keep in mind is the account the script is running under - if it's set to run as System, AFAIK you won't be able to target user-specific items, so if that's your goal you'll probably want to set up the script to run as the curretly logged in user. 

If you could advise on exactly what you are trying to accomplish with your script, more specific recommendations could be made, but it's currently a little open-ended and there are many possibilities.

John


Comments:
  • I made the kscript an Online Kscript so that I could select the option for it to run as the logged in user, so it is running as the user that's logged in and doesn't run when no one is logged in. The whole purpose of the kscript is to remove the logged in user from the local administrators group (if they are in this group and if it isn't the local "Administrator" account that's logged in). Thanks for replying. - bh585 12 years ago
Posted by: jverbosk 12 years ago
Red Belt
0

I'm running vbscripts that successfully pull the currently logged in user, full scripts are here:

http://www.itninja.com/blog/view/inventorying-reporting-on-user-profile-specific-other-non-inventoried-data

So it appears it's possible, but I have read of others having issues with the environment variables.  

I'm assuming your script runs correctly when run outside of the K1000 (i.e. locally & manually) - if that's the case, it could either be a bug (I would call support and have them advise) or possibly the script not being setup correctly (search on this forum for example configs).  I've reported a number of bugs (or things that just don't work 100%), so it wouldn't be shocking if that's what it turns out to be - would be good to make sure support is aware of it though, which is why I usually call them.

John

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ