Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: List Workstation Netware
AddExtender('WWNWX34I.DLL') ; Set the script's current context to the root of the tree - this will return object names with their full context. nwSetContext(0,'[Root]','') ; Turn off minor runtime error displaying ONLY FOR THE NEXT FUNCTION - just in case context or options are bad or search results fail. ErrorMode(@OFF) ; find any Workstation classed objects across entire tree (you can be much more specific if you like. WkstList = nwSearchObjects("[Root]","","Workstation",2,"") ; capture any error codes if they exist RC = LastError() ; TURN ERROR HANDLING BACK ON !!! - Very important! or your entire script might not EXIT or report if there is something wrong. ErrorMode(@CANCEL) WkstCount = ItemCount(WkstList,@TAB) if WkstCount == 0 Message("Whoops - Nothing found",RC) else object = AskItemList("Found %WkstCount% Workstations", WkstList, @TAB, @unsorted, @single) ; The next bit of code is ripped out of the example from the NetwareX extender Help file for the nwGetObjValue function. ; You should be able to work out how to get almost any info about the Workstation object that is in NDS e-directory with this. attribs = nwGetObjValue(object,'','','',2) :PickAttrib attrib = ItemExtract(1,ItemSelect(StrCat('Attributes for "',object,'"'),attribs,@TAB),'|') if (attrib == '') then goto PickObject ; Set the flag to get full object information. flag = 1 values = nwGetObjValue(object,attrib,"","",flag) BinBufSize = nwGetObjValue(object,attrib,-1,-1,flag) if (BinBufSize == 0) Message(StrCat('Attribute "',attrib,'"'),'Zero length for attribute value(s)') if (FileExist('BinBuf1.txt')) FileDelete('BinBuf1.txt') endif else BinBuf = BinaryAlloc(BinBufSize) Temp = nwGetObjValue(object,attrib,IntControl(42,BinBuf,0,0,0),BinBufSize,flag) BinaryEODSet(BinBuf,Temp) BinaryWrite(BinBuf,"BinBuf1.txt") BinaryFree(BinBuf) Drop(BinBuf) Message(StrCat('Attribute "',attrib,'"'),StrCat('Binary buffer size = ',BinBufSize,', retrieved bytes = ',Temp)) Drop(BinBufSize,Temp) endif ; Display the values that were retrieved. ItemSelect(StrCat('Attribute = "',attrib,'", flag = ',flag), values, @TAB) ; Set the flag to get basic object information that is formatted ; similar to what the old n4ObjProps() function used to provided. flag = 0 values = nwGetObjValue(object,attrib,"","",flag) BinBufSize = nwGetObjValue(object,attrib,-1,-1,flag) if (BinBufSize == 0) Message(StrCat('Attribute "',attrib,'"'),'Zero length for attribute value(s)') if (FileExist('BinBuf2.txt')) FileDelete('BinBuf2.txt') endif else BinBuf = BinaryAlloc(BinBufSize) Temp = nwGetObjValue(object,attrib,IntControl(42,BinBuf,0,0,0),BinBufSize,flag) BinaryEODSet(BinBuf,Temp) BinaryWrite(BinBuf,"BinBuf2.txt") BinaryFree(BinBuf) Drop(BinBuf) Message(StrCat('Attribute "',attrib,'"'),StrCat('Binary buffer size = ',BinBufSize,', retrieved bytes = ',Temp)) Drop(BinBufSize,Temp) endif ; Display the values that were retrieved. ItemSelect(StrCat('Attribute = "',attrib,'", flag = ',flag), values, @TAB) goto PickAttrib endif exit
Article ID: W16053
File Created: 2004:03:30:15:42:38
Last Updated: 2004:03:30:15:42:38