This project is read-only.

Write-Log : Failed to scan error

Sep 4, 2013 at 5:11 PM
I'm getting the below errors when the 'Get-SqlServerInventoryToClixml.ps1' script is scanning the found SQL instances:

Write-Log : Failed to scan PACEPRINT01.CALOPTIMA.ORG\HPWJA - 3 errors
At C:\Users\sqlexec\Documents\WindowsPowerShell\Modules\SqlServerInventory\SqlServerInventory.psm1:275 char:13
  • Write-Log <<<< -Message $Message -MessageLevel $MessageLevel
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log
Sep 4, 2013 at 6:51 PM
Some more information...I ran the PowerShell ISE as an administrator, and with a Windows Credential account that is a domain admin. This domain admin Windows account is also a member of an AD group that is a SQL sysadmin on all of our SQL servers.
Sep 4, 2013 at 9:52 PM
Hi Clarencew4,
Replying here since this is where you started the said you weren't scanning a named instance but the error above shows the instance is "PACEPRINT01.CALOPTIMA.ORG\HPWJA".

There's a known issue (well, known to me anyways!) with connecting to named instances on your local machine where only the shared memory protocol is enabled. For now you can get around this by enabling the TCP/IP protocol.

Are you running into this problem scanning other machines besides your own?

Sep 4, 2013 at 10:21 PM
Sorry for confusing the two threads. This thread was more for the 'Failed to scan' errors when I was running a full network discovery for all SQL servers. The other thread was regarding, specifically, not getting an xml file at the end of a successful scan on a targeted SQL server.

For the full network scan I am seeing this a lot for many SQL servers that may have named instances as well as just default instances. Also, when I run the full network scan with this command [.\Get-SqlServerInventoryToClixml.ps1 -DNSServer automatic -DNSDomain automatic -PrivateOnly], PowerShell will get to where it is unresponsive and then eventually never finishes:

2013-09-04 12:07:58.4340 ? Gathering information from COMMSERV.CALOPTIMA.ORG\COMMVAULT at [Instance 109 of 116]
2013-09-04 12:07:58.4496 ? Gathering information from ADRAP2K8.CALOPTIMA.ORG\SQLEXPRESS at [Instance 110 of 116]
2013-09-04 12:07:58.4652 ? Gathering information from BLUE2.CALOPTIMA.ORG at [Instance 111 of 116]
2013-09-04 12:07:58.8240 ? Gathering information from E6420L46.CALOPTIMA.ORG\SQLEXPRESS at [Instance 112 of 116]
2013-09-04 12:07:58.8240 ? Gathering information from E6420L46.CALOPTIMA.ORG at [Instance 113 of 116]
2013-09-04 12:07:59.9161 ? Gathering information from BT2010TST.CALOPTIMA.ORG\BIZTALK10DEV at [Instance 114 of 116]
2013-09-04 12:07:59.9317 ? Gathering information from SOLARWINDS4.CALOPTIMA.ORG at [Instance 115 of 116]
2013-09-04 12:08:01.0081 ? Gathering information from FUELUAT.CALOPTIMA.ORG\FUELUAT at [Instance 116 of 116]
2013-09-04 12:08:01.3513 ! Failed to scan GOODDYNAMICS.CALOPTIMA.ORG\SQLEXPRESS - 3 errors
2013-09-04 12:08:01.3513 ! Failed to scan BTSPSQLQA1.CALOPTIMA.ORG - 3 errors
2013-09-04 12:08:01.3669 ! Failed to scan E6420L7.CALOPTIMA.ORG\SQLEXPRESS - 3 errors
2013-09-04 12:08:02.4745 $ [COPRAV1V.CALOPTIMA.ORG] Gathering Database information
2013-09-04 12:08:06.0782 $ [ESXVCICD10.CALOPTIMA.ORG] Gathering Database information
2013-09-04 12:08:09.7443 $ [755D7.CALOPTIMA.ORG] Gathering Database information
2013-09-04 12:08:10.0563 $ [FA481NPGWSQL.CALOPTIMA.ORG] Gathering Database information
2013-09-04 12:08:15.6101 $ [ITGAPPS01.CALOPTIMA.ORG] Gathering Database information
2013-09-04 12:08:32.9733 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Server security information
2013-09-04 12:08:38.2775 $ [FA481NPCFGSQL.CALOPTIMA.ORG] Gathering Database information
2013-09-04 12:08:38.5427 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Endpoint information
2013-09-04 12:08:38.6675 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Server linked server information
2013-09-04 12:08:38.7611 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Server startup procedure information
2013-09-04 12:08:38.8235 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Server Trigger information
2013-09-04 12:08:38.8547 $ [FA481PRARCHSQL.CALOPTIMA.ORG] Gathering Database information
2013-09-04 12:08:38.8859 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Resource Governor information
2013-09-04 12:08:38.9015 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering SQL Trace information
2013-09-04 12:08:43.9716 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Trace Flag information
2013-09-04 12:08:43.9716 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering Database Mail information
2013-09-04 12:08:44.0028 + [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Error gathering Database Mail information: Cannot index into a null array. (SqlServerDatabaseEngineInformation.psm1 line 10988, char 63)
2013-09-04 12:08:44.0028 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering SQL Agent service information
2013-09-04 12:08:44.0340 + [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Error gathering SQL Agent service information: Cannot bind argument to parameter 'JobServer' because it is null. (SqlServerDatabaseEngineInformation.psm1 line 11606, char 83)
2013-09-04 12:08:44.0340 $ [SCUAIISV2.CALOPTIMA.ORG\SQLEXPRESS] Gathering SQL Agent configuration information
Sep 13, 2013 at 3:15 PM
Hi Clarencew4,
Ok, let's tackle the two topics here...

For the scan of the targeted server with just a default instance - what edition & version are you running? Any chance you can email me a cleansed version of the verbose log? ( For the DNS scan - does the status bar in the PowerShell console get to 100% and then appear to hang? I've noticed that it can take a while (ok, sometimes a really long time!) to write the results of the scan to disk. Admittedly I don't do a great job of reporting that in the log or console so it can look like things are just hung up and leave you wondering what's going on. Maybe that's what's happening here?