Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
I have a script that currently pulls all of the computer names in Active Directory, and puts them into a spreadsheet. What I am having trouble with now, is figuring out how to send a NET SEND message to all of the computers in that list. Any help would be appreciated.
Here is the script I currently have.
[code]
Const ADS_SCOPE_SUBTREE = 2
Set objExcel = CreateObject("Excel.Applic
objExcel.Visible = True
objExcel.Workbooks.Add
Set objConnection = CreateObject("ADODB.Connec
Set objCommand = CreateObject("ADODB.Comman
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnectio
objCommand.Properties("Pag
objCommand.Properties("Sea
objCommand.CommandText = _
"SELECT Name FROM " _
& "'LDAP://dc=****,dc=***' WHERE " _
& "objectCategory='computer'
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
x = 1
Do Until objRecordSet.EOF
objExcel.Cells(x, 1).Value = _
objRecordSet.Fields("Name"
x = x + 1
objRecordSet.MoveNext
Loop
Set objRange = objExcel.Range("A1")
objRange.Activate
Set objRange = objExcel.ActiveCell.Entire
objRange.Autofit()
[/code]
Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
Posted on 2011-05-09 at 09:34:19ID: 36812509
All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.