Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cannot convert argument "0", with value: "002374E4DBEC", for "LaunchClientApplication" to type "WebServiceProxy.ExternalId": "Cannot convert the "002374E4DBEC" value of type "System.String" to type "WebServiceProxy.ExternalId"."
- At C:PowerShellScriptsCrawler.ps1:72 char:50
- + $guid = $OSSNBranchWS.LaunchClientApplication <<<< ($FTCSTBExternalID.Ext_Device_ID,$applicationUri)
- + CategoryInfo : NotSpecified: (:) [], MethodException
- + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument
- ### Crawler
- ### SQL Login
- $SQLUser = "USERNAME"
- $SQLPassword = "PASSWORD"
- $SQLServer = "SQLSERVERDB"
- $SQLDBName = "SQLDB"
- $SqlQuery = "select a.externalID as Acct_Number, d.externalId as Ext_Device_ID
- from bm_account a inner join
- bm_device d on a.accountId = d.accountId
- where a.externalId='9999999999'
- order by Acct_Number,Ext_Device_ID"
- $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
- $SqlConnection.ConnectionString = "Server = $SQLServer; Database = $SQLDBName; User ID = $SQLUser; Password = $SQLPassword;"
- $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
- $SqlCmd.CommandText = $SqlQuery
- $SqlCmd.Connection = $SqlConnection
- $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
- $SqlAdapter.SelectCommand = $SqlCmd
- $DataSet = New-Object System.Data.DataSet
- $rowCount = $SqlAdapter.Fill($DataSet)
- $SqlConnection.Close()
- $FTCSTBExternalIDs = $DataSet.Tables[0]
- $Domain = 'DM'
- $UserName = 'USERNAME'
- $Password = 'PASSWORD'
- $UsernameDomain = $Domain+''+$UserName
- $SecurePassword=ConvertTo-SecureString -String $Password -AsPlainText -Force
- $Credential = New-Object System.Management.Automation.PSCredential $UsernameDomain,$SecurePassword
- $OSSNBranchWS = New-WebServiceProxy -Uri "http://mediaroomserver/ossNotificationsWS/UI.asmx?wsdl" -Namespace WebServiceProxy -Credential $Credential
- $applicationUri = "page:http://mediaroomserver.com/FTCPFApps/STBScrollingMessages/MediaroomPage.aspx"
- ForEach ($FTCSTBExternalID in $FTCSTBExternalIDs)
- {
- $msg_time = Get-Date -UFormat "%Y-%m-%d %r"
- $message = $msg_time+' - FTC Account Number: "'+$FTCSTBExternalID.Acct_Number+'", Device ID: "'+$FTCSTBExternalID.Ext_Device_ID+'"' | Out-File $log_file -Append
- $guid = $OSSNBranchWS.LaunchClientApplication($FTCSTBExternalID.Ext_Device_ID,$applicationUri)
- }
Add Comment
Please, Sign In to add comment