Jump to content
Sign in to follow this  

DSGET script help plz

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)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...