Send message with powershell

Send message with powershell SearchSearch

SMS & MMS Technical Forum » NowSMS Support - SMS Issues (Product Support Only) » Send message with powershell « Previous || Next »
Author Message
Kim Heikkinen
New member
Username: Zumi

Post Number: 4
Registered: 03-2019
Posted on Monday, February 17, 2020 - 01:58 pm:   


I created a script that sends a reply message via Powershell.
For some reason it doesn't work. It seems that Invoke-WebRequest command + url brings the logon window only.

Has someone managed to get the sms sending working with Powershell?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 6095
Registered: 08-2008
Posted on Monday, February 17, 2020 - 04:50 pm:   


Does the URL built in the script include &user=xxxxxx&password=yyyyyy parameters?

Can you share script details?

NowSMS Support
Kim Heikkinen
New member
Username: Zumi

Post Number: 5
Registered: 03-2019
Posted on Friday, February 21, 2020 - 11:27 am:   

Yes it includes it. Here is the command:

PS C:\Users\asd> Invoke-WebRequest -uri "http://localhost:8800/?PhoneNumber=123\&user=asd\&passw

StatusCode : 200
StatusDescription : OK
Content : <!DOCTYPE html>
<html lang="en">
<title>NowSMS Login</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="in...
RawContent : HTTP/1.1 200 OK
Connection: Keep-Alive
X-NowSMS-Login: true
Pragma: no-cache
Content-Length: 13098
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: text/html
Date: Fri, 21 Feb 2...
Forms : {loginForm}
Headers : {[Connection, Keep-Alive], [X-NowSMS-Login, true], [Pragma, no-cache], [Content-Length, 13098]...}
Images : {}
InputFields : {@{innerHTML=; innerText=; outerHTML=<input name="TOKEN" type="HIDDEN" value="6D3334C79AF">; outerT
ext=; tagName=INPUT; name=TOKEN; type=HIDDEN; value=6D3334C79AF}, @{innerHTML=; innerText=; outerHT
ML=<input name="USERNAME" style="width: 70%;" type="TEXT" autocapitalize="none">; outerText=; tagNa
me=INPUT; name=USERNAME; style=width: 70%;; type=TEXT; autocapitalize=none}, @{innerHTML=; innerTex
t=; outerHTML=<input name="PASSWORD" style="width: 70%;" type="PASSWORD" autocapitalize="none">; ou
terText=; tagName=INPUT; name=PASSWORD; style=width: 70%;; type=PASSWORD; autocapitalize=none}}
Links : {@{innerHTML=Show navigation; innerText=Show navigation; outerHTML=<a title="Show navigation" id="m
obilenav" href="#nav">Show navigation</a>; outerText=Show navigation; tagName=A; title=Show navigat
ion; id=mobilenav; href=#nav}, @{innerHTML=Hide navigation; innerText=Hide navigation; outerHTML=<a
title="Hide navigation" href="#">Hide navigation</a>; outerText=Hide navigation; tagName=A; title=
Hide navigation; href=#}, @{innerHTML=<span><div id="sendheader">Send Message</div></span>; innerTe
Send Message; outerHTML=<a aria-haspopup="true" onclick="return false;" href="#"><span><div id="sen
dheader">Send Message</div></span></a>; outerText=
Send Message; tagName=A; aria-haspopup=true; onclick=return false;; href=#}, @{innerHTML=Text; inne
rText=Text; outerHTML=<a onclick='return switchPage("/Send%20Text%20Message.htm");' href="/Send%20T
ext%20Message.htm">Text</a>; outerText=Text; tagName=A; onclick=return switchPage("/Send%20Text%20M
essage.htm");; href=/Send%20Text%20Message.htm}...}
ParsedHtml : System.__ComObject
RawContentLength : 13098

PS C:\Users\asd>
Kim Heikkinen
New member
Username: Zumi

Post Number: 6
Registered: 03-2019
Posted on Friday, February 21, 2020 - 11:30 am:   

Damn I figured it out, it goes like this on Windows powershell:
Invoke-WebRequest -uri "http://localhost:8800/&PhoneNumber=123&user=asd&password=asd&text=asd"

Add Your Message Here, or click here to create a new discussion topic.
Bold text Italics Underline Create a hyperlink Insert a clipart image
Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Click here to create an account.
Options: Automatically activate URLs in message

Login Login / Register Logout Logout Search Last 30 Days Topics Topics