New release: SQL Monitor Version 12.0 is now available. Read more.

Error asking Active Directory for current user's principal n

jfussjfuss Posts: 4 Bronze 1
edited March 17, 2017 9:40AM in SQL Monitor
Hi,
I am having an issue configuring email notifications, when I try ti send a test email it failed. I have found the following error in the Web log file, it is generated when I try to send a test email:
2017-03-15 15:54:14,074 [ 132] WARN RedGate.Response.Common.Utilities.UserAccountHelper - Error asking Active Directory for current user's principal name
System.InvalidCastException: Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'.
 at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)
 at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()
 at RedGate.Response.Common.Utilities.UserAccountHelper.GetUsername()System.InvalidCastException: Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'.
 at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)
 at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()
 at RedGate.Response.Common.Utilities.UserAccountHelper.GetUsername()
Thanks,
Jon.

Comments

  • Alex BAlex B Posts: 1,000 Diamond 3
    Hi Jon,

    I believe you will need to add the service account used to query Active Directory to the Domain Builtin group “Windows Authorization Access Group” to correct this issue (be sure to restart the SQL Monitor Base Monitor service). If that doesn't work please also try adding the user the SQL Monitor Base Monitor service runs as to the group as well.

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.