Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
AddExtender("wwads34i.dll") ; samAccountName of user of interest MyUser = "brendan" MANDATORY = 1 OPTIONAL = 2 MANANDOPT = 3 ServerDn=dsGetProperty("LDAP://rootDSE", "serverName") ServerName=ItemExtract(1, ServerDn, ",") ServerName=ItemExtract(2, ServerName, "=") ServerDn=dsGetProperty("LDAP://rootDSE", "defaultNamingContext") ServerPath="LDAP://%ServerName%/%ServerDN%" UserPath=dsFindPath(ServerPath, "(&(objectCategory=person)(sAMAccountName=%MyUser%))") file=FileOpen("c:\ADSI %MyUser%.csv","WRITE") ; Get mandatory properties of object. sList = dsGetPropName(UserPath,MANDATORY) if sList != "" count=ItemCount(sList,@TAB) FileWrite(file,"Mandatory Property Value(s)") for i = 1 to count name=ItemExtract(i,sList,@TAB) ErrorMode(@OFF) props=dsGetProperty(UserPath,name) StrReplace(props,@TAB,",") ErrorMode(@CANCEL) FileWrite(file,StrCat(name,",",props)) next endif FileWrite(file,"") count="" ; Get optional properties of object. sList = dsGetPropName(UserPath, OPTIONAL) if sList != "" count=ItemCount(sList,@TAB) FileWrite(file,"Optional Property Value(s)") for i = 1 to count name=ItemExtract(i,sList,@TAB) ErrorMode(@OFF) props=dsGetProperty(UserPath,name) StrReplace(props,@TAB,",") ErrorMode(@CANCEL) FileWrite(file,StrCat(name,",",props)) next endif FileClose(file) Run("c:\ADSI %MyUser%.csv","")
Article ID: W15823
File Created: 2004:03:30:15:41:00
Last Updated: 2004:03:30:15:41:00