[파이썬]텔레그램 푸시(2023버전)
# Script/Python2023. 1. 17. 10:45[파이썬]텔레그램 푸시(2023버전)

파이참을 작성해서 텔레그램 푸시를 테스트해볼려고하니 기존에 사용했던 방식은 먹히지 않아 구글링해본 결과 최근 텔레그램봇이 v20으로 업데이트 되면서 문제가 발생 해서 아래와 같이 하면 동작. import telegram import asyncio chat_token = "#############################" bot = telegram.Bot(token = chat_token) text = '안녕하세요' #### 리눅스에서는 아래 코드 삭제 또는 주석처리해야함 #### asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.run(bot.sendMessage(chat_id = "#############..

[파워쉘]윈도우 시간동기화 실패시 텔레그램 푸시
# Script/Powershell2020. 3. 16. 10:24[파워쉘]윈도우 시간동기화 실패시 텔레그램 푸시

$hostname = hostname $events=Get-WinEvent -FilterHashtable @ -MaxEvents 1 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $token = "#####################" $chatId = "#####################" $message = $events.message Invoke-RestMethod -Uri "https://api.telegram.org/bot$token/sendMessage?text=$message&chat_id=$chatId"

[파워쉘]Guest계정 상태 확인
# Script/Powershell2019. 8. 21. 10:20[파워쉘]Guest계정 상태 확인

guest계정은 보안상 비활성화하는게 좋습니다. 아래는 파워쉘로 guest계정이 비활성화되어있는지 상태를 확인하는 스크립트입니다. Get-WmiObject -Class Win32_UserAccount -Filter "LocalAccount='$true' and Name='Guest'"|Select-Object Name,Disabled|Format-Table -AutoSize 참조 : https://social.technet.microsoft.com/Forums/windowsserver/en-US/31eeea8c-e268-4dd0-8a62-4fc44e87f3a2/check-if-a-local-user-account-is-disabled-on-a-remote-computer?forum=winserverman..

[파워쉘]텔레그램 푸시
# Script/Powershell2018. 8. 21. 09:48[파워쉘]텔레그램 푸시

아래 내용 test.ps1로 저장 $token = "#########################" $chatId = "################" $message = $args Invoke-RestMethod -Uri "https://api.telegram.org/bot$token/sendMessage?text=$message&chat_id=$chatId" 실행 powershell -executionpolicy bypass test.ps1 테스트~~~

image