Create and delete NetWare and GroupWise accounts
Top  Previous  Next


Batch section

·Create OU in which to create accounts  
·Create group that accounts will be members of  
·Give group access right to profile  
·For each row in [Data] section  
·Create NetWare account  
·Add account to group  
·Set profile for account (Profile contains this row in logon-script: map root y:=%HOME_DIRECTORY)  
·Create home directory  
·Give account access right to home directory  
·Create GroupWise account  

Undo section

·For each row in [Data] section  
·Delete GroupWise account  
·Delete NetWare account  
·Delete home directory  
·Delete group  
·Delete OU  

Requirements

·NetWare client on the local machine, log on as admin  
·Novell controls  
·GroupWare client on the local machine  

Script

[Settings_Begin]
BatchSettings.Delimiter=TAB
BatchSettings.MarkerCol=4

SET SurName=%col1%
SET AccountName=%col2%    // %AccountName% instead of actual column below = easier to change column
SET Password=%col3%

SET GroupName=MyGroup

SET NDRoot=ELM\MyOrg\MyOU
SET NDOU=OU3

SET NDOUPath=%NDRoot%\%NDOU%

SET Profile=%NDRoot%\MyProfile

SET HomeVolume=\\homer\sys
SET HomeDir=public\users\%AccountName%
SET HomeDirFullPath=%HomeVolume%\%HomeDir%
SET HomeDirNDPath=\\ELM\MyOrg\MyOu\HOMER_SYS

SET GW_DomainDataBasePath=\\homer\sys\system\domdir
SET GW_PostOffice=HQPO
[Settings_End]


[Batch_Begin]
Nov.DS.OU.Create %NDRoot%, %NDOU%   
Nov.DS.Group.Create %NDOUPath%, %GroupName%   
// Give group access to profile   
Nov.DS.Object.AddTrustee %Profile%,%NDOUPath%\%GroupName%   
Data.Loop   
 Nov.DS.Account.Create %NDOUPath%, %Surname%, %AccountName%, %Password%   
 Nov.DS.Group.AddObject %NDOUPath%\%GroupName%, %NDOUPath%\%AccountName%
 Nov.DS.Object.SetProperty %NDOUPath%\%AccountName%, Profile, \\%Profile%   
 DOS md %HomeDirFullPath%   
 Nov.Vol.AddTrustee %HomeVolume%,%HomeDir%,%NDOUPath%\%AccountName%,RWCEMF
 Nov.DS.Object.SetProperty %NDOUPath%\%AccountName%, Home Directory, %HomeDirNDPath%, %HomeDir%   
 Nov.GW.Account.Create %GW_DomainDataBasePath%, %GW_PostOffice%, %AccountName%, %NDOUPath%\%AccountName%   
Data.EndLoop   
[Batch_End]


[Undo_Batch_Begin]
Data.Loop   
  Nov.GW.Account.Delete %GW_DomainDataBasePath%, %GW_PostOffice%, %AccountName%   
  Nov.DS.Account.Delete %NDOUPath%, %AccountName%   
  DOS echo y| rd %HomeDirFullPath% /s   
Data.EndLoop   
Nov.DS.Group.Delete %NDOUPath%, %GroupName%   
Nov.DS.OU.Delete %NDRoot%, %NDOU%
[Undo_Batch_End]


[Data_Begin]
Surname1   AccountName1   Password         
Surname2   AccountName2   Password         
Surname3   AccountName3   Password         
[Data_End]