Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Comdial FX Date setter
- #sets the PBX to the date and time of the local system
- #uses a modem hooked up to the serial port
- #
- #Jason Perkins 11/2/13
- #set the COM port number here
- $portno = 10
- $month = Get-Date -format MM
- $day = Get-Date -format dd
- $hour = Get-Date -format HH
- $minute = Get-date -format mm
- $time_string = echo $month$day$hour$minute
- echo $time_string
- $command_string = echo ATDT*#0*01`,$time_string`,`;H
- echo $command_string
- $port= new-Object System.IO.Ports.SerialPort COM$portno,9600,None,8,one
- $port.open()
- $port.WriteLine("$command_string `r")
- $port.Close()
- #echo Done!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement