System.DirectoryServices.AccountManagement Package Installation Failure

Hi All,

I am trying to include the “System.DirectoryServices.AccountManagement” package or import this reference into my process, but it gets failed. Someone please check and tell me how to import it without this failure notice.

@loginerror, @ovi, @Pablito, please share your input in this issue.

I am on UiPath 2019.10 and it got installed successfully.
Update your UiPath Studio and try again

1 Like

@sarathi125 Now it’s giving me error

1 Like

@MartianxSpace,

Thank you for your time.

I have tried it in two versions 2019.10 and 2019.4 in two different environments, it shows installed, But when you import the System.DorectoryServices.AccountManagement it will be not imported, Please check that as well.

And go back to the Manage package console and check once if you see anything highlighted for this package.

I have checked in my system as well. I am not able to import it.

Hi @sarathi125,
Why instead of this you are not using this package?
image

@Pablito,

I am trying to get the user’s email address from Active Directory using their employee id, we can get it using " System.DirectoryServices.AccountManagement" dll, but with the above package I am not able to get it done.

The below code only I am trying to use,

Dim wi As System.Security.Principal.WindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent()
Dim a As String() = wi.Name.Split(New Char() {"\"c}) '' Context.User.Identity.Name.Split('\')

Dim dc As PrincipalContext = New PrincipalContext(ContextType.Domain, "DomainName")
Dim adUser As UserPrincipal = UserPrincipal.FindByIdentity(dc, a(1))
Dim Email As String = adUser.EmailAddress

You need to use image activity where you will put image of the user and as a output you can have all properties of user or specified one:
image

Hi @sarathi125

You can also try adding the namespace in the Imports panel:
image

2 Likes

This one worked by including the package by opening the xaml in notepad

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.