Check if Windows virtual machine is in use [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 months ago.
Improve this question
In my organization we are using virtual machines that are running UiPath RPA processes. In UiPath Orchestrator it is visible in case a process is running via Orchestrator on the virtual machine.
It is also possible to log into the virtual machines manually, via Remote Desktop Connection. The issue now is that sometimes when an RPA developer is manually logged in to the virtual machine, another user is starting a process from Orchestrator that is using the same machine. This will result in the person manually logged in to the machine being thrown out.
I am trying to come up with a way to detect if a user is already logged in to the machine, and somehow check this before any process is started.
I have experimented and created two batch files that I scheduled via Windows Task Scheduler. The batches create a file in a network drive when a user is unlocking the remote machine, and delete the file when the remote machine is locked.
My issue now is that I would somehow need to check if this file exists before starting any process via Orchestrator. So it cannot be done via UiPath, because this would immediately connect to the machine and throw out the other user.
Anyone who has had some similar problem and solved it?

Try a simple approach
Check who are already logged in
Query user /Server:MachineName
This will provide a list of users connected to that Host
Now you / Bot, can send out a message ( Msg ) to the respective user to save his work and logout
Both ( query & msg ) are available by default on Windows OS
Code your Bot so this action is performed prior you start your automation
Links
learn.microsoft.com/en-us/windows-server/administration/windows-commands/query-user
learn.microsoft.com/en-us/windows-server/administration/windows-commands/msg

Related

Delete old entries of the event-log with PowerShell or CMD? (Not all of them | With period of time condition) [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last month.
Improve this question
Please take a look at these two threads :
how-to-clear-eventlog-with-powershell-or-wevtutil
delete-old-entries-of-the-event-log-with-powershell
Some days ago some body stole my password of wi-fi and connected to it.
After connect he hacked my windows 7 pc through home network.
Something is so strange for me.
After hack he deleted all wi-fi logs for two moths ago.
I never do that because i even did n't know there is a wi-fi log in my pc.
Check here for wi-fi logs & it's location
How is that possible because people say you can't delete event logs in period of time by command.
Just tell me how could he do that?
Does he have GUI access to my pc?
I am so confused because of this action?
Almost anything is possible if you have administrator rights on a machine
There is no built-in function to delete only certain logs, but one example way to do this is simply export all logs except the ones you want, then replace the original log file with your filtered log. The built-in wevtutil can do this pretty easily:
# filter out events on 2022-05-11
# export to test.evtx
wevtutil epl Application test.evtx "/q:*[System[TimeCreated[#SystemTime<='2022-05-13T23:00:00.000Z' and #SystemTime>='2022-05-10T04:00:00.999Z']]]"
That aside - Windows 7 stopped receiving security patches in January of 2020, so consider upgrading your operating system for the future.
If you think that person could still have access to your computer, then your best action is to is to wipe it and start over. A computer repair service should be able to help you do this and keep your important files.

OverTheWire wargame server "added as a known host"? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have been using OvertheWire terminal coding wargame and i have accedentally
ssh'ed the server and it said in the describtion that i there is no ssh.
this message appeared
Permanently added 'natas0.natas.labs.overthewire.org' (ECDSA) to the list of known hosts.
what should i do so im not a host and what does it mean that im a host?
A "host" in this context means server, and it's talking about the server you were connecting to, not your machine.
On your machine, there is a file called known_hosts. This contains the ssh "fingerprints" of every server that you have connected to.
The first time you connect to a new server, ssh records the fingerprint. This is important, because it means ssh can detect someone spoofing the server in the future (by warning you that you are connecting to a different server from last time). Typically, users see this warning when the server is upgraded or moved to a new datacentre, rather than when something untoward is happening.
Your message is just saying that your ssh client has recorded the server fingerprint to allow you to check that you're connecting to the same server the next time you ssh to it. My guess is the server that you connected to accepted your ssh connection, but used it to print a message saying that ssh was not available.
If you want to remove the fingerprint from your system, you can can open that file and remove the line that describes the wargame server. However, I doubt there is any risk from keeping the fingerprint.
If you want to do this this:
On a mac or a unix/linux system, the file will be in ~/.ssh/known_hosts. Open it up, remove the line that describes the wargame server, and then save the file.
On a windows machine using putty, you will need to edit the registry to remove the hosts:
Open up ‘regedit.exe’ by doing a search.
Navigate to HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys
Delete the host key for the wargame server.

Clone Active Directory Domain Services [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have a Azure VM running Win server 2012 r2 datacenter. I have installed Active Directory Domain Services Role onto that VM. Now i want to Clone it with the same ADDS settings to create new VMs.
I tried Sysprep, but later i found out that sysprep doesnt support ADDS.
Is there any possible way ?
Thank You.
You can't. You have to install and promote each domain controller in your forest.
However, using powershell + Azure Custom Script VM Extension you can automate the process.
Custom Script extension for Windows allows you to run PowerShell
scripts on a remote VM, without logging into it. The scripts can be
run after provisioning the VM or any time during the lifecycle of the
VM without requiring to open any additional ports on the VM. The most
common use case for Custom Script Extension include running,
installing, and configuring additional software on the VM after it's
provisioned.
More info:
Custom Script extension for Windows virtual machines
Step-by-Step: Auto-join a VM to ADDS in the Azure Cloud

Make Windows start a .exe at booting fast [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I bought a notebook recently and will give it to someone else on their birthday. That person, however, is not good with computers yet and so I wanted to create a full-screen app that would introduce them to the computer. The app works perfect, the thing is just that I need it to start when logging in to their account (just once, too, obviously).
I know there's a folder in which you can place executables that then will be executed at login, however, that is simply not fast enough.
When the PC boots and the automatic login is done, the desktop is shown for about 3 minutes until the full-screen app finally opens (the laptop is not really a powerhouse tbh though).
How can I make it open the app faster? Or could I maybe make Windows not start explorer.exe until my app is open? Thanks.
(OS is Windows 10)
There are multiple ways to do this.
One is by using registry. You can add necessary registry entry under:
HKEY_CURENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
This would run your application right after the user logs in.
Another one would be to create a new task through Task Scheduler:
When creating tasks you have lots of option to control when it starts. You can start it at log-on of specific user, you can start it even before user log-on so you can explain the user of how to properly log-on to the computer, etc.
You can also control if this task is executed once or every time.
I personally would go for second option as it does not require any manual registry editing and therefore it can be setup even on non-administrative account.
You can change the registry to accomplish this.
You can modify the "Shell" key at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
to the full path of your program.
This should replace explorer.exe and your program should start "explorer.exe" and set this registry's value back to "explorer.exe" after it's started.
References:
How can I start up Windows without explorer loading up?

Cannot remote desktop into Windows Azure VM [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I am running a trial of Windows Azure and setup a simple Windows Virtual Machine. However, I do not seem to be able to use the Windows Remote Desktop connection to remote into the machine. What am I doing wrong? At first sight it does not seem to like my userID and password. But then I also cannot ping the VM address. I do not want to go through VS or any other tool, I like to do a simple remote desktop connection through the Windows RMD tool.
Can you check that port 3389 is open in your VM? This port is normally used by remote desktop? You can check this from Virtual machine->Endpoint section within new azure preview portal. if there is no port defined, you will have to create new one.
It could be that the port is blocked, Azure VMs default to port 52137, in your endpoint settings alter this to the regular port 3389 - this worked for me.
Freddy, would u please confirm first if your Windows Azure Virtual Machine is running or not and this you can confirm by looking at Preview Portal. I have seen some cases when the VM does not start first time and you would need to restart it first time.
So if VM is not running then please start it from the portal directly or even if it shows "Running" start please restart it again.
There are a few troubleshooting steps described below so please follow them:
http://social.msdn.microsoft.com/Forums/en-US/WAVirtualMachinesforWindows/thread/9c88a364-c3eb-41aa-a6b0-3ceae00491c2
If none of the above steps resolve your problem go ahead and report this problem to same forum and you will have direct assistance from Windows Azure Virtual Machine team.
RDP to a new VM with the RDP "endpoint" setup does not work by default for security reasons.
You need to get the RDP certificate or the .RDP file from azure.
click on a running VM and click "Connect" in the control panel at the bottom, this will download the .RDP file that contains the certificate, enter user name and password and away you go.

Resources