Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMS text messages to phone via powershell

1,747 views
Skip to first unread message

Eero J

unread,
Feb 26, 2009, 3:11:02 AM2/26/09
to
Is it possible to send SMS text messages to mobile phone using powershell?
If yes, can someone please show the code? For example if i have Mobile phone
attrtibute set for user in AD, can i use it to send text messages to him/her?

Marco Shaw [MVP]

unread,
Feb 26, 2009, 11:37:05 AM2/26/09
to

Well, there is this commercial 3rd party add-on for this:
http://www.nsoftware.com/powershell/netcmdlets/default.aspx

Another option could be whether you have access to an email-to-sms
service or gateway where you could easily use PowerShell to send an
email, then have that service take care of the SMS part of it.

Marco

Vadims Podans

unread,
Feb 26, 2009, 12:18:21 PM2/26/09
to

OldDog

unread,
Feb 26, 2009, 10:46:42 PM2/26/09
to
On Feb 26, 11:18 am, "Vadims Podans" <vpodans> wrote:
> here is PowerShell script and discussion using GSM modem:http://translate.google.com/translate?prev=hp&hl=en&u=http%3A%2F%2Ffo...

>
> --
> WBR, Vadims Podans
> PowerShell blog -www.sysadmins.lv
>
> "Eero J" <Ee...@discussions.microsoft.com> rakstīja ziņojumā
> "news:8A0741FF-9A02-4693...@microsoft.com"...
>
>
>
> > Is it possible to send SMS text messages to mobile phone using powershell?
> > If yes, can someone please show the code? For example if i have Mobile
> > phone
> > attrtibute set for user in AD, can i use it to send text messages to
> > him/her?- Hide quoted text -
>
> - Show quoted text -

This works for me:

My cell phone is on AT&T and my smtp server is at comcast.net.

So, you need an SMTP server and you need to know the recipents
carrier.
Here is a link to many of the US carriers:
http://www.sms411.net/2006/07/how-to-send-email-to-phone.html

<-- Start Script ---------------------------------->

$sender = "m...@comcast.net"
$recipient = "21255...@txt.att.net"
$server = "smtp.comcast.net"
$subject = "Sending a File " + [System.DateTime]::Now
$body = "This is a test"
$msg = New-Object System.Net.Mail.MailMessage $sender, $recipient,
$subject, $body
$client = New-Object System.Net.Mail.SmtpClient $server
$client.Send($msg)

#<-----End Script ------>

Rob Campbell

unread,
Feb 26, 2009, 11:02:08 AM2/26/09
to
Does the phone vendor have an smtp gateway for sms messages?
0 new messages