I started off trying to get the following VBS code working in Extra Basic.
Using the Object explorer I came across "Active DS Type Library" and was hoping to use it to grab the user's First and Last name. However, I'm extremely rusty on my coding and not able to get it working. I'm only able to grab UserName (ex: CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=Com). FirstName and LastName are within IADsUser, I just can't figure out how to grab the info.
Any assistance you can provide on a working solution would be greatly appreciated.
Code:
Dim strGreeting
Set Shell = WScript.CreateObject("WScript.Shell")
Set oInfo = WScript.createObject("ADSystemInfo")
Set LDAPUsr = GetObject("LDAP://" & oInfo.UserName)
strGreeting = "Hello " & LDAPUsr.FirstName & " " & LDAPUsr.LastName
shell.popup strGreeting
Using the Object explorer I came across "Active DS Type Library" and was hoping to use it to grab the user's First and Last name. However, I'm extremely rusty on my coding and not able to get it working. I'm only able to grab UserName (ex: CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=Com). FirstName and LastName are within IADsUser, I just can't figure out how to grab the info.
Code:
Sub Main
Dim sysInfo as Object
Dim user as String
Set sysInfo = CreateObject("ADSystemInfo")
user = sysInfo.UserName
msgbox user
End Sub
Any assistance you can provide on a working solution would be greatly appreciated.