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
Hi,
I'm trying to get some extra attributes in result of Get-ADDBAccount -All.
attributes with String(Unicode) syntax added easily,
but I can't change source code to get attributes with Object(DS-DN) syntax like "Member".
what should I do?
The text was updated successfully, but these errors were encountered:
The C# code we use for something similar is:
(for multi-valued attributes you need to iterate over byte[][] and parse each byte[] to DsName)
`
public DsName(byte[] binaryVal)
{
int currPos = 0;
StructLength = BitConverter.ToUInt32(binaryVal, currPos);
currPos = 4;
_sidLength = BitConverter.ToUInt32(binaryVal.Skip(currPos).Take(4).ToArray(), 0);
currPos += 4;
byte[] guidBytes = binaryVal.Skip(currPos).Take(16).ToArray();
ObjectGuid = new Guid(guidBytes);
currPos += 16;
// The size of this field is exactly 28 bytes, regardless of the value of SidLen,
// which specifies how many bytes in this field are used.
byte[] sidBytes = binaryVal.Skip(currPos).Take(28).ToArray();
Sid = (_sidLength > 0) ? new SecurityIdentifier(sidBytes, 0) : null;
currPos += 28;
_nameLength = BitConverter.ToUInt32(binaryVal.Skip(currPos).Take(4).ToArray(), 0);
currPos += 4;
DistinguishedName = Encoding.Unicode.GetString(binaryVal.Skip(currPos).Take((int)(_nameLength*2)).ToArray());
}
Hi,
I'm trying to get some extra attributes in result of Get-ADDBAccount -All.
attributes with String(Unicode) syntax added easily,
but I can't change source code to get attributes with Object(DS-DN) syntax like "Member".
what should I do?
The text was updated successfully, but these errors were encountered: