0
0
Fork 0
This repository has been archived on 2024-05-09. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
org-chart/main.go
2017-05-31 18:13:38 -05:00

39 lines
923 B
Go

package main
import (
"io/ioutil"
adt "github.com/GregoryDosh/org-chart/active_directory_tree"
tree "github.com/GregoryDosh/org-chart/tree_building"
)
func main() {
adConfig := &adt.ActiveDirectoryConfig{
MaxUsers: 500,
BindAddress: "",
BindPort: 636,
BindDN: "",
BindID: "",
BindPassword: "",
BindDomain: "",
SearchDepth: 25,
SearchDisplayName: "",
SearchFieldName: "",
SearchFieldAltNames: []string{"cn"},
SearchFieldTitle: "",
SearchFieldImage: "",
SearchFieldDirectReports: "",
}
parent, err := adt.TraverseEmployeeTree(adConfig, "<USER NAME HERE>")
if err != nil {
panic(err)
}
graph, err := tree.BuildGraph("Org Chart", parent)
if err != nil {
panic(err)
}
ioutil.WriteFile("graph.dot", []byte(graph), 0644)
}