public static ADObjectId Redact(ADObjectId adObjectId, out string raw, out string redacted) { raw = null; redacted = null; if (adObjectId == null || string.IsNullOrWhiteSpace(adObjectId.DistinguishedName)) { return(adObjectId); } string distinguishedName = null; if (adObjectId.ObjectGuid == Guid.Empty) { distinguishedName = SuppressingPiiData.RedactDN(adObjectId.DistinguishedName, out raw, out redacted); } return(new ADObjectId(distinguishedName, adObjectId.PartitionGuid, adObjectId.ObjectGuid)); }