0 votes

We have an AD Atturbute called HRManager which refferances AD accounts (like the manager attubute does) is there a way to get the email address of the referanced account in a script?

by (1.3k points)

1 Answer

0 votes
by (270k points)
selected by
Best answer

Hello,

Yes, it is possible using the below script for a DN syntax property like the Manager one. In the script, the $propertyName variable specifies the LDAP name of the property.

$propertyName = "manager" #TODO: modify me

# Get the object DN
try
{
    $dn = $Context.TargetObject.Get($propertyName)
}
catch
{
    $Context.LogMessage("Property $propertyName is empty.", "Information")
    return
}

# Get object email
try
{
    $object = $Context.BindToObjectByDN($dn)
    $objectEmail = $object.Get("mail")
}
catch
{
    $Context.LogMessage("Object with DN $dn does not exist or has no email specified.", "Information")
    return
}

Related questions

0 votes
1 answer

I have a custom command that prompts for a "reporter" for our ticketing system for enabling VPN accounts. Sometimes a technician will enable an account on behalf of another ... do I extract the email address of that object chosen as a parameter? Thank you.

asked Dec 10, 2019 by bjzielinski (70 points)
0 votes
1 answer

Hello, I don't find an attribute for the netbios name of managed Domains like adm-DomainDN? How can I add the NetBios name to a report like "All users"? regards Helmut

asked Mar 5, 2021 by a423385 (510 points)
0 votes
1 answer

Hi Is it possible to get the Web Interface address via a script? Thanks Matt

asked Oct 13, 2023 by chappers77 (2.0k points)
0 votes
1 answer

Hello, i have a custom command which sets the oof-message for the selected user. in this custom command i have a parameter "param-vertretung" (ad-object picker). Now i want to ... and email of the stand-in in the oof-message. Can you help me with that? Thanks

asked Nov 13, 2020 by lohnag (140 points)
0 votes
1 answer

My security team is looking to do a security review and would like the vendor to fill out a questionnaire.

asked Aug 25, 2023 by LarrySargent (20 points)
3,326 questions
3,026 answers
7,727 comments
544,678 users