grant additional accounts the write members property
- From: Lieka Heineken <LiekaHeineken@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 8 Apr 2008 11:47:03 -0700
The below script reads input from an excel work*** and creates a global
distribution list. I am seeking to have it read accounts to be granted the
write members property on the security of the object. I would also like it to
check the box can modify members on the managed by tab and set the exchange
attributes...
-----------------------------------------------------------
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:\Scripts\script_input.xls")
intRow = 3 'intiatiates reading from the 3rd row of the above sprea***
Const ADS_GROUP_TYPE_GLOBAL_GROUP = &h2
Do Until objExcel.Cells(intRow,1).Value = "" 'does below task until first
column of the row being read is blank
strDL = Trim(objExcel.Cells(intRow, 1).Value)
strOwner = Trim(objExcel.Cells(intRow, 2).Value)
strManageby = Trim(objExcel.Cells(intRow, 3).Value)
Set objOU = GetObject("LDAP://ou=accounts,dc=domain,dc=com") 'binds to the
active directory container accounts in the domain domain.com
Set objGroup = objOU.Create("Group", "cn=" & strDL) 'creates a group with
the name of variable
objGroup.Put "sAMAccountName", strDL
objGroup.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP
objGroup.Put "info", "OWNER/APPROVER = " & strOwner
objGroup.Put "Description", "OWNER/APPROVER = " & strOwner
objGroup.Put "managedBy", strManageby
objGroup.SetInfo
intRow = intRow + 1
Loop
objExcel.quit
wscript.echo "Complete"
.
- Prev by Date: Re: WSH error help
- Next by Date: unspecified error
- Previous by thread: WSH error help
- Next by thread: unspecified error
- Index(es):