Link to home
Start Free TrialLog in
Avatar of maincabin
maincabin

asked on

VBS Reading Null Value in AD User Account wWWHomePage Attribute

I'm trying to get the ppt to start if there is no value in the wWWHomePage attribute. I keep getting an error: The directory property cannot be found in the cache. I've tried several different call outs for IsNull or Empty.

Dim objSysInfo ,objUser ,strwWWHomePage,strUserDN,ppt, strMbox

Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUserDN)

strwWWHomePage = objUser.Get("wWWHomePage")
If IsNull(strwWWHomePage) or strwWWHomePage = Empty Then

Set ppt = CreateObject("PowerPoint.Application")
  strMbox = MsgBox("Click OK to start PowerPoint presentation")
  ppt.Visible = True
  ppt.Presentations.Open "\\serverxx\tracking\ppt.ppsx"
 
Else
  wscript.quit

End If
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maincabin
maincabin

ASKER

Perfect!