All Forums >> [Scripting] >> WSH & Client Side VBScript >> <empty> username returned via remote WMI Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Hello. I've been working on this script for awhile and can not get it working the way I want it to. Actually, it does work using an administrator's user/pwd, but not when using a limited users' user/pwd.
Here is what I'm trying to do: remotely access the WMI from several computers, retrieve the currently logged on username, and calculate how long they have been logged on. This is for a library environment. With the administrator account everything works. With a non-admin account it goes all the way through w/ no errors, but doesn't produce the end results (how long the users have been logged on). I've narrowed it down to this: The admin account will return the username for the remote computer, but the non-admin account does not. I'm thinking it is permissions, but I've tried a lot of things to get it to work, including full access to Everyone. I have the CIMV2 permissions (Remote) & the DCOM permissions (Remote Launch & Remote Activation) set on clients. I have verified this with the WMI CMI Studio tool (WMI Tools) download from Microsoft.....admin account shows a username while the non-admin account shows <empty>.
The code runs from inside MS Excel as a macro (updates cells with how long each user is logged on). I've disabled the "Activesheet" lines so it should work as a .vbs file. Below is the code:
Any help with this would be appreciated. Thank you.
This is something that is going to be used by the library staff who work the front desk. It lets them know who has been using the computers the longest so that if all of them are taken they know who to kick off for someone else to use a computer (1 hour limit when busy). I don't want administrator credentials out in the open for anyone to get to.
When retrieving information from the ROOT\CIMV2 namespace using WMI, is the information that you can retrieve dependent on what credentials you are using (i.e. administrator verses non-administrator)? Could that be why I can get the username with an administrator account, but with a non-administrator account it shows <empty>?