How do you use cloud databases? Take the survey.
Options

Failing to connect to Server

gtrevorgtrevor Posts: 3
edited March 17, 2017 1:19PM in Redgate Monitor
I'm having all sorts of issues trying to connect to a server on a Trial instance of SQL Monitor.

I've tried numerous configurations of accounts for the Host Machine and SQL Server instance credentials.
Currently I have it set to the default for the Host Machine (eg: NT AUTHORITYSYSTEM) and am using SQL Server credentials for the SQL server.

I'm getting the following warning in the logs and nothing else. Can I lower the log level to debug? Where is that possible

2017-02-13 03:34:42,370 [ 68] 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()

Comments

  • Options
    gtrevor wrote:
    I'm having all sorts of issues trying to connect to a server on a Trial instance of SQL Monitor.

    I've tried numerous configurations of accounts for the Host Machine and SQL Server instance credentials.
    Currently I have it set to the default for the Host Machine (eg: NT AUTHORITYSYSTEM) and am using SQL Server credentials for the SQL server.

    I'm getting the following warning in the logs and nothing else. Can I lower the log level to debug? Where is that possible

    2017-02-13 03:34:42,370 [ 68] 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()

    I have exactly the same issue. Have you found any solution?
    I've searched on other forums but couldn't find anything.
  • Options
    Thanks to Redgate support they pointed me in the direction of this list of items to Test to resolve connection details

    https://documentation.red-gate.com/disp ... on+methods

    Following this and also increase the Connection Timeout from 15 to 30 seconds resolved my issues.
  • Options
    Alex BAlex B Posts: 1,133 Diamond 4
    Hi gtrevor,

    Glad we were able to get it working for you!

    @CharlesJackson1957 I've just replied to this forum post (due to the order of posts when going through the forum) and it looks like the same issue you are having, so please have a look there!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

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