This
is what I run - it assumes a SQL database containing tables staff (basic
personal details) and tel_staff (phone numbers)
Our
user IDs are the same as the payroll numbers (which makes this easy!) and the
function GetAdsPath returns the path if the user exists or "not found" if they
don't exist (some members of staff don't have network accounts). Some staff have
more than one phone number, hence the check to see if it's the second time a
user has been found. Clearnull is a function which checks for NULL and replaces
it with N/A (because things fall over in AD if you try and set values to
NULL!)
Steve
sql="select department,section,
jobtitle,staff.staff_no,ext, surname from staff left join tel_staff on
tel_staff.staff_no=staff.staff_no"
RS2.Open sql,db2 Do While Not RS2.EOF id=trim(rs2("staff_no")) ext=clearnull(trim(rs2("ext"))) If id<>oldid Then strUserPath=GetAdsPath(rs2("staff_no")) If strUserPath <>"Not Found" And id <>oldID Then Set usr=getobject(strUserPath) usr.telephonenumber=ext usr.title=clearnull(rs2("jobtitle")) usr.company=clearnull(rs2("department")) usr.department=clearnull(rs2("section")) usr.setinfo End If Else usr.telephonenumber=usr.telephonenumber & "/" & ext usr.setinfo End If oldid=id rs2.MoveNext Loop RS2.Close
|
Title: Message
- RE: [ActiveDir] Locking Down User Informa... Wright, T. MR NSSB
- RE: [ActiveDir] Locking Down User Informa... Hazelman, Doug
- RE: [ActiveDir] Locking Down User Informa... Hazelman, Doug
- RE: [ActiveDir] Locking Down User Informa... Rogers, Brian
- RE: [ActiveDir] Locking Down User Informa... Ken Cornetet
- RE: [ActiveDir] Locking Down User Informa... Jackson Shaw
- RE: [ActiveDir] Locking Down User Informa... Duncan, Larry
- Steve Rochford