Advertisement
compu_85

Comdial Time Set Script

Nov 2nd, 2013
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Comdial FX Date setter
  2. #sets the PBX to the date and time of the local system
  3. #uses a modem hooked up to the serial port
  4. #
  5. #Jason Perkins 11/2/13
  6.  
  7. #set the COM port number here
  8. $portno = 10
  9.  
  10. $month = Get-Date -format MM
  11. $day = Get-Date -format dd
  12. $hour = Get-Date -format HH
  13. $minute = Get-date -format mm
  14.  
  15. $time_string = echo $month$day$hour$minute
  16. echo $time_string
  17. $command_string = echo ATDT*#0*01`,$time_string`,`;H
  18. echo $command_string
  19.  
  20. $port= new-Object System.IO.Ports.SerialPort COM$portno,9600,None,8,one
  21. $port.open()
  22. $port.WriteLine("$command_string `r")
  23. $port.Close()
  24.  
  25. #echo Done!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement