Jump to content

help translate from vbs to au3


Recommended Posts

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...