0 votes

I'm not able to retrieve the Description of a user using ADSI. I'm trying user.Get("description").ToString() on IADsUser

I get the error, The 'description' property cannot be found in the cache. Is there a different method I need to use to get Description?

by (730 points)
0

Nevermind, the user I was testing with did not have any Description. That's why I was getting the error. It works fine for a user who has a Description

1 Answer

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

Hello,

To avoid getting errors for users who don't have a description, it is recommended to use the try...catch structure when getting properties:

try
{
   [string]user.Get("description");
}
catch
{
   Console.WriteLine("Description is empty");
}

Related questions

0 votes
1 answer

Hi Guys, I' d like to get user surname. It's easy using PS but if I want to do it using such ADSI script [Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi") # ... ' property cannot be found in the cache." Do you have any idea, why? Best regards.

asked Dec 10, 2014 by axmaster (510 points)
0 votes
1 answer

Hi Guys, Short question. In our organisation we have a buch of the security group that have a specific "class". The class is simple number stored in the ExtensionAttribute1. I'd ... tried to do the something like that with ADSI :cry: Could you please help me?

asked Dec 8, 2014 by axmaster (510 points)
0 votes
1 answer

When we create a shared mailbox, we create an associated mail-enabled security group. In the security group I want to populate the description field with the name of the shared mailbox ... How can I get just the "name" of the shared mailbox versus the full DN?

asked Feb 4, 2021 by atnorman (120 points)
0 votes
1 answer

We are using the below snippet to grab the email of a single custom attribute object. Can I get guidance on the best way to modify this to get all the emails of each ... "The user specified in parameter 'MyParameter' has no email address. ", "Information") }

asked 3 days ago by msheppard (660 points)
0 votes
1 answer

Is there a way to get the name of the user who approved a request and supply that to a step inside of a custom command? For example, HR submits a status change for an employee. ... and pass it as a param in a custom command that is called in one of the steps?

asked May 12, 2021 by davfount90 (20 points)
3,589 questions
3,278 answers
8,303 comments
548,137 users