Retrieves organization information (including a list of all direct reports) for the MyerKen user account in Active Directory.
On Error Resume NextSet objUser = GetObject _("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")strTitle = objUser.Get("title")strDepartment = objUser.Get("department")strCompany = objUser.Get("company")strManager = objUser.Get("manager")arrDirectReports = objUser.GetEx("directReports")WScript.echo "Title: " & strTitleWScript.echo "Department: " & strDepartmentWScript.echo "Company: " & strCompanyWScript.echo "Manager: " & strManagerWScript.echo "Direct Reports:"For Each strValue in arrDirectReportsWScript.echo strValueNext
This is a VB Script, this can be used by saving the file in .vbs file