Sign in to follow this  
Followers 0
tbaror

help translate from vbs to au3

3 posts in this topic

Hi,

since i am new to AU3 could someone please help me translate below script to AU3

Thanks

Dim strDomain         'string containing the NT domain name
Dim objDomain        'ADSI Domain object
Dim objComputer   'ADSI Computer object
 
strDomain = "MyDomain"
Set objDomain = GetObject("WinNT://" & strDomain)
objDomain.Filter = Array("computer")
 
For Each objComputer In objDomain
    WScript.Echo objComputer.Name
Next

Share this post


Link to post
Share on other sites



You will need to use ObjCreate() and look in the For Next loop :D

Share this post


Link to post
Share on other sites

@tbaror

#include <array.au3>

$strDomain = "MyDomain"
$objDomain = ObjGet("WinNT://" & $strDomain)
$objDomain.Filter = _ArrayCreate("Computer","User")

For $objComputer In $objDomain
    ConsoleWrite ("Computer ... "  &  $objComputer.Name & @CRLF)
Next

Enjoy !!

ptrex

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0