Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Go 转到Active Directory对象GUID属性_Go - Fatal编程技术网

Go 转到Active Directory对象GUID属性

Go 转到Active Directory对象GUID属性,go,Go,我是个新手,我正在创建一个LDAP提取器 当前无法将OBJECTGUID属性转换为人类可读的人类字符串,以便稍后插入数据库 我正在使用github.com/go ldap/ldap/v3包,我已经尝试了这两种方法 entry.GetAttributeValue(“objectGUID”)和entry.GetRawAttributeValue(“objectGUID”) 我已经尝试了字符串string(variable)并尝试了hex.DecodeString,但仍然得到了不可读的字符 有人知道如

我是个新手,我正在创建一个LDAP提取器

当前无法将OBJECTGUID属性转换为人类可读的人类字符串,以便稍后插入数据库

我正在使用
github.com/go ldap/ldap/v3
包,我已经尝试了这两种方法
entry.GetAttributeValue(“objectGUID”)
entry.GetRawAttributeValue(“objectGUID”)

我已经尝试了字符串
string(variable)
并尝试了
hex.DecodeString
,但仍然得到了不可读的字符


有人知道如何将其转换为普通ut8字符串吗?

如果该字段是UUID,则它可能返回原始[]字节而不是字符串。您可能需要尝试entry.GetRawAttributeValue()和
fmt.Sprintf(“%x”,value)
。还有一个github.com/google/uuid包,您可以使用它将其解析为uuid。@noize将GUID转换为字符串的过程中,您能完成吗?@sushanth是的,我使用了Burak help.html.EscapeString(fmt.Sprintf(“%x”,entry.GetRawAttributeValue(“objectGUID”))如果字段是uuid,那么它可能返回的是原始[]字节,而不是字符串。您可能需要尝试entry.GetRawAttributeValue()和
fmt.Sprintf(“%x”,value)
。还有一个github.com/google/uuid包,您可以使用它将其解析为uuid。@noize将GUID转换为字符串的过程中,您能完成吗?@sushanth是的,我使用了Burak help.html.EscapeString(fmt.Sprintf(“%x”,entry.GetRawAttributeValue(“objectGUID”))