Hi,
I currently use the following vbs code which querys AD and tells the user their PIN number which is located in their PO Box field in AD.
It works fine but i want to output it onto a web page (html or aspx) but i am struggling to get it working as i thought it would of just been a case of using
<script type="text/vbscript"></script>
The working code is,
Any advice where i am going wrong?
Thanks
I currently use the following vbs code which querys AD and tells the user their PIN number which is located in their PO Box field in AD.
It works fine but i want to output it onto a web page (html or aspx) but i am struggling to get it working as i thought it would of just been a case of using
<script type="text/vbscript"></script>
The working code is,
Code:
Set objRootDSE = GetObject("LDAP://RootDSE")
If Err.Number = 0 Then
strNamingContext = objRootDSE.Get("defaultNamingContext")
Else
WScript.Echo("Unable to connect to Active Directory." & vbCrLf & "Exiting Script." & vbCrLf)
objShell.Popup line, 10, vbTab & "Logon Script", 48
objLogFile.Close
Wscript.Quit
End If
Set objADSysInfo = CreateObject("ADSystemInfo")
strUserDN = objADSysInfo.username
' Bind to user object
Set objUser = Getobject("LDAP://" & strUserDN)
'WScript.Echo "User ID: " & objUser.Get("name")
WScript.Echo "Hello " & objUser.Get("name") & ", your photocopier PIN is: " & objUser.Get("postOfficeBox")
Thanks