Hello everybody.
I am trying to obtain info about the user running my script so about a logged-in user. I wasn't able to find a way how to do it directly in DIAdem script but I found neat code for Windows VBS I guess (I am still kind of new in scripting so I'm not sure what typ of code it is):
' ***************************************************************************' UserName_SurName.vbs ' Gets the current user's first name and last name' ***************************************************************************SetobjSysInfo=CreateObject("ADSystemInfo")SetobjCurrentUser=GetObject("LDAP://"&objSysInfo.UserName)WScript.EchoobjCurrentUser.givenNameWScript.Echoobjcurrentuser.lastname
WScript.Echo objcurrentuser.department
But I wasn't able to obtain my desired info even though I tried to substitute WScript.Echo with MsgBox and whatnot.
I then tried to run the code externally from DIAdem like this:
where UserName_SurName.vbs is the first code saved as .vbs on my desktop. This time again without a success.
Could you please help me to obtain the user name, surname and department either directly from DIAdem script or from the script I posted? What do I do wrong.
Thank you in advance.
Marek