Skip to content

The target principle name is incorrect #32

Description

@a8ball

When running the WSUS database optimization I am getting the following:

Run WSUS database optimization? Y/N: y
Creating custom indexes in WSUS index if they don't already exist. This will speed up future database optimizations.
Invoke-Sqlcmd : A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL
Provider, error: 0 - The target principal name is incorrect.)
At K:\Powershell Scripts\Optimize-WsusServer.ps1:440 char:5

  • Invoke-Sqlcmd -query $createCustomIndexesSQLQuery -ServerInstance ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
    • FullyQualifiedErrorId : SqlExceptionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Invoke-Sqlcmd : Incorrect syntax was encountered while parsing 'IF 0 = (SELECT COUNT(*) as index_count'.
At K:\Powershell Scripts\Optimize-WsusServer.ps1:440 char:5

  • Invoke-Sqlcmd -query $createCustomIndexesSQLQuery -ServerInstance ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], BatchParserException
    • FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Running WSUS SQL database maintenence script. This can take an extremely long time on the first run.
Invoke-Sqlcmd : A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL
Provider, error: 0 - The target principal name is incorrect.)
At K:\Powershell Scripts\Optimize-WsusServer.ps1:444 char:5

  • Invoke-Sqlcmd -query $wsusDBMaintenanceSQLQuery -ServerInstance $ ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
    • FullyQualifiedErrorId : SqlExceptionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Invoke-Sqlcmd : Incorrect syntax was encountered while parsing 'SET NOCOUNT ON;'.
At K:\Powershell Scripts\Optimize-WsusServer.ps1:444 char:5

  • Invoke-Sqlcmd -query $wsusDBMaintenanceSQLQuery -ServerInstance $ ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], BatchParserException
    • FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions