Output to CSV problem
I added the 'output to CSV' option to my report. When I click on the Output to Excel button and the dialog box opens, I click on the Open button. The data is displayed AND there is something I don't expect - the XML code. An example is shown below:
<script type="text/javascript">
var rowStyle = new Array(10);
var rowActive = new Array(10);
var rowStyleHover = new Array(10);
rowStyle[1]='';
rowStyleHover[1]='';
rowActive[1]='N';
Could someone tell me why the XML code is being saved with the exported data, and more importantly, how do I prevent it.
Thanks in advance for any assistance!
Gerald Kuzminsky
That's cumbersome. We are still on v1.6. Is it
fixed in a later version?Haven't checked if this is fixed in 2.0 or 2.2. I'm still using 2.0 and I honestly got used to the workaround so don't know if it's been changed/fixed.
Earl
Similar Messages
-
Harvesting asset info and output to CSV
I need a script modified that will run on all servers in a work group in order to gather asset data on the appliances running Windows Server 2000 embedded edition. There are no domain services and these systems and this network technology is not an option
in our environment due to proprietary security, networking and infrastructure restrictions. I have found a script that works but i need it modified to output to a csv as it wont output and .xls .xlsx properly. The script will be run on the only computer on
the network that can access these devices. Any help on this would be awesome.
' Get Windows Server Information
' Written By Kely Mulcahey, E.C.S. LLC.
' Created: March 1, 2006
' Version: 3.0, Revised 5/30/2014
On Error Resume Next
Dim PUBOSVer ' Global OS Version
' Open File For Writing
Set WshNetwork = WScript.CreateObject("WScript.Network")
Const ForReading = 1
' Get Server List
strServerFilename = "servers.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strServerFilename) Then
' Open Servers File
Set objServers = objFSO.OpenTextFile(strServerFilename, ForReading)
Else
' Server File is missing: Exit
intMsg = MsgBox("File: " & Chr(34) & UCASE(strServerFilename) & Chr(34) & _
" is either " & _
"Missing or Damaged!" & vbcrlf & _
vbcrlf & _
"This Script will now Exit.", vbCritical, "Server File Error")
WScript.Quit(0)
End If
Do Until objServers.AtEndOfStream
strNewServer = Trim(objServers.ReadLine)
strServerList = strServerList & strNewServer & vbcrlf
intServerCnt = intServerCnt + 1
Loop
' Enumerate Server Array
For a = 0 To intServerCnt - 1
strServer = Split(strServerList, vbcrlf)
Next
' Create Excel Spreadsheet
Set objXLA = CreateObject("Excel.Application")
objXLA.Visible = False
objXLA.DisplayAlerts = False
Set objWorkbook = objXLA.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)
'Excel Constants
Const xlEdgeLeft = 7
Const xlContinuous = 1
Const xlNone = -4142
Const xlMedium = -4138
Const xlThin = 2
'Set Headers
' System Information
objXLA.Cells(1,1).Value = "Service ID"
objXLA.Cells(1,2).Value = "Company Name"
objXLA.Cells(1,3).Value = "Manufacturer"
objXLA.Cells(1,4).Value = "Model"
objXLA.Cells(1,5).Value = "Operating System"
' Processors
objXLA.Cells(1,6).Value = "Processor Type"
objXLA.Cells(1,7).Value = "Processors"
' RAM
objXLA.Cells(1,8).Value = "RAM"
objXLA.Cells(1,9).Value = "Slots"
objXLA.Cells(1,10).Value = "Max Capacity"
' Network
objXLA.Cells(1,11).Value = "NIC Port"
objXLA.Cells(1,12).Value = "Speed"
objXLA.Cells(1,13).Value = "Connection Name"
objXLA.Cells(1,14).Value = "Primary IP"
objXLA.Cells(1,15).Value = "Virtual IP"
objXLA.Cells(1,16).Value = "Primary DNS"
objXLA.Cells(1,17).Value = "Secondary DNS"
' Hard Disks
objXLA.Cells(1,18).Value = "Interface"
objXLA.Cells(1,19).Value = "Physical Disks"
objXLA.Cells(1,20).Value = "Disk Size"
objXLA.Cells(1,21).Value = "Fault Tolerant"
objXLA.Cells(1,22).Value = "Hot Spare"
' Set Top Line
objXLA.Cells(1, 1).EntireRow.Font.Bold = True
objXLA.Cells(1, 1).EntireRow.Font.Underline = True
For b = 0 To UBound(strServer) - 1
strServerParts = Split(strServer(b), " ")
strComputer = strServerParts(0)
' Parse Server Information
If UBound(strServerParts) = 2 Then
strUsername = Trim(strServerParts(1))
strPassword = Trim(strServerParts(2))
End If
' Create Connection Object
Set objWMIService = Nothing
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer _
(strComputer, "root\cimv2", strUsername, strPassword)
objWMIServices.Security_.ImpersonationLevel = 3
' Check if Server Exists
For intWMICheck = 0 To 15
If Not objWMIService Is Nothing Then
Exit For
Else
WScript.Sleep(1000)
End If
Next
' Server Exists
If intWMICheck < 15 Then
' Get CPU Information
Set colProcessor = objWMIService.ExecQuery("SELECT * FROM Win32_Processor")
For Each colProc In colProcessor
strManuf = colProc.Manufacturer
strDescription = ProcessorName(colProc.Name)
strClockSpeed = colProc.CurrentClockSpeed
strSocket = strSocket & colProc.SocketDesignation & vbcrlf
strProcID = strProcID & colProc.ProcessorID & vbcrlf
strUniqueID = strUniqueID & colProc.UniqueID & vbcrlf
ProcCount = ProcCount + 1
Next
' Determine if Hyperthreading is Enabled
strHTStatus = GetHTStatus(strSocket, ProcCount, strProcID, strUniqueID)
' DC / HT Results
If strHTStatus = "True" Then
If InStr(strManuf, "Intel") Then
strDescription = strDescription & " (Dual Core or H/T)"
Else
strDescription = strDescription & " (Dual Core)"
End If
ProcCount = ProcCount / 2
End If
' Export Information
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colCS = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
' Write Basic System Information
For Each objItem in colCS
Set colOS = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItemOS in colOS
' Get SP Version
If objItemOS.CSDVersion <> "" Then
strSPVersion = objItemOS.CSDVersion
Else
strSPVersion = "No Service Packs Installed"
End If
If objItemOS.LastBootUpTime <> "" Then
strLastBoot = DateConvert(objItemOS.LastBootUpTime)
Else
strLastBoot = "N/A"
End If
' Set OS Version Information
PUBOSVer = objItemOS.Caption
objXLA.Cells(b + 2, 1).Value = objItemOS.csname
objXLA.Cells(b + 2, 3).Value = objItem.Manufacturer
objXLA.Cells(b + 2, 4).Value = objItem.Model
objXLA.Cells(b + 2, 5).Value = PUBOSVer & " - " & strSPVersion
objXLA.Cells(b + 2, 6).Value = strDescription
objXLA.Cells(b + 2, 7).Value = ProcCount
objXLA.Cells(b + 2, 8).Value = MemoryConvert(objItem.TotalPhysicalMemory)
Next
Next
' Get Memory Breakdown
Dim strMemBreak
strMemBreak = Split(MemoryBreakdown(), vbcrlf)
n = 0
For n = 0 To UBound(strMemBreak) - 1
strSlots = strSlots & strMemBreak(n) & Chr(10)
Next
strMaxCapacity = strMemBreak(UBound(strMemBreak))
objXLA.Cells(b + 2, 9).Value = Left(strSlots, Len(strSlots) - 1)
objXLA.Cells(b + 2, 10).Value = strMaxCapacity
' Dispose
strMemBreak = ""
strMaxCapacity = ""
strSlots = ""
'--------------Computer Information (End)------------------'
'-------------Partition Information (Start)----------------'
' Get Drive Count
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set DiskItemsParent = objWMIService.ExecQuery("Select * from Win32_DiskDrive")
intCount = DiskItemsParent.Count
' Process Drives
intDriveMark = 0
For i = 0 To intCount - 1
Set DiskItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive WHERE Index = " & i)
For Each diskItem in DiskItems
' Convert Drive Size
If diskItem.Size <> "" Then strSize = strSize & ByteConvert(diskItem.Size) & Chr(10) Else strSize = "N/A" & Chr(10)
If diskItem.StatusInfo <> "" Then strStsInfo = diskItem.StatusInfo Else strStsInfo = "N/A"
If diskItem.SCSIBus <> "" Then strSCSIBus = diskItem.SCSIBus Else strSCSIBus = "N/A"
If diskItem.SCSILogicalUnit <> "" Then strSCSILog = diskItem.SCSILogicalUnit Else strSCSILog = "N/A"
If diskItem.SCSIPort <> "" Then strSCSIPort = diskItem.SCSIPort Else strSCSIPort = "N/A"
If diskItem.SCSITargetId <> "" Then strSCSITarget = diskItem.SCSITargetId Else strSCSITarget = "N/A"
' Get Model
strModel = Split(diskItem.Model, " ")
' Detect HP Array
If (UCase(strModel(0)) = "HP" Or UCase(strModel(0)) = "COMPAQ") And intDriveMark = 0 Then
strGetHPArray = GetHPArray(strComputer, strUsername, strPassword)
If strGetHPArray <> "" Then
strSplitHP = Split(strGetHPArray, Chr(13))
For a = 0 To UBound(strSplitHP)
strSplitResult = Split(strSplitHP(a), ":")
i = i + 1
strDriveCount = strDriveCount & Trim(strSplitResult(0)) & Chr(10)
strDriveSize = strDriveSize & Trim(strSplitResult(1)) & Chr(10)
strDriveFault = strDriveFault & Trim(strSplitResult(2)) & Chr(10)
strDriveSpare = strDriveSpare & Trim(strSplitResult(3)) & Chr(10)
strInterface = strInterface & "HP SCSI" & Chr(10)
Next
' Set Controller Output
objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
intDriveMark = 1 ' Mark That Data was Obtained
Else
strDriveCount = strDriveCount & "1" & Chr(10)
strDriveSize = strDriveSize & strSize & Chr(10)
strDriveFault = strDriveFault & "N/A" & Chr(10)
strDriveSpare = strDriveSpare & "N/A" & Chr(10)
strInterface = strInterface & "HP SCSI " & Chr(10)
' Set Controller Output
intDriveMark = 1 ' Mark That Another Pass is Invalid
' Set Controller Output
objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
End If
Else
strDriveCount = strDriveCount & "1" & Chr(10)
strDriveSize = strDriveSize & strSize & Chr(10)
strDriveFault = strDriveFault & "N/A" & Chr(10)
strDriveSpare = strDriveSpare & "N/A" & Chr(10)
' Set Controller Output
intDriveMark = 1 ' Mark That Another Pass is Invalid
' Set Controller Output
objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
' Set Interface
If diskItem.InterfaceType = "IDE" Then
strInterface = strInterface & "ATA" & Chr(10)
Else
strInterface = strInterface & "SATA/SCSI" & Chr(10)
End If
End If
' Set Cell Value "Interface"
objXLA.Cells(b + 2, 18).Value = Left(strInterface, Len(strInterface) - 1)
Next
' Dispose Drive Sizes
strDriveSize = ""
Next
' Dispose Drive Values
strDriveCount = ""
strDriveFault = ""
strDriveSpare = ""
strInterface = ""
'----Partition Information (End)---------------------------'
'----Network Information (Start)---------------------------'
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter")
i = 1
eth = 0
Dim STOREDIP(0)
intNum = 0
For Each objItem in colItems
If objItem.NetConnectionStatus <> "" Then
' Determine Connection Status
If objItem.NetConnectionStatus = 0 Then
strNetStat = "Disabled"
ElseIf objItem.NetConnectionStatus = 2 Then
strNetStat = "Connected"
ElseIf objItem.NetConnectionStatus = 7 Then
strNetStat = "Disconnected"
Else
strNetStat = "Unknown"
End If
If objItem.NetConnectionStatus <> 0 Then
' Get Network Card Information
Const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath1 = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
strKeyPath2 = "SYSTEM\CurrentControlSet\Services\NetBT\Parameters"
strHostEntry = "Hostname"
strDomainEntry = "Domain"
strNodeEntry = "DhcpNodeType"
strRoutingEntry = "IPEnableRouter"
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strHostEntry,strHostname
objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strDomainEntry,strDomain
objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strNodeEntry,dwNodeType
objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath1,strRoutingEntry,dwIPRouting
Select Case dwNodeType
Case 4 strNodeType = "Mixed"
Case 8 strNodeType = "Hybrid"
Case Else strNodeType = dwNodeType
End Select
If dwIPRouting = 0 Then
strIPRouting = "No"
ElseIf dwIPRouting = 1 Then
strIPRouting = "Yes"
Else
strIPRouting = "?"
End If
Set colFirstNicConfig = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objFirstNicConfig In colFirstNicConfig
strDnsWins = objFirstNicConfig.DNSEnabledForWINSResolution
Next
Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
' Display per-adapter settings.
For Each objNicConfig In colNicConfigs
intIndex = objNicConfig.Index
Set objNic = objWMIService.Get("Win32_NetworkAdapter.DeviceID=" & intIndex)
' Connection Name
If GetOsVer > 5 Then
' Works only in XP / 2003
strNetConn = objNic.NetConnectionID
ElseIf GetOsVer = 5 Then
strNetConn = ""
' Get Home Drive of Remote Server
Set objShell = CreateObject("WScript.Shell")
Set objEtherName = objShell.Exec("cmd /c ipconfig | find " & Chr(34) & "Ethernet" & Chr(34))
strEtherName = objEtherName.StdOut.ReadAll()
strEtherParse = Split(strEtherName, Chr(13))
strEtherConn = Split(strEtherParse(eth), " ")
For y = 2 To UBound(strEtherConn)
strNetConn = strNetConn & " " & strEtherConn(y)
Next
' Trim Connection Name
strNetConn = Left(Trim(strNetConn), Len(Trim(strNetConn)) - 1)
Else
strNetConn = ""
End If
' IP Addresses
strIPAddresses = ""
If Not IsNull(objNicConfig.IPAddress) Then
For Each strIPAddress In objNicConfig.IPAddress
strIPAddresses = strIPAddresses & strIPAddress & " "
Next
End If
strIPCollection = Split(strIPAddresses, " ")
' Subnets
strIPSubnets = ""
If Not IsNull(objNicConfig.IPSubnet) Then
For Each strIPSubnet In objNicConfig.IPSubnet
strIPSubnets = strIPSubnets & strIPSubnet & " "
Next
End If
strSMCollection = Split(strIPSubnets, " ")
' Virtual IP's
strVirtual = ""
If UBound(strIPCollection) > 1 Then
For IPCount = 1 To UBound(strIPCollection) - 1
strVirtual = strVirtual & (strIPCollection(IPCount) & " / " & strSMCollection(IPCount)) & Chr(10)
Next
strVirtual = Left(strVirtual, Len(strVirtual) - 1)
End If
If Trim(strVirtual) = "" Then strVirtual = "N/A"
' Gateways
strDefaultIPGateways = ""
If Not IsNull(objNicConfig.DefaultIPGateway) Then
For Each strDefaultIPGateway In objNicConfig.DefaultIPGateway
strDefaultIPGateways = strDefaultIPGateways & strDefaultIPGateway & " "
Next
Else
strDefaultIPGateways = "N/A"
End If
' If IP is repeated, and was already reported.
intSkipLoop = 0
If Trim(strNetConn) <> "" Then
For j = 0 To intNum - 1
If STOREDIP(j) = strIPAddresses Then
intSkipLoop = 1
Exit For
End If
Next
If intSkipLoop = 0 Then
ReDim Preserve STOREDIP(intNum)
STOREDIP(intNum) = strIPAddresses
intNum = intNum + 1
End If
Else
intSkipLoop = 1
End If
' DNS
strDNSServerSearchOrder = ""
If Not IsNull(objNicConfig.DNSServerSearchOrder) Then
For Each strDNSServer In objNicConfig.DNSServerSearchOrder
strDNSServerSearchOrder = strDNSServerSearchOrder & strDNSServer & " "
Next
strDNS = Split(strDNSServerSearchOrder, " ")
strDNS1 = strDNS(0)
If Trim(strDNS1) = "" Then strDNS1 = "N/A"
If UBound(strDNS) > 1 Then
strDNS2 = strDNS(1)
Else
strDNS2 = "N/A"
End If
Else
strDNS1 = "N/A"
strDNS2 = "N/A"
End If
' Run Output Process
If intSkipLoop = 0 Then
' Connection Speed
strSpeed = "Unknown"
Set objWMIService2 = objSWbemLocator.ConnectServer _
(strComputer, "root\WMI", strUsername, strPassword)
objWMIServices.Security_.ImpersonationLevel = 3
Set listAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_LinkSpeed")
Set enumAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_EnumerateAdapter")
For Each objAdapter in listAdapters
For Each objEnum in enumAdapters
intEnum = Len(objEnum.DeviceName)
If objNicConfig.SettingID = Right(objEnum.DeviceName, intEnum - 8) Then
If objEnum.InstanceName = objAdapter.InstanceName Then
intLength = Len(objAdapter.NdisLinkSpeed/10000)
If intLength > 3 Then
strSpeed = Left(objAdapter.NdisLinkSpeed/10000, intLength - 3)
strSpeed = strSpeed & ".0 Gbps"
Else
strSpeed = objAdapter.NdisLinkSpeed/10000 & " Mbps"
End If
End If
End If
Next
Next
strTotalDesc = strTotalDesc & objNicConfig.Description & Chr(10)
strTotalSpeed = strTotalSpeed & strSpeed & Chr(10)
strTotalNetConn = strTotalNetConn & strNetConn & Chr(10)
strPrimaryIP = strPrimaryIP & strIPCollection(0) & " / " & strSMCollection(0) & Chr(10)
strDNSTotal1 = strDNSTotal1 & strDNS1 & Chr(10)
strDNSTotal2 = strDNSTotal2 & strDNS2 & Chr(10)
strTotalVirtual = strTotalVirtual & strVirtual & Chr(10)
i = i + 1
eth = eth + 2
' Dispose
strDescription = ""
ProcCount = 0
strClockSpeed = ""
strInterface = ""
intCount = 0
strSize = ""
strSpeed = ""
strIPCollection = ""
strVirtual = ""
strDNS = ""
strDNS1 = ""
strDNS2 = ""
End If
Next
' Output
' Trim Leading Chr(10)
If Left(strPrimaryIP, 1) = Chr(10) Then strPrimaryIP = Right(strPrimaryIP, Len(strPrimaryIP) - 1)
If Left(strTotalVirtual, 1) = Chr(10) Then strTotalVirtual = Right(strTotalVirtual, Len(strTotalVirtual) - 1)
If Left(strDNSTotal1, 1) = Chr(10) Then strDNSTotal1 = Right(strDNSTotal1, Len(strDNSTotal1) - 1)
If Left(strDNSTotal2, 1) = Chr(10) Then strDNSTotal2 = Right(strDNSTotal2, Len(strDNSTotal2) - 1)
objXLA.Cells(b + 2, 11).Value = Trim(Left(strTotalDesc, Len(strTotalDesc) - 1))
objXLA.Cells(b + 2, 12).Value = Trim(Left(strTotalSpeed, Len(strTotalSpeed) - 1))
objXLA.Cells(b + 2, 13).Value = Trim(Left(strTotalNetConn, Len(strTotalNetConn) - 1))
objXLA.Cells(b + 2, 14).Value = Trim(Left(strPrimaryIP, Len(strPrimaryIP) - 1))
objXLA.Cells(b + 2, 15).Value = Trim(Left(strTotalVirtual, Len(strTotalVirtual) - 1))
objXLA.Cells(b + 2, 16).Value = Trim(Left(strDNSTotal1, Len(strDNSTotal1) - 1))
objXLA.Cells(b + 2, 17).Value = Trim(Left(strDNSTotal2, Len(strDNSTotal2) - 1))
End If
End If
' Dispose Per Loop
strTotalDesc = ""
strTotalSpeed = ""
strTotalNetConn = ""
strPrimaryIP = ""
strDNSTotal1 = ""
strDNSTotal2 = ""
strTotalVirtual = ""
Set eth = 0
Set i = 0
Next
'------------Network Information (End)------------------'
Else
'No Data Present
objXLA.Cells(b + 2, 1).Value = strComputer
objXLA.Cells(b + 2, 3).Value = "Information Not Available"
objXLA.Cells(b + 2, 1).EntireRow.Font.Bold = True
objXLA.Cells(b + 2, 1).EntireRow.Interior.ColorIndex = 44
End If
' Dispose Per Server
ProcCount = 0
strSocket = ""
strProcID = ""
strUniqueID = ""
Set objWMIService = Nothing
Next
'-----------------Functions (Start)---------------------'
' System Memory Conversion
Function MemoryConvert(strMem)
Dim intLength
Dim intExp
Dim intSize
Dim strSize
Dim strMeasure
Dim strMemory
intLength = Len(strMem)
If (intLength Mod 4 = 0) Then
intExp = CInt((intLength / 3) - 2)
Else
intExp = CInt((intLength / 3) - 1)
End If
' Convert to Lowest Integer Value
For intCount = 1 To Len(intExp)
chrRead = Mid(intExp, intCount, 1)
If chrRead = "." Then
Exit For
Else
strRead = strRead & chrRead
End If
Next
intExp = Cint(strRead)
intSize = CLng(strMem / (2 ^ (intExp * (10))))
If Len(intSize) = 1 Then
strFormat = FormatNumber(CStr(intSize), 2)
Else
strFormat = intSize + 1
End If
If (intExp = 1) Then
strMeasure = "KB"
ElseIf (intExp = 2) Then
strMeasure = "MB"
ElseIf (intExp = 3) Then
strMeasure = "GB"
ElseIf (intExp = 4) Then
strMeasure = "TB"
ElseIf (intExp = 5) Then
strMeasure = "PB"
ElseIf (intExp = 6) Then
strMeasure = "EB"
End If
MemoryConvert = strFormat & " " & strMeasure
End Function
' System Byte Conversion
Function ByteConvert(strMem)
Dim intLength
Dim intExp
Dim intSize
Dim strSize
Dim strMeasure
Dim strMemory
intLength = Len(strMem)
If (intLength Mod 3 = 0) Then
intExp = (intLength / 3) - 1
Else
intExp = (intLength / 3)
End If
' Convert to Lowest Integer Value
For intCount = 1 To Len(intExp)
chrRead = Mid(intExp, intCount, 1)
If chrRead = "." Then
Exit For
Else
strRead = strRead & chrRead
End If
Next
intExp = Cint(strRead)
intSize = CLng(strMem / (2 ^ (intExp * (10))))
strFormat = FormatNumber(CStr(intSize), 2)
If (intExp = 1) Then
strMeasure = "KB"
ElseIf (intExp = 2) Then
strMeasure = "MB"
ElseIf (intExp = 3) Then
strMeasure = "GB"
ElseIf (intExp = 4) Then
strMeasure = "TB"
ElseIf (intExp = 5) Then
strMeasure = "PB"
ElseIf (intExp = 6) Then
strMeasure = "EB"
End If
ByteConvert = strFormat & " " & strMeasure
End Function
' System RAID Byte Conversion
Function ByteConvertRAID(strMem)
Dim intLength
Dim intExp
Dim intSize
Dim strSize
Dim strMeasure
Dim strMemory
intLength = Len(strMem)
If (intLength Mod 3 = 0) Then
intExp = (intLength / 3) - 1
Else
intExp = (intLength / 3)
End If
' Convert to Lowest Integer Value
For intCount = 1 To Len(intExp)
chrRead = Mid(intExp, intCount, 1)
If chrRead = "." Then
Exit For
Else
strRead = strRead & chrRead
End If
Next
intExp = Cint(strRead)
intSize = (strMem / (2 ^ (intExp * (10))))
strFormat = FormatNumber(CStr(intSize), 2)
If (intExp = 0) Then
strMeasure = "MB"
ElseIf (intExp = 1) Then
strMeasure = "GB"
ElseIf (intExp = 2) Then
strMeasure = "TB"
ElseIf (intExp = 3) Then
strMeasure = "PB"
ElseIf (intExp = 4) Then
strMeasure = "EB"
End If
ByteConvertRAID = strFormat & " " & strMeasure
End Function
' Trim Processor Description
Function ProcessorName(strName)
Dim intCounter
Dim strRead
Dim chrRead, chrReadMore
For intCounter = 1 to Len(strName)
chrRead = Mid(strName, intCounter, 1)
chrReadMore = Mid(strName, intCounter + 1, 1)
If ((chrRead <> " ") Or ((chrRead = " ") And (chrReadMore <> " "))) Then
strRead = strRead & chrRead
End If
Next
ProcessorName = Trim(strRead)
End Function
' Get Hyper-Threading Status
Function GetHTStatus(strName, intProc, strID, strUnique)
strNameArray = Split(strName, vbcrlf)
strIDArray = Split(strID, vbcrlf)
strUniqueList = Split(strUnique, vbcrlf)
intTotal = 0
' Check Socket Designation
For i = 0 To UBound(strNameArray) - 1
intMark = 1
' Check for Redundancies
For j = i + 1 To UBound(strNameArray) - 1
If strNameArray(i) = strNameArray(j) Then
intMark = 0
End If
Next
' If Redundant Unique ID's Exist
For j = i + 1 To UBound(strNameArray) - 1
If strUniqueList(i) <> "" And strUniqueList(j) <> "" And _
(strUniqueList(i) <> strUniqueList(j)) Then
intMark = 1
End If
Next
' Check for NULL ProcessorID
If Trim(strIDArray(i)) = "0000000000000000" Then
intMark = 0
End If
' Calculate Total
If intMark = 1 Then
intTotal = intTotal + intMark
End If
Next
' Compare Results
If intProc = 2 * intTotal Then
GetHTStatus = "True"
Else
GetHTStatus = "False"
End If
End Function
' Get Memory Breakdown
Function MemoryBreakdown
Set colPMAItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemoryArray",,48)
For Each objPMAItem in colPMAItems
lngMax = CLng(objPMAItem.MaxCapacity)
intCount = CInt(objPMAItem.MemoryDevices)
Next
ReDim Preserve strPMArray(intCount)
Set colPMItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48)
For Each objPMItem in colPMItems
strValue = strValue & objPMItem.DeviceLocator & ": "
strValue = strValue & objPMItem.Capacity / 2^20 & "MB, "
strValue = strValue & objPMItem.Speed & "MHz"
strPMArray(TrimTrailingNumber(objPMItem.Tag)) = strValue
strValue = ""
Next
j = 0
strResult = ""
For j = 0 To intCount - 1
If Trim(strPMArray(j)) = "" Then strPMArray(j) = "<Empty>"
strResult = strResult & strPMArray(j) & vbcrlf
Next
strResult = strResult & (lngMax / 2^10) & "MB"
MemoryBreakdown = strResult
End Function
' Get Part Name
Function ExtractPartName(strName)
Dim chrRead
Dim strRead
Dim i
For i = 2 To Len(strName)
chrRead = Mid(strName, Len(strName) - (i - 1), 1)
If chrRead <> Chr(34) Then
strRead = chrRead & strRead
Else
Exit For
End If
Next
ExtractPartName = strRead
End Function
' Get Trailing Number
Function TrimTrailingNumber(strNum)
Dim chrRead
Dim strRead
Dim intLen
strNum = Trim(strNum)
intLen = Len(strNum)
i = 1
For i = 1 To intLen
chrRead = Mid(strNum, intLen - (i - 1), 1)
If IsNumeric(chrRead) = "True" Then
strRead = chrRead & strRead
Else
Exit For
End If
Next
TrimTrailingNumber = strRead
End Function
' Function: WMIDateStringToDate(dtmDate)
Function WMIDateToString(dtmDate)
WMIDateToString = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & _
Left(dtmDate, 4) & " " & _
Mid(dtmDate, 9, 2) & ":" & _
Mid(dtmDate, 11, 2) & ":" & _
Mid(dtmDate, 13, 2))
End Function
' Function: GetOsVer
Function GetOsVer
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem In colOperatingSystems
GetOSVer = CSng(Left(objOperatingSystem.Version, 3))
Next
End Function
' Function: GetHPArray
Function GetHPArray(strComputer2, strUsername2, strPassword2)
' Check for 64-bit Windows
If InStr(PUBOSVer, "x64") Then
strCompaq = "Program Files (x86)\Compaq\Cpqacuxe\Bin"
Else
strCompaq = "Program Files\Compaq\Cpqacuxe\Bin"
End If
' Create Connection Object
Set objWMIServiceRem = objWMIService.Get("Win32_Process")
' Confirm Location of Compaq Array Manager
Set objHPShell = CreateObject("WScript.Shell")
Set objHPFSO = CreateObject("Scripting.FileSystemObject")
Set WshNetwork2 = WScript.CreateObject("WScript.Network")
WshNetwork2.MapNetworkDrive "", "\\" & strComputer2 & "\C$" ,,strUsername2, strPassword2
strProgram = "\\" & strComputer2 & "\C$\" & strCompaq & "\cpqacuxe.exe"
' Ensure Access is Possible
If objHPFSO.FileExists(strProgram) Then
' Process Array Config
strProcess = Chr(34) & "C:\" & strCompaq & "\cpqacuxe.exe" & Chr(34) & " -c c:\output.txt"
Process = objWMIServiceRem.Create(strProcess, null, null, intProcessID)
' Check for "output.txt"
For intTimerHP = 0 To 10
If objFSO.FileExists("\\" & strComputer2 & "\C$\output.txt") Then
Exit For
Else
WScript.Sleep(1000)
End If
Next
' Process Output
If intTimerHP < 10 Then
' Check for Locked Output File
Set objHPOutputFile = objHPFSO.GetFile("\\" & strComputer2 & "\C$\output.txt")
If objHPOutputFile.Size <> 0 Then
' Close File
Set objHPOutputFile = Nothing
' Continue Processesing File
Set objHPInputFile = objHPFSO.OpenTextFile("\\" & strComputer2 & "\C$\output.txt", ForReading)
Do Until objHPInputFile.AtEndOfStream
strHPArray = strHPArray & objHPInputFile.ReadLine & vbcrlf
Loop
' Close Input File
objHPInputFile.Close
' Close Link to Server
objHPFSO.DeleteFile("\\" & strComputer2 & "\C$\output.txt")
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
' Create String Array
strHPParse = Split(strHPArray, vbcrlf)
' Parse For Individual RAID Arrays
Dim strArrayList()
z = 0
For i = 0 To UBound(strHPParse)
j = 0
' Array and Drives
If InStr(strHPParse(i), "Array Specifications") Then
ReDim Preserve strArrayList(z)
strArrayList(z) = strArrayList(z) & strHPParse(i) & vbcrlf
For j = i + 1 To Ubound(strHPParse)
If InStr(strHPParse(j), "Array Specifications") Then
Exit For
Else
strArrayList(z) = strArrayList(z) & strHPParse(j) & vbcrlf
End If
Next
z = z + 1
End If
Next
' Process Each RAID Array
x = 0
For x = 0 To UBound(strArrayList)
strListParse = Split(strArrayList(x), vbcrlf)
For y = 0 To UBound(strListParse)
' Drives
If Left(strListParse(y), 6) = "Drive=" Then
strDrives = ""
strDrives = Split(strListParse(y), ",")
k = 0
For j = 0 To UBound(strDrives)
k = k + 1
Next
strDriveCount = k ' For Output
End If
' Hot Spare
If InStr(strListParse(y), "OnlineSpare=") Then
If InStr(strListParse(y), "OnlineSpare= No") Then
strHotSpare = strHotSpare & "N" ' For Output
Else
strHotSpare = strHotSpare & "Y" ' For Output
End If
End If
' Logical Drives
If InStr(strListParse(y), "Logical Drive Specifications") Then
' Find First Logical Drive
strRAID = Split(strListParse(y + 2), " ")
strRAIDResult = strRAIDResult & "RAID " & strRAID(1) & " / " ' For Output
strGetDrive = Split(strListParse(y + 3), " ")
strRAIDSize = strRAIDSize & ByteConvertRAID(strGetDrive(1)) & " / " ' For Output
End If
Next
' Process Results
strRAIDSize = Left(strRAIDSize, Len(strRAIDSize) - 3)
strRAIDResult = Left(strRAIDResult, Len(strRAIDResult) - 3)
strNewList = strNewList & strDriveCount & _
":" & strRAIDSize & ":" & strRAIDResult & ":" & strHotSpare & Chr(13)
' Dispose Array Variables
strDriveCount = ""
strRAIDSize = ""
strRAIDResult = ""
strHotSpare = ""
Next
' Return Array Output
GetHPArray = Left(strNewList, Len(strNewList) - 1)
Exit Function
Else ' "output.txt" Is Locked
' Close File
Set objHPOutputFile = Nothing
' Kill Remote Connection
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
GetHPArray = ""
Exit Function
End If
Else ' "output.txt" Does not Exist
' Kill Remote Connection
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
GetHPArray = ""
Exit Function
End If
Else ' "Array Manager Does not Exist
' Input not Available
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
GetHPArray = ""
Exit Function
End If
End Function
'--------------------Functions (End)--------------------'
' Set Excel Attributes
Const xlVAlignTop = -4160
Set objRange2 = objWorksheet.UsedRange
objRange2.VerticalAlignment = xlVAlignTop
' Set Font Attributes
objXLA.Cells.Font.Size = 8
objXLA.Cells.Font.Name = "Arial"
objXLA.Cells.Font.ColorIndex = 11
objXLA.Cells.EntireColumn.AutoFit
objXLA.Cells(1, 9).ColumnWidth = 30 ' RAM Slots
objXLA.Cells(1, 11).ColumnWidth = 40 ' NIC Port
objXLA.Cells(1, 13).ColumnWidth = 25 ' Connection Name
objXLA.Cells(1, 14).ColumnWidth = 25 ' Interface IP's
objXLA.Cells(1, 15).ColumnWidth = 25 ' Virtual IP's
objXLA.Cells(1, 16).ColumnWidth = 15 ' DNS1
objXLA.Cells(1, 17).ColumnWidth = 15 ' DNS2
objXLA.Cells(1, 18).ColumnWidth = 15 ' Interface Type
objXLA.Cells.HorizontalAlignment = 2 ' Drive Count
objXLA.Cells(1, 20).ColumnWidth = 20 ' Virtual IP's
objXLA.Cells(1, 21).ColumnWidth = 20 ' Virtual IP's
' Save
set objFSO2 = CreateObject("Scripting.FileSystemObject")
strFileName = objFSO2.getAbsolutePathName("") & "\Scan Results.xls"
objWorkbook.SaveAs(strFileName)
objWorkbook.Close
objXLA.Quit
' Notify User
WScript.Echo "Process Completed (" & Now & ")"
' Close Program
WScript.Quit(0)I Need my script modified to run this script and output to CSV but its so big I am not sure where to start. I don't need it in XLS at all, and I can add my own headers, cell sizes and colors, etc. so It should just output the data to a simple CSV.
On Error Resume Next
Dim PUBOSVer ' Global OS Version
' Open File For Writing
Set WshNetwork = WScript.CreateObject("WScript.Network")
Const ForReading = 1
' Get Server List
strServerFilename = "servers.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strServerFilename) Then
' Open Servers File
Set objServers = objFSO.OpenTextFile(strServerFilename, ForReading)
Else
' Server File is missing: Exit
intMsg = MsgBox("File: " & Chr(34) & UCASE(strServerFilename) & Chr(34) & _
" is either " & _
"Missing or Damaged!" & vbcrlf & _
vbcrlf & _
"This Script will now Exit.", vbCritical, "Server File Error")
WScript.Quit(0)
End If
Do Until objServers.AtEndOfStream
strNewServer = Trim(objServers.ReadLine)
strServerList = strServerList & strNewServer & vbcrlf
intServerCnt = intServerCnt + 1
Loop
' Enumerate Server Array
For a = 0 To intServerCnt - 1
strServer = Split(strServerList, vbcrlf)
Next
' Create Excel Spreadsheet
Set objXLA = CreateObject("Excel.Application")
objXLA.Visible = False
objXLA.DisplayAlerts = False
Set objWorkbook = objXLA.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)
'Excel Constants
Const xlEdgeLeft = 7
Const xlContinuous = 1
Const xlNone = -4142
Const xlMedium = -4138
Const xlThin = 2
'Set Headers
' System Information
objXLA.Cells(1,1).Value = "Service ID"
objXLA.Cells(1,2).Value = "Company Name"
objXLA.Cells(1,3).Value = "Manufacturer"
objXLA.Cells(1,4).Value = "Model"
objXLA.Cells(1,5).Value = "Operating System"
' Processors
objXLA.Cells(1,6).Value = "Processor Type"
objXLA.Cells(1,7).Value = "Processors"
' RAM
objXLA.Cells(1,8).Value = "RAM"
objXLA.Cells(1,9).Value = "Slots"
objXLA.Cells(1,10).Value = "Max Capacity"
' Network
objXLA.Cells(1,11).Value = "NIC Port"
objXLA.Cells(1,12).Value = "Speed"
objXLA.Cells(1,13).Value = "Connection Name"
objXLA.Cells(1,14).Value = "Primary IP"
objXLA.Cells(1,15).Value = "Virtual IP"
objXLA.Cells(1,16).Value = "Primary DNS"
objXLA.Cells(1,17).Value = "Secondary DNS"
' Hard Disks
objXLA.Cells(1,18).Value = "Interface"
objXLA.Cells(1,19).Value = "Physical Disks"
objXLA.Cells(1,20).Value = "Disk Size"
objXLA.Cells(1,21).Value = "Fault Tolerant"
objXLA.Cells(1,22).Value = "Hot Spare"
' Set Top Line
objXLA.Cells(1, 1).EntireRow.Font.Bold = True
objXLA.Cells(1, 1).EntireRow.Font.Underline = True
For b = 0 To UBound(strServer) - 1
strServerParts = Split(strServer(b), " ")
strComputer = strServerParts(0)
' Parse Server Information
If UBound(strServerParts) = 2 Then
strUsername = Trim(strServerParts(1))
strPassword = Trim(strServerParts(2))
End If
' Create Connection Object
Set objWMIService = Nothing
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer _
(strComputer, "root\cimv2", strUsername, strPassword)
objWMIServices.Security_.ImpersonationLevel = 3
' Check if Server Exists
For intWMICheck = 0 To 15
If Not objWMIService Is Nothing Then
Exit For
Else
WScript.Sleep(1000)
End If
Next
' Server Exists
If intWMICheck < 15 Then
' Get CPU Information
Set colProcessor = objWMIService.ExecQuery("SELECT * FROM Win32_Processor")
For Each colProc In colProcessor
strManuf = colProc.Manufacturer
strDescription = ProcessorName(colProc.Name)
strClockSpeed = colProc.CurrentClockSpeed
strSocket = strSocket & colProc.SocketDesignation & vbcrlf
strProcID = strProcID & colProc.ProcessorID & vbcrlf
strUniqueID = strUniqueID & colProc.UniqueID & vbcrlf
ProcCount = ProcCount + 1
Next
' Determine if Hyperthreading is Enabled
strHTStatus = GetHTStatus(strSocket, ProcCount, strProcID, strUniqueID)
' DC / HT Results
If strHTStatus = "True" Then
If InStr(strManuf, "Intel") Then
strDescription = strDescription & " (Dual Core or H/T)"
Else
strDescription = strDescription & " (Dual Core)"
End If
ProcCount = ProcCount / 2
End If
' Export Information
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colCS = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
' Write Basic System Information
For Each objItem in colCS
Set colOS = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItemOS in colOS
' Get SP Version
If objItemOS.CSDVersion <> "" Then
strSPVersion = objItemOS.CSDVersion
Else
strSPVersion = "No Service Packs Installed"
End If
If objItemOS.LastBootUpTime <> "" Then
strLastBoot = DateConvert(objItemOS.LastBootUpTime)
Else
strLastBoot = "N/A"
End If
' Set OS Version Information
PUBOSVer = objItemOS.Caption
objXLA.Cells(b + 2, 1).Value = objItemOS.csname
objXLA.Cells(b + 2, 3).Value = objItem.Manufacturer
objXLA.Cells(b + 2, 4).Value = objItem.Model
objXLA.Cells(b + 2, 5).Value = PUBOSVer & " - " & strSPVersion
objXLA.Cells(b + 2, 6).Value = strDescription
objXLA.Cells(b + 2, 7).Value = ProcCount
objXLA.Cells(b + 2, 8).Value = MemoryConvert(objItem.TotalPhysicalMemory)
Next
Next
' Get Memory Breakdown
Dim strMemBreak
strMemBreak = Split(MemoryBreakdown(), vbcrlf)
n = 0
For n = 0 To UBound(strMemBreak) - 1
strSlots = strSlots & strMemBreak(n) & Chr(10)
Next
strMaxCapacity = strMemBreak(UBound(strMemBreak))
objXLA.Cells(b + 2, 9).Value = Left(strSlots, Len(strSlots) - 1)
objXLA.Cells(b + 2, 10).Value = strMaxCapacity
' Dispose
strMemBreak = ""
strMaxCapacity = ""
strSlots = ""
'--------------Computer Information (End)------------------'
'-------------Partition Information (Start)----------------'
' Get Drive Count
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set DiskItemsParent = objWMIService.ExecQuery("Select * from Win32_DiskDrive")
intCount = DiskItemsParent.Count
' Process Drives
intDriveMark = 0
For i = 0 To intCount - 1
Set DiskItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive WHERE Index = " & i)
For Each diskItem in DiskItems
' Convert Drive Size
If diskItem.Size <> "" Then strSize = strSize & ByteConvert(diskItem.Size) & Chr(10) Else strSize = "N/A" & Chr(10)
If diskItem.StatusInfo <> "" Then strStsInfo = diskItem.StatusInfo Else strStsInfo = "N/A"
If diskItem.SCSIBus <> "" Then strSCSIBus = diskItem.SCSIBus Else strSCSIBus = "N/A"
If diskItem.SCSILogicalUnit <> "" Then strSCSILog = diskItem.SCSILogicalUnit Else strSCSILog = "N/A"
If diskItem.SCSIPort <> "" Then strSCSIPort = diskItem.SCSIPort Else strSCSIPort = "N/A"
If diskItem.SCSITargetId <> "" Then strSCSITarget = diskItem.SCSITargetId Else strSCSITarget = "N/A"
' Get Model
strModel = Split(diskItem.Model, " ")
' Detect HP Array
If (UCase(strModel(0)) = "HP" Or UCase(strModel(0)) = "COMPAQ") And intDriveMark = 0 Then
strGetHPArray = GetHPArray(strComputer, strUsername, strPassword)
If strGetHPArray <> "" Then
strSplitHP = Split(strGetHPArray, Chr(13))
For a = 0 To UBound(strSplitHP)
strSplitResult = Split(strSplitHP(a), ":")
i = i + 1
strDriveCount = strDriveCount & Trim(strSplitResult(0)) & Chr(10)
strDriveSize = strDriveSize & Trim(strSplitResult(1)) & Chr(10)
strDriveFault = strDriveFault & Trim(strSplitResult(2)) & Chr(10)
strDriveSpare = strDriveSpare & Trim(strSplitResult(3)) & Chr(10)
strInterface = strInterface & "HP SCSI" & Chr(10)
Next
' Set Controller Output
objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
intDriveMark = 1 ' Mark That Data was Obtained
Else
strDriveCount = strDriveCount & "1" & Chr(10)
strDriveSize = strDriveSize & strSize & Chr(10)
strDriveFault = strDriveFault & "N/A" & Chr(10)
strDriveSpare = strDriveSpare & "N/A" & Chr(10)
strInterface = strInterface & "HP SCSI " & Chr(10)
' Set Controller Output
intDriveMark = 1 ' Mark That Another Pass is Invalid
' Set Controller Output
objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
End If
Else
strDriveCount = strDriveCount & "1" & Chr(10)
strDriveSize = strDriveSize & strSize & Chr(10)
strDriveFault = strDriveFault & "N/A" & Chr(10)
strDriveSpare = strDriveSpare & "N/A" & Chr(10)
' Set Controller Output
intDriveMark = 1 ' Mark That Another Pass is Invalid
' Set Controller Output
objXLA.Cells(b + 2, 19).Value = Trim(Left(strDriveCount, Len(strDriveCount) - 1))
objXLA.Cells(b + 2, 20).Value = Trim(Left(strDriveSize, Len(strDriveSize) - 1))
objXLA.Cells(b + 2, 21).Value = Trim(Left(strDriveFault, Len(strDriveFault) - 1))
objXLA.Cells(b + 2, 22).Value = Trim(Left(strDriveSpare, Len(strDriveSpare) - 1))
' Set Interface
If diskItem.InterfaceType = "IDE" Then
strInterface = strInterface & "ATA" & Chr(10)
Else
strInterface = strInterface & "SATA/SCSI" & Chr(10)
End If
End If
' Set Cell Value "Interface"
objXLA.Cells(b + 2, 18).Value = Left(strInterface, Len(strInterface) - 1)
Next
' Dispose Drive Sizes
strDriveSize = ""
Next
' Dispose Drive Values
strDriveCount = ""
strDriveFault = ""
strDriveSpare = ""
strInterface = ""
'----Partition Information (End)---------------------------'
'----Network Information (Start)---------------------------'
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter")
i = 1
eth = 0
Dim STOREDIP(0)
intNum = 0
For Each objItem in colItems
If objItem.NetConnectionStatus <> "" Then
' Determine Connection Status
If objItem.NetConnectionStatus = 0 Then
strNetStat = "Disabled"
ElseIf objItem.NetConnectionStatus = 2 Then
strNetStat = "Connected"
ElseIf objItem.NetConnectionStatus = 7 Then
strNetStat = "Disconnected"
Else
strNetStat = "Unknown"
End If
If objItem.NetConnectionStatus <> 0 Then
' Get Network Card Information
Const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath1 = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
strKeyPath2 = "SYSTEM\CurrentControlSet\Services\NetBT\Parameters"
strHostEntry = "Hostname"
strDomainEntry = "Domain"
strNodeEntry = "DhcpNodeType"
strRoutingEntry = "IPEnableRouter"
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strHostEntry,strHostname
objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strDomainEntry,strDomain
objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strNodeEntry,dwNodeType
objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath1,strRoutingEntry,dwIPRouting
Select Case dwNodeType
Case 4 strNodeType = "Mixed"
Case 8 strNodeType = "Hybrid"
Case Else strNodeType = dwNodeType
End Select
If dwIPRouting = 0 Then
strIPRouting = "No"
ElseIf dwIPRouting = 1 Then
strIPRouting = "Yes"
Else
strIPRouting = "?"
End If
Set colFirstNicConfig = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objFirstNicConfig In colFirstNicConfig
strDnsWins = objFirstNicConfig.DNSEnabledForWINSResolution
Next
Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
' Display per-adapter settings.
For Each objNicConfig In colNicConfigs
intIndex = objNicConfig.Index
Set objNic = objWMIService.Get("Win32_NetworkAdapter.DeviceID=" & intIndex)
' Connection Name
If GetOsVer > 5 Then
' Works only in XP / 2003
strNetConn = objNic.NetConnectionID
ElseIf GetOsVer = 5 Then
strNetConn = ""
' Get Home Drive of Remote Server
Set objShell = CreateObject("WScript.Shell")
Set objEtherName = objShell.Exec("cmd /c ipconfig | find " & Chr(34) & "Ethernet" & Chr(34))
strEtherName = objEtherName.StdOut.ReadAll()
strEtherParse = Split(strEtherName, Chr(13))
strEtherConn = Split(strEtherParse(eth), " ")
For y = 2 To UBound(strEtherConn)
strNetConn = strNetConn & " " & strEtherConn(y)
Next
' Trim Connection Name
strNetConn = Left(Trim(strNetConn), Len(Trim(strNetConn)) - 1)
Else
strNetConn = ""
End If
' IP Addresses
strIPAddresses = ""
If Not IsNull(objNicConfig.IPAddress) Then
For Each strIPAddress In objNicConfig.IPAddress
strIPAddresses = strIPAddresses & strIPAddress & " "
Next
End If
strIPCollection = Split(strIPAddresses, " ")
' Subnets
strIPSubnets = ""
If Not IsNull(objNicConfig.IPSubnet) Then
For Each strIPSubnet In objNicConfig.IPSubnet
strIPSubnets = strIPSubnets & strIPSubnet & " "
Next
End If
strSMCollection = Split(strIPSubnets, " ")
' Virtual IP's
strVirtual = ""
If UBound(strIPCollection) > 1 Then
For IPCount = 1 To UBound(strIPCollection) - 1
strVirtual = strVirtual & (strIPCollection(IPCount) & " / " & strSMCollection(IPCount)) & Chr(10)
Next
strVirtual = Left(strVirtual, Len(strVirtual) - 1)
End If
If Trim(strVirtual) = "" Then strVirtual = "N/A"
' Gateways
strDefaultIPGateways = ""
If Not IsNull(objNicConfig.DefaultIPGateway) Then
For Each strDefaultIPGateway In objNicConfig.DefaultIPGateway
strDefaultIPGateways = strDefaultIPGateways & strDefaultIPGateway & " "
Next
Else
strDefaultIPGateways = "N/A"
End If
' If IP is repeated, and was already reported.
intSkipLoop = 0
If Trim(strNetConn) <> "" Then
For j = 0 To intNum - 1
If STOREDIP(j) = strIPAddresses Then
intSkipLoop = 1
Exit For
End If
Next
If intSkipLoop = 0 Then
ReDim Preserve STOREDIP(intNum)
STOREDIP(intNum) = strIPAddresses
intNum = intNum + 1
End If
Else
intSkipLoop = 1
End If
' DNS
strDNSServerSearchOrder = ""
If Not IsNull(objNicConfig.DNSServerSearchOrder) Then
For Each strDNSServer In objNicConfig.DNSServerSearchOrder
strDNSServerSearchOrder = strDNSServerSearchOrder & strDNSServer & " "
Next
strDNS = Split(strDNSServerSearchOrder, " ")
strDNS1 = strDNS(0)
If Trim(strDNS1) = "" Then strDNS1 = "N/A"
If UBound(strDNS) > 1 Then
strDNS2 = strDNS(1)
Else
strDNS2 = "N/A"
End If
Else
strDNS1 = "N/A"
strDNS2 = "N/A"
End If
' Run Output Process
If intSkipLoop = 0 Then
' Connection Speed
strSpeed = "Unknown"
Set objWMIService2 = objSWbemLocator.ConnectServer _
(strComputer, "root\WMI", strUsername, strPassword)
objWMIServices.Security_.ImpersonationLevel = 3
Set listAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_LinkSpeed")
Set enumAdapters = objWMIService2.ExecQuery("SELECT * FROM MSNdis_EnumerateAdapter")
For Each objAdapter in listAdapters
For Each objEnum in enumAdapters
intEnum = Len(objEnum.DeviceName)
If objNicConfig.SettingID = Right(objEnum.DeviceName, intEnum - 8) Then
If objEnum.InstanceName = objAdapter.InstanceName Then
intLength = Len(objAdapter.NdisLinkSpeed/10000)
If intLength > 3 Then
strSpeed = Left(objAdapter.NdisLinkSpeed/10000, intLength - 3)
strSpeed = strSpeed & ".0 Gbps"
Else
strSpeed = objAdapter.NdisLinkSpeed/10000 & " Mbps"
End If
End If
End If
Next
Next
strTotalDesc = strTotalDesc & objNicConfig.Description & Chr(10)
strTotalSpeed = strTotalSpeed & strSpeed & Chr(10)
strTotalNetConn = strTotalNetConn & strNetConn & Chr(10)
strPrimaryIP = strPrimaryIP & strIPCollection(0) & " / " & strSMCollection(0) & Chr(10)
strDNSTotal1 = strDNSTotal1 & strDNS1 & Chr(10)
strDNSTotal2 = strDNSTotal2 & strDNS2 & Chr(10)
strTotalVirtual = strTotalVirtual & strVirtual & Chr(10)
i = i + 1
eth = eth + 2
' Dispose
strDescription = ""
ProcCount = 0
strClockSpeed = ""
strInterface = ""
intCount = 0
strSize = ""
strSpeed = ""
strIPCollection = ""
strVirtual = ""
strDNS = ""
strDNS1 = ""
strDNS2 = ""
End If
Next
' Output
' Trim Leading Chr(10)
If Left(strPrimaryIP, 1) = Chr(10) Then strPrimaryIP = Right(strPrimaryIP, Len(strPrimaryIP) - 1)
If Left(strTotalVirtual, 1) = Chr(10) Then strTotalVirtual = Right(strTotalVirtual, Len(strTotalVirtual) - 1)
If Left(strDNSTotal1, 1) = Chr(10) Then strDNSTotal1 = Right(strDNSTotal1, Len(strDNSTotal1) - 1)
If Left(strDNSTotal2, 1) = Chr(10) Then strDNSTotal2 = Right(strDNSTotal2, Len(strDNSTotal2) - 1)
objXLA.Cells(b + 2, 11).Value = Trim(Left(strTotalDesc, Len(strTotalDesc) - 1))
objXLA.Cells(b + 2, 12).Value = Trim(Left(strTotalSpeed, Len(strTotalSpeed) - 1))
objXLA.Cells(b + 2, 13).Value = Trim(Left(strTotalNetConn, Len(strTotalNetConn) - 1))
objXLA.Cells(b + 2, 14).Value = Trim(Left(strPrimaryIP, Len(strPrimaryIP) - 1))
objXLA.Cells(b + 2, 15).Value = Trim(Left(strTotalVirtual, Len(strTotalVirtual) - 1))
objXLA.Cells(b + 2, 16).Value = Trim(Left(strDNSTotal1, Len(strDNSTotal1) - 1))
objXLA.Cells(b + 2, 17).Value = Trim(Left(strDNSTotal2, Len(strDNSTotal2) - 1))
End If
End If
' Dispose Per Loop
strTotalDesc = ""
strTotalSpeed = ""
strTotalNetConn = ""
strPrimaryIP = ""
strDNSTotal1 = ""
strDNSTotal2 = ""
strTotalVirtual = ""
Set eth = 0
Set i = 0
Next
'------------Network Information (End)------------------'
Else
'No Data Present
objXLA.Cells(b + 2, 1).Value = strComputer
objXLA.Cells(b + 2, 3).Value = "Information Not Available"
objXLA.Cells(b + 2, 1).EntireRow.Font.Bold = True
objXLA.Cells(b + 2, 1).EntireRow.Interior.ColorIndex = 44
End If
' Dispose Per Server
ProcCount = 0
strSocket = ""
strProcID = ""
strUniqueID = ""
Set objWMIService = Nothing
Next
'-----------------Functions (Start)---------------------'
' System Memory Conversion
Function MemoryConvert(strMem)
Dim intLength
Dim intExp
Dim intSize
Dim strSize
Dim strMeasure
Dim strMemory
intLength = Len(strMem)
If (intLength Mod 4 = 0) Then
intExp = CInt((intLength / 3) - 2)
Else
intExp = CInt((intLength / 3) - 1)
End If
' Convert to Lowest Integer Value
For intCount = 1 To Len(intExp)
chrRead = Mid(intExp, intCount, 1)
If chrRead = "." Then
Exit For
Else
strRead = strRead & chrRead
End If
Next
intExp = Cint(strRead)
intSize = CLng(strMem / (2 ^ (intExp * (10))))
If Len(intSize) = 1 Then
strFormat = FormatNumber(CStr(intSize), 2)
Else
strFormat = intSize + 1
End If
If (intExp = 1) Then
strMeasure = "KB"
ElseIf (intExp = 2) Then
strMeasure = "MB"
ElseIf (intExp = 3) Then
strMeasure = "GB"
ElseIf (intExp = 4) Then
strMeasure = "TB"
ElseIf (intExp = 5) Then
strMeasure = "PB"
ElseIf (intExp = 6) Then
strMeasure = "EB"
End If
MemoryConvert = strFormat & " " & strMeasure
End Function
' System Byte Conversion
Function ByteConvert(strMem)
Dim intLength
Dim intExp
Dim intSize
Dim strSize
Dim strMeasure
Dim strMemory
intLength = Len(strMem)
If (intLength Mod 3 = 0) Then
intExp = (intLength / 3) - 1
Else
intExp = (intLength / 3)
End If
' Convert to Lowest Integer Value
For intCount = 1 To Len(intExp)
chrRead = Mid(intExp, intCount, 1)
If chrRead = "." Then
Exit For
Else
strRead = strRead & chrRead
End If
Next
intExp = Cint(strRead)
intSize = CLng(strMem / (2 ^ (intExp * (10))))
strFormat = FormatNumber(CStr(intSize), 2)
If (intExp = 1) Then
strMeasure = "KB"
ElseIf (intExp = 2) Then
strMeasure = "MB"
ElseIf (intExp = 3) Then
strMeasure = "GB"
ElseIf (intExp = 4) Then
strMeasure = "TB"
ElseIf (intExp = 5) Then
strMeasure = "PB"
ElseIf (intExp = 6) Then
strMeasure = "EB"
End If
ByteConvert = strFormat & " " & strMeasure
End Function
' System RAID Byte Conversion
Function ByteConvertRAID(strMem)
Dim intLength
Dim intExp
Dim intSize
Dim strSize
Dim strMeasure
Dim strMemory
intLength = Len(strMem)
If (intLength Mod 3 = 0) Then
intExp = (intLength / 3) - 1
Else
intExp = (intLength / 3)
End If
' Convert to Lowest Integer Value
For intCount = 1 To Len(intExp)
chrRead = Mid(intExp, intCount, 1)
If chrRead = "." Then
Exit For
Else
strRead = strRead & chrRead
End If
Next
intExp = Cint(strRead)
intSize = (strMem / (2 ^ (intExp * (10))))
strFormat = FormatNumber(CStr(intSize), 2)
If (intExp = 0) Then
strMeasure = "MB"
ElseIf (intExp = 1) Then
strMeasure = "GB"
ElseIf (intExp = 2) Then
strMeasure = "TB"
ElseIf (intExp = 3) Then
strMeasure = "PB"
ElseIf (intExp = 4) Then
strMeasure = "EB"
End If
ByteConvertRAID = strFormat & " " & strMeasure
End Function
' Trim Processor Description
Function ProcessorName(strName)
Dim intCounter
Dim strRead
Dim chrRead, chrReadMore
For intCounter = 1 to Len(strName)
chrRead = Mid(strName, intCounter, 1)
chrReadMore = Mid(strName, intCounter + 1, 1)
If ((chrRead <> " ") Or ((chrRead = " ") And (chrReadMore <> " "))) Then
strRead = strRead & chrRead
End If
Next
ProcessorName = Trim(strRead)
End Function
' Get Hyper-Threading Status
Function GetHTStatus(strName, intProc, strID, strUnique)
strNameArray = Split(strName, vbcrlf)
strIDArray = Split(strID, vbcrlf)
strUniqueList = Split(strUnique, vbcrlf)
intTotal = 0
' Check Socket Designation
For i = 0 To UBound(strNameArray) - 1
intMark = 1
' Check for Redundancies
For j = i + 1 To UBound(strNameArray) - 1
If strNameArray(i) = strNameArray(j) Then
intMark = 0
End If
Next
' If Redundant Unique ID's Exist
For j = i + 1 To UBound(strNameArray) - 1
If strUniqueList(i) <> "" And strUniqueList(j) <> "" And _
(strUniqueList(i) <> strUniqueList(j)) Then
intMark = 1
End If
Next
' Check for NULL ProcessorID
If Trim(strIDArray(i)) = "0000000000000000" Then
intMark = 0
End If
' Calculate Total
If intMark = 1 Then
intTotal = intTotal + intMark
End If
Next
' Compare Results
If intProc = 2 * intTotal Then
GetHTStatus = "True"
Else
GetHTStatus = "False"
End If
End Function
' Get Memory Breakdown
Function MemoryBreakdown
Set colPMAItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemoryArray",,48)
For Each objPMAItem in colPMAItems
lngMax = CLng(objPMAItem.MaxCapacity)
intCount = CInt(objPMAItem.MemoryDevices)
Next
ReDim Preserve strPMArray(intCount)
Set colPMItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48)
For Each objPMItem in colPMItems
strValue = strValue & objPMItem.DeviceLocator & ": "
strValue = strValue & objPMItem.Capacity / 2^20 & "MB, "
strValue = strValue & objPMItem.Speed & "MHz"
strPMArray(TrimTrailingNumber(objPMItem.Tag)) = strValue
strValue = ""
Next
j = 0
strResult = ""
For j = 0 To intCount - 1
If Trim(strPMArray(j)) = "" Then strPMArray(j) = "<Empty>"
strResult = strResult & strPMArray(j) & vbcrlf
Next
strResult = strResult & (lngMax / 2^10) & "MB"
MemoryBreakdown = strResult
End Function
' Get Part Name
Function ExtractPartName(strName)
Dim chrRead
Dim strRead
Dim i
For i = 2 To Len(strName)
chrRead = Mid(strName, Len(strName) - (i - 1), 1)
If chrRead <> Chr(34) Then
strRead = chrRead & strRead
Else
Exit For
End If
Next
ExtractPartName = strRead
End Function
' Get Trailing Number
Function TrimTrailingNumber(strNum)
Dim chrRead
Dim strRead
Dim intLen
strNum = Trim(strNum)
intLen = Len(strNum)
i = 1
For i = 1 To intLen
chrRead = Mid(strNum, intLen - (i - 1), 1)
If IsNumeric(chrRead) = "True" Then
strRead = chrRead & strRead
Else
Exit For
End If
Next
TrimTrailingNumber = strRead
End Function
' Function: WMIDateStringToDate(dtmDate)
Function WMIDateToString(dtmDate)
WMIDateToString = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & _
Left(dtmDate, 4) & " " & _
Mid(dtmDate, 9, 2) & ":" & _
Mid(dtmDate, 11, 2) & ":" & _
Mid(dtmDate, 13, 2))
End Function
' Function: GetOsVer
Function GetOsVer
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem In colOperatingSystems
GetOSVer = CSng(Left(objOperatingSystem.Version, 3))
Next
End Function
' Function: GetHPArray
Function GetHPArray(strComputer2, strUsername2, strPassword2)
' Check for 64-bit Windows
If InStr(PUBOSVer, "x64") Then
strCompaq = "Program Files (x86)\Compaq\Cpqacuxe\Bin"
Else
strCompaq = "Program Files\Compaq\Cpqacuxe\Bin"
End If
' Create Connection Object
Set objWMIServiceRem = objWMIService.Get("Win32_Process")
' Confirm Location of Compaq Array Manager
Set objHPShell = CreateObject("WScript.Shell")
Set objHPFSO = CreateObject("Scripting.FileSystemObject")
Set WshNetwork2 = WScript.CreateObject("WScript.Network")
WshNetwork2.MapNetworkDrive "", "\\" & strComputer2 & "\C$" ,,strUsername2, strPassword2
strProgram = "\\" & strComputer2 & "\C$\" & strCompaq & "\cpqacuxe.exe"
' Ensure Access is Possible
If objHPFSO.FileExists(strProgram) Then
' Process Array Config
strProcess = Chr(34) & "C:\" & strCompaq & "\cpqacuxe.exe" & Chr(34) & " -c c:\output.txt"
Process = objWMIServiceRem.Create(strProcess, null, null, intProcessID)
' Check for "output.txt"
For intTimerHP = 0 To 10
If objFSO.FileExists("\\" & strComputer2 & "\C$\output.txt") Then
Exit For
Else
WScript.Sleep(1000)
End If
Next
' Process Output
If intTimerHP < 10 Then
' Check for Locked Output File
Set objHPOutputFile = objHPFSO.GetFile("\\" & strComputer2 & "\C$\output.txt")
If objHPOutputFile.Size <> 0 Then
' Close File
Set objHPOutputFile = Nothing
' Continue Processesing File
Set objHPInputFile = objHPFSO.OpenTextFile("\\" & strComputer2 & "\C$\output.txt", ForReading)
Do Until objHPInputFile.AtEndOfStream
strHPArray = strHPArray & objHPInputFile.ReadLine & vbcrlf
Loop
' Close Input File
objHPInputFile.Close
' Close Link to Server
objHPFSO.DeleteFile("\\" & strComputer2 & "\C$\output.txt")
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
' Create String Array
strHPParse = Split(strHPArray, vbcrlf)
' Parse For Individual RAID Arrays
Dim strArrayList()
z = 0
For i = 0 To UBound(strHPParse)
j = 0
' Array and Drives
If InStr(strHPParse(i), "Array Specifications") Then
ReDim Preserve strArrayList(z)
strArrayList(z) = strArrayList(z) & strHPParse(i) & vbcrlf
For j = i + 1 To Ubound(strHPParse)
If InStr(strHPParse(j), "Array Specifications") Then
Exit For
Else
strArrayList(z) = strArrayList(z) & strHPParse(j) & vbcrlf
End If
Next
z = z + 1
End If
Next
' Process Each RAID Array
x = 0
For x = 0 To UBound(strArrayList)
strListParse = Split(strArrayList(x), vbcrlf)
For y = 0 To UBound(strListParse)
' Drives
If Left(strListParse(y), 6) = "Drive=" Then
strDrives = ""
strDrives = Split(strListParse(y), ",")
k = 0
For j = 0 To UBound(strDrives)
k = k + 1
Next
strDriveCount = k ' For Output
End If
' Hot Spare
If InStr(strListParse(y), "OnlineSpare=") Then
If InStr(strListParse(y), "OnlineSpare= No") Then
strHotSpare = strHotSpare & "N" ' For Output
Else
strHotSpare = strHotSpare & "Y" ' For Output
End If
End If
' Logical Drives
If InStr(strListParse(y), "Logical Drive Specifications") Then
' Find First Logical Drive
strRAID = Split(strListParse(y + 2), " ")
strRAIDResult = strRAIDResult & "RAID " & strRAID(1) & " / " ' For Output
strGetDrive = Split(strListParse(y + 3), " ")
strRAIDSize = strRAIDSize & ByteConvertRAID(strGetDrive(1)) & " / " ' For Output
End If
Next
' Process Results
strRAIDSize = Left(strRAIDSize, Len(strRAIDSize) - 3)
strRAIDResult = Left(strRAIDResult, Len(strRAIDResult) - 3)
strNewList = strNewList & strDriveCount & _
":" & strRAIDSize & ":" & strRAIDResult & ":" & strHotSpare & Chr(13)
' Dispose Array Variables
strDriveCount = ""
strRAIDSize = ""
strRAIDResult = ""
strHotSpare = ""
Next
' Return Array Output
GetHPArray = Left(strNewList, Len(strNewList) - 1)
Exit Function
Else ' "output.txt" Is Locked
' Close File
Set objHPOutputFile = Nothing
' Kill Remote Connection
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
GetHPArray = ""
Exit Function
End If
Else ' "output.txt" Does not Exist
' Kill Remote Connection
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
GetHPArray = ""
Exit Function
End If
Else ' "Array Manager Does not Exist
' Input not Available
Set objGetHPArray = objHPShell.Exec("net use \\" & strComputer2 & "\C$ /delete /yes")
Do While (objGetHPArray.Status = 0)
WScript.Sleep(500)
Loop
GetHPArray = ""
Exit Function
End If
End Function
'--------------------Functions (End)--------------------'
' Set Excel Attributes
Const xlVAlignTop = -4160
Set objRange2 = objWorksheet.UsedRange
objRange2.VerticalAlignment = xlVAlignTop
' Set Font Attributes
objXLA.Cells.Font.Size = 8
objXLA.Cells.Font.Name = "Arial"
objXLA.Cells.Font.ColorIndex = 11
objXLA.Cells.EntireColumn.AutoFit
objXLA.Cells(1, 9).ColumnWidth = 30 ' RAM Slots
objXLA.Cells(1, 11).ColumnWidth = 40 ' NIC Port
objXLA.Cells(1, 13).ColumnWidth = 25 ' Connection Name
objXLA.Cells(1, 14).ColumnWidth = 25 ' Interface IP's
objXLA.Cells(1, 15).ColumnWidth = 25 ' Virtual IP's
objXLA.Cells(1, 16).ColumnWidth = 15 ' DNS1
objXLA.Cells(1, 17).ColumnWidth = 15 ' DNS2
objXLA.Cells(1, 18).ColumnWidth = 15 ' Interface Type
objXLA.Cells.HorizontalAlignment = 2 ' Drive Count
objXLA.Cells(1, 20).ColumnWidth = 20 ' Virtual IP's
objXLA.Cells(1, 21).ColumnWidth = 20 ' Virtual IP's
' Save
set objFSO2 = CreateObject("Scripting.FileSystemObject")
strFileName = objFSO2.getAbsolutePathName("") & "\Scan Results.xls"
objWorkbook.SaveAs(strFileName)
objWorkbook.Close
objXLA.Quit
' Notify User
WScript.Echo "Process Completed (" & Now & ")"
' Close Program
WScript.Quit(0) -
How to get Report Output in csv format
Hi,
How can i get report Output in csv format, can any one tell me the word used for output type to get output in csv format.
i have used XLS output type but it opens in excel format.
conc.addLayout(appCode,concReqCode,"en-US","US",XLS);
Thanks
BabuHi Babu,
Till now in xmlpublisher there is no method to create file in csv format ,you have to create Excel file and then save it in .csv format.Unless and until ur using BI Publisher in which some work around are possible.
Thanks -
Output channel mapping problem for surround encoder
vista 64 bit
sound blaster titanium x-fi sound card
logitech 5.1 speaker set up
hello, i am trying to mix a movie i made into 5.1. when i open the surround encoder, go to the audio hardware setup and try to set my output channel mapping i only get two speakers. i have a card that supports 5.1, 5.1 speakers, and get surround sound when i play a DVD. yet audition only recognizes my left and right speaker. any help on how i get my output channel mapping set correctly?
thanks in advance!Thank you for the info, though I admit I'm still a bit confused.
My card is a creative x-fi extreme gamer. It has 3 line out jacks and one line in jack. T Oh, here it is in the manual...thats just not good enough.
But what is the surround encoder dialog box doing, if not encoding surround mixes? The manual says I can exportsurround sound from a multitrack session.
Date: Mon, 1 Jun 2009 21:58:08 -0600
From: [email protected]
To: [email protected]
Subject: output channel mapping problem for surround encoder -
Can we Compare PDF Output with CSV format
Team,
Can we Compare PDF Output with CSV format.
In Excel I need to two text boxes asking us to browse the files and compare the files PDF & CSV format.
Please suggest me if we have solution for this.
Thanks!
KiranHi
I'm afraid the Excel Application does not support this function currently, I am suggesting you to take advantage of a third party component to achieve this goal.
Thanks for your understanding.
Best Regards
Lan
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
SQL server Best Practice Analyzer output in .CSV
Hi Team, I ran SQL server Best practice analyzer on our SQL 2008 R2 server. I was trying to export scan result in .csv format but it is only giving me option to save it in .xml format. I have been looking for ways to export output in such a way
that it can be readable and I can send it to our clients but no luck.
How can I export SQL BPA output in .csv or any other user friendly format?
Thanks in Advance.Hi MSRS27,
You can run Best Practices Analyzer (BPA) scans either from Server Manager, by using the BPA GUI, or by using cmdlets in Windows PowerShell. We can view or save BPA results from Windows PowerShell session in different format.
If you want to export BPA results to a comma-separated values (CSV) text file, run the following cmdlet, where Path represents the path and text file name to which you want to save the CSV results.
CSV results can be imported into Microsoft® Excel, or other programs that display data in spreadsheets or grids.
Get-BPAResultModel ID| Export-CSVPath
For more information, see: Run Best Practices Analyzer Scans and Manage Scan Results
http://technet.microsoft.com/en-us/library/hh831400.aspx
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support -
Not able to generate output in CSV(EXCEL) format
Hi,
XML Publisher report is giving me an error when the Preview Format is 'EXCEL'. When I keep the Preview Format as 'PDF', the concurrent program is running successfully and the PDF output is getting generated. But for EXCEL outputs, I am getting the following error :
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
The operation completed successfully. Error processing resource 'http://erpap01:8010/OA_CGI/FNDWRR.exe?temp_id=1...
<td valign="top" class="c7"><p class="c8"><span class="c9">13 July 2009 13:15:57 PM</span>...
I have using the following Data Template for Data Definition
<?xml version="1.0" encoding="UTF-8"?>
<dataTemplate name="EMPDT" description="Employee Details" version="1.0">
<parameters>
<parameter dataType="character" name="p_DeptNo"> </parameter>
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT EMPNO
,ENAME
,JOB
,MGR
,HIREDATE
,DEPTNO
,SAL
,COMM
FROM scott.Emp
WHERE deptno = NVL(:p_DeptNo,deptno)
]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_EMP" dataType="varchar2" source="Q1">
<element name="EMPNO" value="EMPNO"/>
<element name="ENAME" value="ENAME"/>
<element name="JOB" value="JOB"/>
<element name="MGR" value="MGR"/>
<element name="HIREDATE" value="HIREDATE"/>
<element name="DEPTNO" value="DEPTNO"/>
<element name="SAL" value="SAL"/>
<element name="COMM" value="COMM"/>
</group>
</dataStructure>
</dataTemplate>
When I click on Diagnostic - View XML, copy the XML file and generate report using Word plugin, I am able to generate output in PDF and in EXCEL. But for some reason, when I try to run the XML Publisher report using concurrent program, I am unable to generate output in EXCEL and I am getting the error as listed above.
When I click on View Template - Preview, keeping the Preview format as Excel, I get the following error :
Exception Detail
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor179.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at oracle.apps.xdo.common.xml.XSLT10gR1.invokeParse(XSLT10gR1.java:517)
at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:224)
at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:177)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1657)
at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:967)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5888)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3438)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3527)
at oracle.apps.xdo.oa.template.server.TemplatesAMImpl.processTemplate(TemplatesAMImpl.java:2130)
at sun.reflect.GeneratedMethodAccessor173.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:749)
at oracle.apps.xdo.oa.template.webui.TemplateGeneralCO.previewTemplate(TemplateGeneralCO.java:741)
at oracle.apps.xdo.oa.template.webui.TemplateGeneralCO.processRequest(TemplateGeneralCO.java:158)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2335)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1734)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:508)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
at oa_html._OA._jspService(_OA.java:85)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
at oracle.jsp.JspServlet.service(JspServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
at oa_html._OA._jspService(_OA.java:95)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
at oracle.jsp.JspServlet.service(JspServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
at org.apache.jserv.JServConnection.run(JServConnection.java:294)
at java.lang.Thread.run(Thread.java:534)
Caused by: oracle.xdo.parser.v2.XMLParseException: Start of root element expected.
at oracle.xdo.parser.v2.XMLError.flushErrors1(XMLError.java:324)
at oracle.xdo.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:319)
at oracle.xdo.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
at oracle.xdo.parser.v2.XMLParser.parse(XMLParser.java:266)
Any inputs would be appreciated
Regards
DavidMay be it is browser problem? use another browser like Firefox
Edited by: ranalawa on Jul 14, 2009 2:21 PM -
J1inqefile - Excel output - Date field problem
Dear All,
I am facing a problem while executing the tcode-J1IEQEFILE.
When choosing excel file output and executing, 3 files are created. But the problem is, the value of date field in one of the files is not in date format.
Please help me out on this regard.
Thank you,
S.SridharI am also facing same problem in text file as well as in Excel file also. kindly some one could help me ( Date on which Amount paid and Date on which tax deducted).
Thanks
Venkat -
Report 10g output in excel problem
Dear Members,
I am using forms 10.1.2.0.2. I am calling the report from Forms parameter. I have passed the report_desformat=SPREADSHEET. But when i run the report it shows nothing and no out put is generated.
Please help me to find out the problem.
Parameter forms code is as under.
PROCEDURE rep_call (p_rep in char, p_param in paramlist) IS
report_id report_object;
mJob_ID varchar2(200);
mRep_Status varchar2(200);
mReportServer varchar2(100) := 'REP_SERVER';
mReportServerJob varchar2(200);
x varchar2(200);
BEGIN
report_id := find_report_object(p_rep);
set_report_object_property(report_id, report_execution_mode, runtime );
set_report_object_property(report_id, report_comm_mode, synchronous );
set_report_object_property(report_id, report_destype,cache);
set_report_object_property(report_id, report_desformat, 'SPREADSHEET' );
set_report_object_property(report_id, report_server, mReportServer);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'paramform=no');
mReportServerJob := run_report_object(report_id,p_param);
mJob_id := substr(mReportServerJob, length(mReportServer) + 2, length(mReportServerJob));
mRep_Status := report_object_status(mReportServerJob);
WHILE Mrep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
mrep_status := report_object_status(mReportServerJob);
END LOOP;
if mRep_status = 'FINISHED' then
x := '/reports/rwservlet/getjobid' || mJob_id
web.show_document (x, '_blank');
else
message('report failed with error message ' || mRep_status);
end if;
END;
Thanks & RegardsHi,
1- Are you getting a blank output? or nothing is happening when you call the report from Forms?
2- What is the status of the report job in Reports Queue manager?
3- Try to run the same report with the same parameters from the browser URL and compare behavior.
e.g
http://hostname:port/reports/rwservlet?report=<report name>&server=<reports server name>&destype=cache&desformat=spreadsheet¶mform=no&userid=user/pass@db&any_other_parameter=value ....
Regards, RZ -
Output XML file problem (in FILE to RFC scenario)
hi,
my problem is that in the export parameter i have 3 variables but my output xml file shows only 2 parameters . I have checked my mapping all 3 parameters are mapped properly in output mapping .
Initially when i started the scenario there were only 2 parameters in my export list .
i completed this suuccesfully and then as per new requirement one more parameter was needed to be added i added a new parameter and reimported my rfc .
the response tab of the reimported RFC shows me the newly added parameter but my final xml file only shows me the previous 2 it doesnt show me the newly added one is there any seeting which i need to change like in idoc where we have to readd the idoc in IDX2
With regards
Bhawarlal ChoudharyHi,
2 Introduction
Configuring IDoc adapter in Exchange Infrastructure 3.0 requires some configuration on the SAP
systems, for both XI and the backend system where the IDoc message is to be sent. These steps, although
simple, are many times missed or mis-configured, causing the delivery of messages to fail.
Since IDoc adapter uses the ABAP stack, instead of J2EE, the configuration requirements are mainly in
ABAP.
Setting up IDoc adapters requires the XI integration server to be able to communicate with the backend
SAP system, and also to make sure that the Logical System Name used when posting IDoc exists on the
backend SAP system.
3 The Step By Step Solution
The basic steps for the IDoc configuration are outline below:
1. Configure SM59 on XI to communicate to SAP backend system.
2. Configure port on XI for IDoc communication.
3. Create or verify the Logical System Name on the SAP backend system.
4. Create or verify business system in XIs System Landscape Directory.
5. Verify the Logical System Name of the business system.
6. Verify or add the Logical System Name for the sender business system.
7. Create/configure the Communication Channel for the IDoc receiver adapter
3.1 Configure SM59 on XI to communicate to SAP backend system.
1. Using transaction SM59, create an RFC destination with Connection Type = 3.
In this example, the RFC destination name is NDVCLNT510.
2. Enter the logon information:
3. Test the connection by clicking on Testing connection and Remote logon.
Both must be successful.
3.2 Configure port on XI for IDoc communication.
4. Go to transaction IDX1 on XI, and create a port. In this example, the Port name is SAPNDV.
The Port name must be in the form of SAPxxx, where xxx is the system ID of the backend SAP
system.
The Client must be the client number of the backend SAP system.
Select the RFC Destination which was created in the previous step.
3.3 Create or verify the Logical System Name on the SAP backend system.
5. Enter transaction SALE on the SAP backend system.
6. Create or verify the Logical System Name. In our example, NDVCLNT510 is verified.
3.4 Create or verify business system in XIs System Landscape Directory.
The business system name for the SAP backend system must contain a valid Logical System Name. This Logical System Name is the one verified or created in the previous step.
7. In the System Landscape Directory, select the SAP backend business system. If one does not exist, then create the business system. Verify the Logical System Name.
3.5 Verify the Logical System Name of the business system.
8. In the Integration Directory, doubleclick on the business system (in our example, it is NDVCLNT510).
Navigate the menu:
Service Adapter Specific Identifiers.
If information is empty or incorrect, then it will have to be synchronized with the content of the System Landscape Directory. Follow the steps below for synchronization.
9. (Optional) Synchronization of the business system in Integration Directory to the business system in System
Landscape Directory.
Double-click on the business system in the Integration Directory.
Switch to Edit mode.
Select menu: Service Adapter-Specific Identifiers
10. (Optional) Within the dialog box, click on the button as indicated below to resynchronize.
11. (Optional) If the expected data from the System Landscape Directory is not updated, then the SLD cache may need to be cleared first.
3.7 Create/configure the Communication Channel for the IDoc receiver adapter.
15. In the Integration Directory, create an IDoc receiver communication channel.
The RFC Destination is from step 3.1.
The Port is from step 3.2.
NOTE:
There is no need to create an IDoc sender Communication Channel for XI. Instead, the backend SAP system must be configure to send the IDoc to XI.
4 Appendix
Transaction: IDX2
There are a couple of situation where IDX2 can be useful on the XI system.
1. When we want to test connection between the XI and SAP backend system.
2. When an IDoc has changed, and the meta data stored in XI needs to be update. When an IDoc is sent from the SAP backend system to XI, XI will first check to see if the meta data for the IDoc is already in its persistent cache. If not, then XI will use the configuration in IDX1 to retrieve the IDoc meta data from the backend system. If the
meta is already in cache, then it will NOT do so. Therefore, when an IDoc has changed, it is necessary to manually update the new meta data on XI, or delete it from the cache, so that the latest version can be retrieved. IDX2 is used for this purpose.
Go to transaction IDX2 and click on Create.
Enter the IDoc Type and the Source Port as defined in step #2. Click Continue.If successful, the following will show up. If error occurs, then the IDX1 configurations will need to be re-checked.
Regards
Hemant
If find helpful plz award points -
Download to CSV problem in APEX report
Greetings,
I have a report that retrieves a lot of rows from the database, I have set the Mx Row Count to 25000. When the user tries to click on the download to csv link, it just works for a while and times out.
The other problem in this is that the report itself is taking a long time to run.
Any suggestions on improving the performance and solve the above mentioned problem will be greatly appreciated.
Thanks
Vatsaselect b.KB_SUITE_NAME SUITE, a.KB_TEST_CASE_NAME TESTCASE, b.kb_test_phase PHASE, a.KB_TEST_CASE_DESCRIPTION, a.KB_TEST_CASE_AUTHOR AUTHOR,
get_feature_from_ddts(b.KB_SUITE_FEATURE) FEATURE,
c.REQ_NAME TAG, e.REQ_DESC
from KB_TEST_CASE a, KB_SUITE b, KB_TC_REQ c, KB_TC_SUITE d, KB_REQUIREMENTS e
where a.KB_TEST_CASE_ID = d.KB_TEST_CASE_ID and
a.KB_TEST_CASE_ID = c.KB_TEST_CASE_ID and
d.KB_SUITE_ID = b.KB_SUITE_ID and
c.req_name = e.req_name and
b.proj_id = :p3_proj
It's a very simple query.. the same query runs in less than 2 seconds on SQL Navigator.. but when I run it from APEX it takes like 5 minutes. -
Hi,
I am trying to export a Query result to CSV in comma-delimited tab format.
In SBO it is allowing to save the query results as CSV file; but when I opened
it is in 'Text Unicode' filetype.
Is there anyway save it directly as CSV in comma-delimited tab format.
Thanks Regards
ShivaHi Gordon,
Sorry could not reply soon.
Its a smiple query
"SELECT ItemCode, ItemName, ItmsGrpNam,
LeadTime, VATLiable, CardCode"
The things is we might make some changes to it based on customer requirement. But the fact is no matter what query, I have no problem with query. It is while saving it is making a 'tab-delimited' file rather than 'comma-delimited file'. User has to manually open it and save it as CSV file.
Regards
Shiva -
Selecting Multiple Objects with Output Preview Causing Problems
I'm trying to edit a PDF and need to select multiple objects. Without Output Preview open, I can easily select all the items I need using the shift key. With Output Preview open, whenever I try to select the second object, Output Preview creates a sticky note, instead of selecting the second object.
I am also using the PitStop Pro plug-in.
Any idea how to correct this problem? Thanks!Unfortunately it seems that the new sticky note feature with the output preview in Acrobat XI uses the same keyboard shortcut as multiple selection tool in Pitstop (shift).
Closing the output preview is the easiest way to get around this issue.
We could consider changing the key for multiple selection in PitStop, but 'shift' is pretty much a default, so what could we change it too?
If anyone has any thoughts could they email me, I am the product manager responsible for Pitstop at Enfocus and my email is '[email protected]'
All feedback gratefully received. -
Namespace in output xml file problem?
Hi,
i imported an xsd in IR for developing an interface and the output was satisafactory except for a small problem in the namesapce which the file contains.
My xml file output looks like
<?xml version="1.0" encoding="UTF-8" ?>
- <MT_OSD_FILE xmlns="http://localfile/ext" Version="123" >
-field1
-field2
But where as the required format in the naming is
<?xml version="1.0" encoding="UTF-8" ?>
- <MT_OSD_FILE Version="123" xmlns="http://localfile/ext">
-field
-field
how to get the namespace before the version(attribute)
any ideas?Hi Prabhas,
<MT_OSD_FILE Version="123" xmlns="http://localfile/ext">
OR
<MT_OSD_FILE xmlns="http://localfile/ext" Version="123">
Both are same. Because, both Version and xmlns are arrtributes. And they should be unique (which they are) and they can be in any order.
Check XML standard [Link1|http://www.w3.org/TR/REC-xml-names/] Declaring Namespaces Such an attribute's name must either be xmlns or begin xmlns:. These attributes, like any other XML attributes, may be provided directly or by default.
Regards,
Raghu_Vamsee -
Composite AV output aspect ratio problem
I'm using an Apple Composite AV dock connector to connect my iPad 2 to an older TV. It has always worked well, displaying videos and images in the proper aspect ratio. Just today the images and videos have become too tall and normally widescreen output now fills the 4:3 screen. This is true of all our TVs. Is there a way to set the output aspect ratio on the iPad2? Is this an iOS5 problem? The TVs don't have adjustable aspect ratios.
I just tried my wife's iPad with iOS4 and it works fine. I suspect this is an iOS5 problem, or else something is wrong with my iPad2.
Maybe you are looking for
-
ITunes stops working when syncing iPod.....
every time I sync my iPod on iTunes it lags alot, doesn't say it is syncing anything, and crashes with a blue screen thats says something about a crash dump. I took b noir's advice and turned off automatic reboot. I just tried syncing my iPod and a l
-
Question about backendobject-config.xml file
Hello, I am trying to register a backend object in xcm/customer/backendobject-config.xml file, my entry looks like: <backendobject xmlns:isa="com.sapmarkets.isa.core.config" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xml="http://www.w3.org/XML/
-
Hi experts , I need ur guidance i have two tables S1 and S2.Now we have three columns in it api_number well name and section.Remember the apinumber for both the column is one and same but some well names may be different . I have written a stored pro
-
Hello Everyone, This is a post to Cisco for a bit of feedback regarding the BE3000. I've been using the device in the lab for the past few days and I wanted to make the follwoing points regarding the BE3K. Just outline where I'm coming from I have a
-
I understand that having configured my XI 3.0 cluster if I log into it using Designer and the name of a CMS Server in that cluster the registry will be updated with the Cluster details. In fact I can even see the server names in a key in the registr