Jump to content

DSGET script help plz


Gnat
 Share

Recommended Posts

I am trying to write a script that will query AD using dsquery and then use the output from that to get some info from AD using dsget...

The dsquery part works and I get the output that I expect, but the dsget portion gives me nothing...

Any help would be greatly appreciated...

Here is the code...

#Include <Constants.au3>

Global $dsqOutput, $CN, $dsgOutput, $Membership, $Error

$dsqOutput = Run(@ComSpec & " /c dsquery computer domainroot -name hostname", @SystemDir, @SW_HIDE, $STDOUT_CHILD)

$CN = StdoutRead($dsqOutput)

MsgBox(0, "CN=", $CN)

$dsgOutput = Run(@ComSpec & ' /c dsget computer ' & $CN & ' -memberof', @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD)

$Membership = StdoutRead($dsgOutput)

$Error = StderrRead($dsgOutput)

MsgBox(0, "Groups", $Membership)

MsgBox(0, "Error", $Error)

Link to comment
Share on other sites

  • 3 years later...

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...