Comment ========================================================== Copyright 1994-96 by Marc Perkel * All right reserved. This utility will dump the contents of the NetWare bindery to a file in INI format or set the bindery from an INI text file. ========================================================= EndComment ;#Define Shareware Var Operators TextName TextFile ReadData WriteData Setup Main ;============================================= ;----- Subroutines Procedure WriteBindery var Obj Ty St St2 KeyWord V R F FileAssign(F,TextName) FileOpen(F) while not EndOfFile(F) St = FileReadLn(F) Trim(St) if St StartsWith 'DELUSER' St2 = NextWordDelim(St,' ') Writeln 'Deleting User: ' St NovDeleteObject(St,1) elseif St StartsWith 'DELGROUP' St2 = NextWordDelim(St,' ') Writeln 'Deleting Group: ' St NovDeleteObject(St,2) elseif St StartsWith 'DELQUEUE' St2 = NextWordDelim(St,' ') Writeln 'Deleting Group: ' St NovDeleteObject(St,3) elseif St StartsWith '[' Obj = mid(St,2,length(St) - 2) Ty = 0 else KeyWord = UpperCase(LeftOfEqual(St)) V = RightOfEqual(St) R = UpperCase(V) if KeyWord = 'TYPE=' if R = 'USER' Ty = 1 NovCreateUser(Obj) Writeln Writeln 'Creating User: ' Obj elseif R = 'GROUP' Ty = 2 NovCreateGroup(Obj) Writeln Writeln 'Creating Group: ' Obj elseif R = 'QUEUE' Ty = 3 NovCreatePrintQueue(Obj) Writeln Writeln 'Creating PrintQueue: ' Obj endif elseif KeyWord = 'FULLNAME=' NovFullName(Obj,Ty) = V Writeln 'Setting FullName to: ' V endif if Ty = 1 if KeyWord = 'GROUP=' NovAddUserToGroup(Obj,R) Writeln 'Adding User to Group: ' V elseif KeyWord = 'SECURITYEQUALS=' NovAddToSet(Obj,'SECURITY_EQUALS',1,R,1) Writeln 'Adding Security Equivelence: ' V elseif KeyWord = 'CONSOLEOPERATOR=' if R = 'Y' NovStaticProperty On NovSetProperty On NovPropertySecurity $31 NovCreateProperty(NovDefaultServer,'OPERATORS',4) NovAddToSet(NovDefaultServer,'OPERATORS',4,Obj,1) Writeln 'Adding Console Operator' elseif R = 'N' NovDeleteFromSet(NovDefaultServer,'OPERATORS',4,Obj,1) Writeln 'Removing Console Operator' endif elseif KeyWord = 'PASSWORD=' NovChangeObjPassword(Obj,1,'',V) Writeln 'Setting Password to: ' V elseif KeyWord = 'PASSWORDINTERVAL=' NovPasswordInterval(Obj) = Value(V) NovPasswordRequired(Obj) = True Writeln 'Setting Password Interval to: ' V elseif KeyWord = 'PASSWORDREQUIRED=' NovPasswordRequired(Obj) = R <> 'N' Writeln 'Setting Password Required to: ' R elseif KeyWord = 'MINPASSWORDLENGTH=' NovMinPasswordLength(Obj) = Value(V) Writeln 'Setting Minimum Password length to: ' V elseif KeyWord = 'MAXCONNECTIONS=' NovMaxUserConnections(Obj) = Value(V) Writeln 'Setting Maximum Connections to: ' V elseif KeyWord = 'GRACELOGINS=' NovGraceLogins(Obj) = Value(V) NovGraceLoginReset(Obj) = Value(V) Writeln 'Setting Grace Logins to: ' V endif elseif Ty = 2 if KeyWord = 'MEMBER=' NovAddUserToGroup(R,Obj) Writeln 'Adding User to Group: ' V elseif KeyWord = 'CONSOLEOPERATOR=' if R = 'Y' NovAddToSet(NovDefaultServer,'OPERATORS',4,Obj,1) Writeln 'Adding Console Operator' elseif R = 'N' NovDeleteFromSet(NovDefaultServer,'OPERATORS',4,Obj,1) Writeln 'Removing Console Operator' endif endif elseif Ty = 3 if KeyWord = 'SERVER=' NovAddToSet(Obj,'Q_SERVERS',3,R,7) Writeln 'Adding Print Server: ' V elseif KeyWord = 'OPERATOR=' NovAddToSet(Obj,'Q_OPERATORS',3,R,2) if NovResult <> 0 NovAddToSet(Obj,'Q_OPERATORS',3,R,1) endif Writeln 'Adding Operator: ' V elseif KeyWord = 'USER=' NovAddToSet(Obj,'Q_USERS',3,R,2) if NovResult <> 0 NovAddToSet(Obj,'Q_USERS',3,R,1) endif Writeln 'Adding User: ' V elseif KeyWord = 'DIRECTORY=' if ExistDir R NovWritePropValue(Set[R],Obj,'Q_DIRECTORY',Ty) Writeln 'Setting Directory to: ' R endif endif endif endif EndWhile FileClose(F) EndProc Procedure FWrite ($St) FileWriteln(TextFile,St) EndProc Procedure ReadBindery var Users Groups Queues QServers QUsers QOperators FullName SecEqu NovPropertyValues(Operators,NovDefaultServer,'OPERATORS',4) FileAssign(TextFile,TextName) FileCreate(TextFile) FWrite ';-- Groups' FWrite NovGroups(Groups) Loop Groups Write 'Processing ' LoopVal ' ... ' FWrite '[' LoopVal ']' FWrite 'Type=Group' FullName = NovFullName(LoopVal,2) if FullName > '' FWrite 'FullName=' FullName endif FWrite Writeln EndLoop FWrite ';-- Users' FWrite NovUsers(Users) Loop Users Write 'Processing ' LoopVal ' ... ' FWrite '[' LoopVal ']' FWrite 'Type=User' FullName = NovFullName(LoopVal) if FullName > '' FWrite 'FullName=' FullName endif if PosInList(LoopVal,Operators) > 0 FWrite 'ConsoleOperator=Y' endif if NovGraceLoginReset(LoopVal) < 255 FWrite 'GraceLogins=' NovGraceLoginReset(LoopVal) endif if NovMinPasswordLength(LoopVal) > 0 FWrite 'MinPasswordLength=' NovMinPasswordLength(LoopVal) endif if NovMaxUserConnections(LoopVal) > 0 FWrite 'MaxConnections=' NovMaxUserConnections(LoopVal) endif if NovPasswordInterval(LoopVal) > 0 FWrite 'PasswordInterval=' NovPasswordInterval(LoopVal) endif NovReadGroups(LoopVal,Groups) Loop Groups FWrite 'Group=' LoopVal EndLoop NovReadSecurityEquals(LoopVal,SecEqu) Loop SecEqu if PosInList(LoopVal,Groups) = 0 FWrite 'SecurityEquals=' LoopVal endif EndLoop FWrite Writeln EndLoop FWrite ';-- Queues' FWrite NovPrintQueues(Queues) Loop Queues Write 'Processing ' LoopVal ' ... ' FWrite '[' LoopVal ']' FWrite 'Type=Queue' FullName = NovFullName(LoopVal,3) if FullName > '' FWrite 'FullName=' FullName endif NovPropertyValues(QServers,LoopVal,'Q_SERVERS',3) Loop QServers FWrite 'Server=' LoopVal EndLoop NovPropertyValues(QUsers,LoopVal,'Q_USERS',3) Loop QUsers FWrite 'User=' LoopVal EndLoop NovPropertyValues(QOperators,LoopVal,'Q_OPERATORS',3) Loop QOperators FWrite 'Operator=' LoopVal EndLoop FWrite Writeln EndLoop FileClose(TextFile) EndProc #If Shareware Procedure Beg BoxBorderColor Green Blue BoxInsideColor White Blue BoxHeaderColor Yellow Mag BoxHeader ' * Shameless Beg Screen * ' DrawBox 10 8 61 6 Writeln WriteCenter '* BindEZ Evaluation Copy *' Writeln WriteCenter 'Please remember to register this software.' Wait 600 EraseTopWindow ClearKbdBuffer EndProc #Endif Procedure Pause var Ch if OutputRedirected then Return Write 'Press and Key ... ' Ch = ReadKey Write CR ' ' CR EndProc Procedure Help Include 'ADDRESS.INC' Writeln 'This utility will export bindery data to an INI type text file' Writeln 'or import bindery data from an INI type text file.' Writeln Writeln ' Usage: BINDEZ /W/R' Writeln Writeln ' Example: BINDEZ TEST.TXT /R ;reads data into TEST.TXT' Writeln Writeln ' /R = Read Bindery Information into a File' Writeln ' /W = Write Bindery Information from a File' Writeln Writeln 'Price $95 per Server.' Writeln 'Written in MarxMenu. Comes free with the Network Survival Kit.' Writeln Pause Writeln ' Example INI file for BindEZ' Writeln Writeln ' [NewUser]' Writeln ' Type=User' Writeln ' MaxConnections=65' Writeln ' PasswordInterval=50' Writeln ' FullName=My New User' Writeln ' Group=EVERYONE' Writeln ' Group=PEOPLE' Writeln ' SecurityEquals=SUPERVISOR' Writeln Writeln ' [WordStar]' Writeln ' Type=Group Writeln ' FullName=WordStar Users Writeln Writeln ' [LaserJet]' Writeln ' Type=Queue Writeln ' FullName=WordStar Users Writeln ' Operator=Joe' Writeln ' User=Accounting' Writeln Pause Writeln "To create an object you specify it's name in brackets. All" Writeln 'lines after the object affect that object.' Writeln Writeln 'The first line after the object name has to be a Type= line.' Writeln 'This tells BindEZ what kind of object to create. Object types' Writeln 'supported are:' Writeln Writeln ' Type=User' Writeln ' Type=Group' Writeln ' Type=Queue' Writeln Writeln 'The Type command actually creates the object in the bindery if' Writeln "it doesn't already exist.' If a User is created, it uses the" Writeln 'default account balance restrictions.' Writeln Writeln 'Different objects have different keywords. Here is a list of' Writeln 'the different keywords for different objects.' Writeln Pause Writeln 'Keywords for USERS:' Writeln Writeln ' FullName=String ;Sets users full name' Writeln ' Group=GroupName ;Adds user to group' Writeln ' SecurityEquals=User ;Adds security equivelence' Writeln ' GraceLogins=Value ;Sets grace logins' Writeln ' Password=String ;Sets password' Writeln ' PasswordRequired=Y/N ;Sets password required status' Writeln ' PasswordInterval=Value ;Sets password change interval' Writeln ' MinPasswordLength=Value ;Sets minimum password length' Writeln ' MaxConnections=Value ;Sets maximum user connections' Writeln ' ConsoleOperator=Y/N ;Sets console operatorstatus' Writeln Pause Writeln 'Keywords for GROUPS:' Writeln Writeln ' FullName=String ;Sets users full name' Writeln ' Member=User ;Adds a group member Writeln ' ConsoleOperator=Y/N ;Sets console operatorstatus' Writeln Writeln 'Keywords for QUEUES:' Writeln Writeln ' FullName=String ;Sets users full name' Writeln ' Server=PrintServer ;Adds a print server' Writeln ' Operator=User,Group ;Adds a queue operator' Writeln ' User=User,Group ;Adds a queue user' Writeln ' Directory=String ;Changes Queue Directory' Writeln Writeln 'BindEZ can also be used to delete users, groups and queues.' Writeln Writeln ' DelUser Name' Writeln ' DelGroup Name' Writeln ' DelQueue Name' Writeln Pause Writeln 'Uses for BindEZ:' Writeln Writeln 'BindEZ can be used for a number of things. If you have several' Writeln 'servers and want to merge them into one, BindEZ is just what you' Writeln 'want. You can also use BindEZ as a quick way to add a bunch of' Writeln 'people to a new group or to mass update things like password' Writeln 'expiration dates.' Writeln Writeln 'BindEZ can also be part of your backup script. You can read the' Writeln 'bindery to a text file before you back up your server. That way' Writeln "you don't have to count on your tape beckup being smart enough to" Writeln 'deal with the bindery.' Writeln Writeln 'You may be wondering if this works with Netware 4. Yep, Uh Huh,' Writeln "sure does. I'm still waiting for a usable interface into NDS. For" Writeln 'more information abou this check out my Web Page.' Writeln Writeln 'To move Trustee rights, try my TrustEZ program.' Writeln exitmenu EndProc Procedure Setup #If Shareware Beg #Endif ExitCode = 0 StandardIO UpperCaseCompare Writeln Writeln 'Computer Tyme BindEase * Copyright 1994-96 by Marc Perkel' Writeln 'All Rights Reserved * Version 1.2 * Release Date: 08-16-96' ReadData = OptionSwitch(CmdLine,'R') WriteData = OptionSwitch(CmdLine,'W') if not WriteData then ReadData = True TextName = UpperCase(CmdLine) Trim(TextName) if (pos('/?',CmdLine) > 0) or (TextName = '') Help endif if NovConnection = 0 Writeln 'This utility works only with NetWare!' ExitCode = 1 ExitMenu endif EndProc Procedure Main if ReadData then ReadBindery if WriteData then WriteBindery EndProc