You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
roborobs1023
changed the title
Odd issue.
Running windapsearch from within go program.
Feb 19, 2021
roborobs1023
changed the title
Running windapsearch from within go program.
Running windapsearch from within go program. - Arguments not crossing over properly
Feb 19, 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?
The text was updated successfully, but these errors were encountered: