Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running windapsearch from within go program. - Arguments not crossing over properly #14

Open
roborobs1023 opened this issue Feb 17, 2021 · 0 comments

Comments

@roborobs1023
Copy link

roborobs1023 commented Feb 17, 2021

I'm trying to run windapsearch from within another go program.

I am using cmd,
err := exec.Command(path to windapsearch, "-d" + dc, "-u" + username, "-p"+ password, "-j", "-ousers.json", "-musers", "--attrs givenName,sn,userPrincipalName,Department", "--filter (!(userAccountControl:1.2.840.113556.1.4.803:=2))") fmt.Println(cmd)

for some reason when I run this within the go
fmt.Println(cmd) shows that the correct string was transferred as the command C:\Scripts\Go\Test\os-cmd\windapsearch.exe -d'dc' -u'username' -p'password' -j -ousers.json -musers --attrs givenName,sn,userPrincipalName,Department --filter (!(userAccountControl:1.2.840.113556.1.4.803:=2))

neither the filter nor the attribute selection are being implemented however the output is going to the correct file.

When I run the same command as it is output by fmt directly in cmd everything works perfectly. Any ideas?

@roborobs1023 roborobs1023 changed the title Odd issue. Running windapsearch from within go program. Feb 19, 2021
@roborobs1023 roborobs1023 changed the title Running windapsearch from within go program. Running windapsearch from within go program. - Arguments not crossing over properly Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant