Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords:
;This UDF returns various sorts of user names. ;Username type 1 is used here. #DefineFunction GetUserNameEx(type) dll=StrCat(DirWindows(1),"secur32.dll") bbsize=1000 bb=BinaryAlloc(bbsize) BinaryEodSet(bb,bbsize) bbs=BinaryAlloc(4) BinaryPoke4(bbs,0,bbsize) DllCall(dll,long:"GetUserNameExA",long:type,lpbinary:bb,lpbinary:bbs) retval=BinaryPeekStr(bb,0,bbsize) BinaryFree(bb) BinaryFree(bbs) Return(retval) #EndFunction UserNameAD = GetUserNameEx(1) ; Get ADSI compatible user name ;UserName = wntGetUser(@default) ; Get standard user name ;fullname=wntUserGetDat("\\SERVER1",UserName,"full_name") ; get users full name for no reason dsSetCredent("", "") sUserPath = StrCat("LDAP://sysboomba/",UserNameAD) sGroupPath = "LDAP://SEBDOM1/cn=WORKERS,OU=DEPARTMENT,OU=COMPANY,DC=sys,DC=boom,DC=ba" If dsIsMemberGrp(sGroupPath,sUserPath) IsMemberofWORKERSGroup = @TRUE Else IsMemberofWORKERSGroup = @FALSE EndIf
Article ID: W15815
File Created: 2004:03:30:15:40:58
Last Updated: 2004:03:30:15:40:58