SlideShare a Scribd company logo
Remote Access Services – and how to keep a remote access connection to a
remote server automatically
The following computer programme was developedin Accenture, Prague SDC, in May 2009 as an
operational improvement for the whole Microsoft Corporation. It works perfectly.
It is a good example of an automation of any daily tasks that we do in any company. It is a macro.
A description of a routine:
All employees need to log in to the Microsoft corporate network every day via a utility called “IT
Connection Manager” to use RAS from a remote node. Remote Access Services (RAS) refers to any
combinationof hardware andsoftwaretoenablethe remoteaccess toolsorinformationthattypically
reside on a network of IT devices. It refers to the authentication for remotes services access. A RAS
server is a specialized computer which aggregates multiple communication channels together.
To use RAS from a remote node,youneeda RAS clientprogram, which isbuiltinto most versionsof
Windows, or any PPP client software. For example, most remote control programs work with RAS.
There were cases when we lost the Internet connectionor RAS connection with corp.microsoft.com
server.
So,I developedamacro thatI called‘autoRAS’ thatcouldestablishthe lostconnectionautomatically.
It should be password protected because the code could well include the password, so viewing the
code would defeat the security but it serves its purpose as an example.
A very small batch file autoPING.batwastestingthe connectioneverynow and then whethermy PC
was connected to corp.microsoft.com or not as follows:
@echo off
ping corp.microsoft.com >nul
if %errorlevel% == 0 goto end
@echo No Reply on that IP!
start C:Usersv-alvymyDesktopautoRAS.vbs
:end
start exit
Itwasrunninginaloopwhich wassetupthrough WindowsTaskScheduler, forexampleeveryminute.
Pingisa computernetwork administrationutilityusedtotestthe reachabilityof a hoston anInternet
Protocol (IP) networkandtomeasure the round-triptimeformessagessentfromthe originatinghost
to a destination computer.
In a case of no response from Microsoftcorporate network corp.microsoft.com, the batchfile would
trigger my script called autoRAS.vbs :
Set WShell = CreateObject("WScript.Shell")
WShell.Run """C:WindowsSystem32rasphone.exe"""
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
Set objWorkbook = objExcel.Workbooks.Open("C:Usersv-alvymyDesktopsku
setup macros v2autoRAS_v2.xlsm")
objExcel.run "automatic_RAS"
So, the script autoRAS.vbs would open rasphone.exe application together with autoRAS_v2.xlsm
macro.
The VBA macro autoRAS_v2.xlsm would call a subroutine automatic_RAS() as follows:
AUTOMATIC RAS CONNECTION – autoRAS_v2.xlsm macro
'***********************************************
Note: [1.] We will have to link the dynamic library Windows USER32,
which will provide us API interface for calling functions of this
library. API prescribes a way of calling functions of a given library
from the source code of this macro. The most common standard is API
OS Win32 by Microsoft and POSIX(IEEE). Windows API (WinAPI, Win32)
was developed by Microsoft for OS MS Windows. All programs, regardless
of a programming language, running in MS Windows must communicate
through WinAPI (Win32) standard that contains the basic functions.
Functions are implemented in a basic system of DLL’s: kernel32.dll,
user32.dll, gdi32.dll.
Note [2.] We have to install the MSVC Spy++ software or WINSPECTOR
SPY and detect the names of classes in the running instances of windows
and processes, names of buttons…
'*******************************************************************
Option Explicit
Const BM_CLICK = &HF5
Const WM_CHAR = &H102
'*******************************************************************
'*********** API functions declarations ***************************
'*******************************************************************
Private Declare Function FindWindow Lib "user32.dll" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32.dll" _
Alias "PostMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SendMessage Lib "user32.dll" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal Msg As Long, _
wParam As Any, _
lParam As Any) As Long
Private Declare Function FindWindowEx Lib "user32.dll" _
Alias "FindWindowExA" _
(ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Private Declare Function SetFocusAPI Lib "user32.dll" _
Alias "SetFocus" _
(ByVal hWnd As Long) As Long
Private Declare Function SetForegroundWindow Lib "user32.dll" _
(ByVal hWnd As Long) As Boolean
'*******************************************************************
'Now that the API and Variables are set up, it is time for the rest
of the code
'*******************************************************************
Sub automatic_RAS()
Dim my_NTConnWindow, my_ITConnMgrWindow, my_buttonA, my_buttonB As
Long
Dim my_Connect_ITConnMgrWindow, my_buttonC As Long
Dim my_editBox As Long
Dim PIN As String
Dim i As Byte
'*** Calling API Function
my_NTConnWindow = FindWindow(vbNullString, "Network Connections")
'*** Calling API Function
Call SetForegroundWindow(my_NTConnWindow)
'If egFindWindow <> 0 Then
'e.g. we can also close the window like this &H10 ZAVRE OKNO:
'Messages = PostMessage(egFindWindow, &H10, 0&, 0&)
'End If
'*** Calling API Function
my_buttonA = FindWindowEx(my_NTConnWindow, ByVal 0&, "button",
"&Connect...")
'*** Calling API Function
Call SetFocusAPI(my_buttonA)
'******** Calling API Function **********
Call PostMessage(my_buttonA, BM_CLICK, 0&, 0&)
'pozn. SendMessage also hits the Connect.. and pops up IT Connection Mgr
'but fails to stop itself and is still running like in some loop?
'*** Calling API Function, all over again for the next IT Connection Mgr Win
Application.Wait (Now + TimeValue("0:00:03"))
my_ITConnMgrWindow = FindWindow(vbNullString, "IT Connection
Manager")
'Call SetForegroundWindow(my_ITConnMgrWindow)
Application.Wait (Now + TimeValue("0:00:03"))
my_buttonB = FindWindowEx(my_ITConnMgrWindow, ByVal 0&, "button",
"Connect")
Application.Wait (Now + TimeValue("0:00:03"))
'DoEvents
'Call SetFocusAPI(my_buttonB)
Call PostMessage(my_buttonB, BM_CLICK, 0&, 0&)
'mozny zpusob:
'Call PostMessage(my_buttonB, WM_LBUTTONDOWN, 0&, 0&)
'Call PostMessage(my_buttonB, WM_LBUTTONUP, 0&, 0&)
Application.Wait (Now + TimeValue("0:00:03"))
my_Connect_ITConnMgrWindow = FindWindow(vbNullString, "Connect IT
Connection Manager")
'*password
my_editBox = FindWindowEx(my_Connect_ITConnMgrWindow, ByVal 0&,
"edit", "")
my_buttonC = FindWindowEx(my_Connect_ITConnMgrWindow, ByVal 0&,
"button", "OK")
'DoEvents
'Call SetFocusAPI(my_buttonB)
PIN = "112233"
For i = 1 To Len(PIN)
Call PostMessage(my_editBox, WM_CHAR, Asc(Mid(PIN, i, 1)), 0&)
Next i
Call PostMessage(my_buttonC, BM_CLICK, 0&, 0&)
End Sub

More Related Content

What's hot

New and improved hacking oracle from web apps sumit sidharth
New and improved hacking oracle from web apps   sumit sidharthNew and improved hacking oracle from web apps   sumit sidharth
New and improved hacking oracle from web apps sumit sidharth
owaspindia
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​
FDConf
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to Celery
Idan Gazit
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Chun-Kai Wang
 
React Development with the MERN Stack
React Development with the MERN StackReact Development with the MERN Stack
React Development with the MERN Stack
Troy Miles
 
Stateful pattern con Azure Functions
Stateful pattern con Azure FunctionsStateful pattern con Azure Functions
Stateful pattern con Azure Functions
Massimo Bonanni
 
NestJS
NestJSNestJS
NestJS
Wilson Su
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor model
Massimo Bonanni
 
Redux. From twitter hype to production
Redux. From twitter hype to productionRedux. From twitter hype to production
Redux. From twitter hype to production
FDConf
 
Celery - A Distributed Task Queue
Celery - A Distributed Task QueueCelery - A Distributed Task Queue
Celery - A Distributed Task Queue
Duy Do
 
Metasploit primary
Metasploit primaryMetasploit primary
Take Control of your Integration Testing with TestContainers
Take Control of your Integration Testing with TestContainersTake Control of your Integration Testing with TestContainers
Take Control of your Integration Testing with TestContainers
Naresha K
 
(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014
(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014
(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014
Amazon Web Services
 
JRuby最新事情@札幌
JRuby最新事情@札幌JRuby最新事情@札幌
JRuby最新事情@札幌
Naoto Takai
 
Atomicity In Redis: Thomas Hunter
Atomicity In Redis: Thomas HunterAtomicity In Redis: Thomas Hunter
Atomicity In Redis: Thomas Hunter
Redis Labs
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
n|u - The Open Security Community
 
CBDW2014 - ColdBox RESTFul Services
CBDW2014 - ColdBox RESTFul ServicesCBDW2014 - ColdBox RESTFul Services
CBDW2014 - ColdBox RESTFul Services
Ortus Solutions, Corp
 
Enterprise Java Puzzlers
Enterprise Java PuzzlersEnterprise Java Puzzlers
Enterprise Java Puzzlers
Pavel Grushetzky
 
Streaming twitter data using kafka
Streaming twitter data using kafkaStreaming twitter data using kafka
Streaming twitter data using kafka
Kiran Krishna
 
Stateful patterns in Azure Functions
Stateful patterns in Azure FunctionsStateful patterns in Azure Functions
Stateful patterns in Azure Functions
Massimo Bonanni
 

What's hot (20)

New and improved hacking oracle from web apps sumit sidharth
New and improved hacking oracle from web apps   sumit sidharthNew and improved hacking oracle from web apps   sumit sidharth
New and improved hacking oracle from web apps sumit sidharth
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to Celery
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
React Development with the MERN Stack
React Development with the MERN StackReact Development with the MERN Stack
React Development with the MERN Stack
 
Stateful pattern con Azure Functions
Stateful pattern con Azure FunctionsStateful pattern con Azure Functions
Stateful pattern con Azure Functions
 
NestJS
NestJSNestJS
NestJS
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor model
 
Redux. From twitter hype to production
Redux. From twitter hype to productionRedux. From twitter hype to production
Redux. From twitter hype to production
 
Celery - A Distributed Task Queue
Celery - A Distributed Task QueueCelery - A Distributed Task Queue
Celery - A Distributed Task Queue
 
Metasploit primary
Metasploit primaryMetasploit primary
Metasploit primary
 
Take Control of your Integration Testing with TestContainers
Take Control of your Integration Testing with TestContainersTake Control of your Integration Testing with TestContainers
Take Control of your Integration Testing with TestContainers
 
(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014
(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014
(DEV304) What’s New in the AWS SDK for .NET | AWS re:Invent 2014
 
JRuby最新事情@札幌
JRuby最新事情@札幌JRuby最新事情@札幌
JRuby最新事情@札幌
 
Atomicity In Redis: Thomas Hunter
Atomicity In Redis: Thomas HunterAtomicity In Redis: Thomas Hunter
Atomicity In Redis: Thomas Hunter
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
 
CBDW2014 - ColdBox RESTFul Services
CBDW2014 - ColdBox RESTFul ServicesCBDW2014 - ColdBox RESTFul Services
CBDW2014 - ColdBox RESTFul Services
 
Enterprise Java Puzzlers
Enterprise Java PuzzlersEnterprise Java Puzzlers
Enterprise Java Puzzlers
 
Streaming twitter data using kafka
Streaming twitter data using kafkaStreaming twitter data using kafka
Streaming twitter data using kafka
 
Stateful patterns in Azure Functions
Stateful patterns in Azure FunctionsStateful patterns in Azure Functions
Stateful patterns in Azure Functions
 

Similar to ©️ One of my PROJECTS for MICROSOFT Retail Logistics - Part B

NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
Enoch Joshua
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Codemotion
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express
Jeetendra singh
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
Sebastian Springer
 
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over WebsocketIntroduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
sametmax
 
Proposal
ProposalProposal
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
Mickaël Rémond
 
Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorial
Katy Slemon
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!
Luca Lusso
 
Virus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing GatekeeperVirus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing Gatekeeper
Synack
 
Front-end. Global domination
Front-end. Global dominationFront-end. Global domination
Front-end. Global domination
Stfalcon Meetups
 
Frontend. Global domination.
Frontend. Global domination.Frontend. Global domination.
Frontend. Global domination.
Андрей Вандакуров
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
nirajrules
 
Node.js with MySQL.pdf
Node.js with MySQL.pdfNode.js with MySQL.pdf
Node.js with MySQL.pdf
SudhanshiBakre1
 
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Brocade
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
Daniel Fisher
 
Backtrack Manual Part6
Backtrack Manual Part6Backtrack Manual Part6
Backtrack Manual Part6
Nutan Kumar Panda
 
Wwf
WwfWwf
Roboconf Detailed Presentation
Roboconf Detailed PresentationRoboconf Detailed Presentation
Roboconf Detailed Presentation
Vincent Zurczak
 
Internship msc cs
Internship msc csInternship msc cs
Internship msc cs
Pooja Bhojwani
 

Similar to ©️ One of my PROJECTS for MICROSOFT Retail Logistics - Part B (20)

NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
 
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over WebsocketIntroduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
Introduction to WAMP, a protocol enabling PUB/SUB and RPC over Websocket
 
Proposal
ProposalProposal
Proposal
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorial
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!
 
Virus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing GatekeeperVirus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing Gatekeeper
 
Front-end. Global domination
Front-end. Global dominationFront-end. Global domination
Front-end. Global domination
 
Frontend. Global domination.
Frontend. Global domination.Frontend. Global domination.
Frontend. Global domination.
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Node.js with MySQL.pdf
Node.js with MySQL.pdfNode.js with MySQL.pdf
Node.js with MySQL.pdf
 
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
 
Backtrack Manual Part6
Backtrack Manual Part6Backtrack Manual Part6
Backtrack Manual Part6
 
Wwf
WwfWwf
Wwf
 
Roboconf Detailed Presentation
Roboconf Detailed PresentationRoboconf Detailed Presentation
Roboconf Detailed Presentation
 
Internship msc cs
Internship msc csInternship msc cs
Internship msc cs
 

More from none

IQ_Tests_GiGi_Certificate_2019-09-21.pdf
IQ_Tests_GiGi_Certificate_2019-09-21.pdfIQ_Tests_GiGi_Certificate_2019-09-21.pdf
IQ_Tests_GiGi_Certificate_2019-09-21.pdf
none
 
Ales Vicky's Introduction to Theory of Special Relativity
Ales Vicky's  Introduction to Theory of Special RelativityAles Vicky's  Introduction to Theory of Special Relativity
Ales Vicky's Introduction to Theory of Special Relativity
none
 
©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007
©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007
©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007
none
 
©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...
©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...
©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...none
 
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012none
 
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...none
 
©️ CISCO RMA Service Order Status Business Function
©️ CISCO RMA Service Order Status Business Function©️ CISCO RMA Service Order Status Business Function
©️ CISCO RMA Service Order Status Business Functionnone
 
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Functionnone
 
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logisticsnone
 

More from none (9)

IQ_Tests_GiGi_Certificate_2019-09-21.pdf
IQ_Tests_GiGi_Certificate_2019-09-21.pdfIQ_Tests_GiGi_Certificate_2019-09-21.pdf
IQ_Tests_GiGi_Certificate_2019-09-21.pdf
 
Ales Vicky's Introduction to Theory of Special Relativity
Ales Vicky's  Introduction to Theory of Special RelativityAles Vicky's  Introduction to Theory of Special Relativity
Ales Vicky's Introduction to Theory of Special Relativity
 
©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007
©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007
©️ KANTAR Project Management - All Global Lightspeed Healthcare - 2006-2007
 
©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...
©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...
©️ One of my PROJECTS for MICROSOFT Retail Logistics - SKU_set-up_Best Buy PC...
 
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012
©️ SAP ERP Strategy - One of my PowerPoint Presentations - as of February 2012
 
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...
©️ HTC Smartphones - Qualitative Marketing Research & Customer-Focused Insigh...
 
©️ CISCO RMA Service Order Status Business Function
©️ CISCO RMA Service Order Status Business Function©️ CISCO RMA Service Order Status Business Function
©️ CISCO RMA Service Order Status Business Function
 
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function
©️ Contact CISCO Clients - Cisco Logistics - ContactCustomer Business Function
 
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics
©️ My Own CISCO BRAINSTORMING IDEAS for CISCO Logistics
 

Recently uploaded

Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 

Recently uploaded (20)

Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 

©️ One of my PROJECTS for MICROSOFT Retail Logistics - Part B

  • 1. Remote Access Services – and how to keep a remote access connection to a remote server automatically The following computer programme was developedin Accenture, Prague SDC, in May 2009 as an operational improvement for the whole Microsoft Corporation. It works perfectly. It is a good example of an automation of any daily tasks that we do in any company. It is a macro. A description of a routine: All employees need to log in to the Microsoft corporate network every day via a utility called “IT Connection Manager” to use RAS from a remote node. Remote Access Services (RAS) refers to any combinationof hardware andsoftwaretoenablethe remoteaccess toolsorinformationthattypically reside on a network of IT devices. It refers to the authentication for remotes services access. A RAS server is a specialized computer which aggregates multiple communication channels together. To use RAS from a remote node,youneeda RAS clientprogram, which isbuiltinto most versionsof Windows, or any PPP client software. For example, most remote control programs work with RAS. There were cases when we lost the Internet connectionor RAS connection with corp.microsoft.com server. So,I developedamacro thatI called‘autoRAS’ thatcouldestablishthe lostconnectionautomatically. It should be password protected because the code could well include the password, so viewing the code would defeat the security but it serves its purpose as an example. A very small batch file autoPING.batwastestingthe connectioneverynow and then whethermy PC was connected to corp.microsoft.com or not as follows: @echo off ping corp.microsoft.com >nul if %errorlevel% == 0 goto end @echo No Reply on that IP! start C:Usersv-alvymyDesktopautoRAS.vbs :end start exit Itwasrunninginaloopwhich wassetupthrough WindowsTaskScheduler, forexampleeveryminute. Pingisa computernetwork administrationutilityusedtotestthe reachabilityof a hoston anInternet Protocol (IP) networkandtomeasure the round-triptimeformessagessentfromthe originatinghost to a destination computer. In a case of no response from Microsoftcorporate network corp.microsoft.com, the batchfile would trigger my script called autoRAS.vbs : Set WShell = CreateObject("WScript.Shell") WShell.Run """C:WindowsSystem32rasphone.exe""" Set objExcel = CreateObject("Excel.Application") objExcel.Visible = False
  • 2. Set objWorkbook = objExcel.Workbooks.Open("C:Usersv-alvymyDesktopsku setup macros v2autoRAS_v2.xlsm") objExcel.run "automatic_RAS" So, the script autoRAS.vbs would open rasphone.exe application together with autoRAS_v2.xlsm macro. The VBA macro autoRAS_v2.xlsm would call a subroutine automatic_RAS() as follows: AUTOMATIC RAS CONNECTION – autoRAS_v2.xlsm macro '*********************************************** Note: [1.] We will have to link the dynamic library Windows USER32, which will provide us API interface for calling functions of this library. API prescribes a way of calling functions of a given library from the source code of this macro. The most common standard is API OS Win32 by Microsoft and POSIX(IEEE). Windows API (WinAPI, Win32) was developed by Microsoft for OS MS Windows. All programs, regardless of a programming language, running in MS Windows must communicate through WinAPI (Win32) standard that contains the basic functions. Functions are implemented in a basic system of DLL’s: kernel32.dll, user32.dll, gdi32.dll. Note [2.] We have to install the MSVC Spy++ software or WINSPECTOR SPY and detect the names of classes in the running instances of windows and processes, names of buttons… '******************************************************************* Option Explicit Const BM_CLICK = &HF5 Const WM_CHAR = &H102 '******************************************************************* '*********** API functions declarations *************************** '******************************************************************* Private Declare Function FindWindow Lib "user32.dll" _ Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Declare Function PostMessage Lib "user32.dll" _ Alias "PostMessageA" _ (ByVal hWnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, lParam As Any) As Long Private Declare Function SendMessage Lib "user32.dll" _ Alias "SendMessageA" _ (ByVal hWnd As Long, _ ByVal Msg As Long, _ wParam As Any, _ lParam As Any) As Long Private Declare Function FindWindowEx Lib "user32.dll" _ Alias "FindWindowExA" _ (ByVal hWnd1 As Long, _ ByVal hWnd2 As Long, _ ByVal lpsz1 As String, _
  • 3. ByVal lpsz2 As String) As Long Private Declare Function SetFocusAPI Lib "user32.dll" _ Alias "SetFocus" _ (ByVal hWnd As Long) As Long Private Declare Function SetForegroundWindow Lib "user32.dll" _ (ByVal hWnd As Long) As Boolean '******************************************************************* 'Now that the API and Variables are set up, it is time for the rest of the code '******************************************************************* Sub automatic_RAS() Dim my_NTConnWindow, my_ITConnMgrWindow, my_buttonA, my_buttonB As Long Dim my_Connect_ITConnMgrWindow, my_buttonC As Long Dim my_editBox As Long Dim PIN As String Dim i As Byte '*** Calling API Function my_NTConnWindow = FindWindow(vbNullString, "Network Connections") '*** Calling API Function Call SetForegroundWindow(my_NTConnWindow) 'If egFindWindow <> 0 Then 'e.g. we can also close the window like this &H10 ZAVRE OKNO: 'Messages = PostMessage(egFindWindow, &H10, 0&, 0&) 'End If '*** Calling API Function my_buttonA = FindWindowEx(my_NTConnWindow, ByVal 0&, "button", "&Connect...") '*** Calling API Function Call SetFocusAPI(my_buttonA)
  • 4. '******** Calling API Function ********** Call PostMessage(my_buttonA, BM_CLICK, 0&, 0&) 'pozn. SendMessage also hits the Connect.. and pops up IT Connection Mgr 'but fails to stop itself and is still running like in some loop? '*** Calling API Function, all over again for the next IT Connection Mgr Win Application.Wait (Now + TimeValue("0:00:03")) my_ITConnMgrWindow = FindWindow(vbNullString, "IT Connection Manager") 'Call SetForegroundWindow(my_ITConnMgrWindow) Application.Wait (Now + TimeValue("0:00:03")) my_buttonB = FindWindowEx(my_ITConnMgrWindow, ByVal 0&, "button", "Connect") Application.Wait (Now + TimeValue("0:00:03")) 'DoEvents 'Call SetFocusAPI(my_buttonB) Call PostMessage(my_buttonB, BM_CLICK, 0&, 0&) 'mozny zpusob: 'Call PostMessage(my_buttonB, WM_LBUTTONDOWN, 0&, 0&) 'Call PostMessage(my_buttonB, WM_LBUTTONUP, 0&, 0&) Application.Wait (Now + TimeValue("0:00:03")) my_Connect_ITConnMgrWindow = FindWindow(vbNullString, "Connect IT Connection Manager") '*password my_editBox = FindWindowEx(my_Connect_ITConnMgrWindow, ByVal 0&, "edit", "") my_buttonC = FindWindowEx(my_Connect_ITConnMgrWindow, ByVal 0&, "button", "OK") 'DoEvents 'Call SetFocusAPI(my_buttonB) PIN = "112233" For i = 1 To Len(PIN) Call PostMessage(my_editBox, WM_CHAR, Asc(Mid(PIN, i, 1)), 0&) Next i Call PostMessage(my_buttonC, BM_CLICK, 0&, 0&) End Sub