| | |
Display List of Computers in a Specific OU in VBA
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2008
Posts: 3
Reputation:
Solved Threads: 0
I have two OUs OU=Student and OU=Teachers and my root OU is
LDAP://dc=test,dc=labs,dc=edu
in the Student OU i have three computers named Std1,Std2,Std3 and three computers in Teachers OU named Tea1,Tea2,Tea3
I am writing a VBA script in Excel in which i want to display my Computers in that OU in a excel spreadsheets.
Computer Name Description OU
Std1 Student Computers Student
Std2 Student Computers Student
...................List goes on.......list of all computers in Student OU and Teachers OU
This is my script but its not working can anyone help me?
LDAP://dc=test,dc=labs,dc=edu
in the Student OU i have three computers named Std1,Std2,Std3 and three computers in Teachers OU named Tea1,Tea2,Tea3
I am writing a VBA script in Excel in which i want to display my Computers in that OU in a excel spreadsheets.
Computer Name Description OU
Std1 Student Computers Student
Std2 Student Computers Student
...................List goes on.......list of all computers in Student OU and Teachers OU
This is my script but its not working can anyone help me?
vbnet Syntax (Toggle Plain Text)
Sub ListDomains() Dim objNameSpace Dim Domain Dim ou Dim pcs Set objNameSpace = GetObject("LDAP://dc=test,dc=labs,dc=edu") For Each objDomain In objNameSpace ou = objDomain.Name objDomain.Filter = Array("Computer") For Each objComputer In objDomain pcs = objComputer.Name Dim i For i = 0 To pcs.Count - 1 Cells(i, 1) = pcs Next Next Next End Sub
Last edited by cscgal; Sep 4th, 2008 at 5:42 pm. Reason: Added code tags
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: how to compress and send a file for a Infrared modem?
- Next Thread: creating macros using vb
Views: 1536 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application array arrays basic bing button buttons c# center check checkbox code convert crystalreport data database datagrid datagridview date design designer dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert installer intel internet listview mobile monitor net networking objects output panel passingparameters picturebox port position print printing problem read remove save searchbox searchvb.net select serial shutdown soap sorting studio survey table tcp temperature text textbox time timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet visual visualbasic visualbasic.net visualstudio2008 web webbrowser winforms wpf year





