Handling UAC prompts when doing UIAutomation - ui-automation

Is there a way to access the UAC prompts via UIAutomation (I'm writing a test for an installation process).
From http://msdn.microsoft.com/en-us/library/ms742884.aspx it looks like there is a way to set this up.
So the question is how to make this automatically?
My current UIAutomation setup is made of the amazing White API (white.codeplex.com) with a bunch of extension methods from the O2 Platform

For security reasons, this is guaranteed to be impossible.
The whole point of UAC is that programs cannot automatically click Allow.

Not exactly the answer you'd have liked but a workaround based on SLaks's answer (Thanks #SLaks for answer) i.e. for security reasons Windows wouldn't allow automated clicks on the 'yes'. In that case if bypassing is the only option we could have same effect as elevated prompt and clicked yes by setting "UAC: Behaviour of elevation prompt for administrators in Admin Approval Mode" to 'Elevate without prompting' in security policy. I tried this in my automated tests and they are giving me same effect as clicking 'yes' on that prompt if it was prompted. Of course it isn't prompting since I've changed that option.

Related

Allow Safely Remove Media in GPO

I have a system that I want to lock down, only running certain programs.
All is working so far when I use "Run only specified Windows applications" (under Local Computer\User Configuration\Administrative Templates\System) except when I try to add an option to remove media.
I have the policy enabled with a list of all applications I want to be able to load. And this: "rundll32.exe shell32.dll, Control_RunDLL HotPlug.dll"
but when I run my shortcut for this I just get the error "This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator"
I saw someone online with a similar problem with rundll32.exe but that was with a printer and they got it working by adding a printui.dll. Am I missing something or doing something wrong or is this not possible? I need this option because I have to disable right click in our locked down system.

Start batch through powershell without getting asked for administration rights

Is there a way to start a batch file with administration rights using Powershell? (I mean in a way that you won't have to click a yes start thing that pops up.)
If you
Disable UAC, or
have PowerShell already running with administrative privileges
The entire point of UAC and selective elevation is that it's a noticeable action.
you can set variable __COMPAT_LAYER=RunAsInvoker (though it will give you no admin permissions for some operations pop-up will not appear) or disable UAC

TeamCity Use Credentials of User Currently Logged In

Here is my problem. I have a build step in TeamCity that fires a powershell which updates a configuration parameter in another TC sub-project and resets the build counter via an API call. To do so, I have to pass valid credentials, which I am setting up as a parameter to be entered when the a custom build is run. This works great, however, for some reason if the password is typo'd even once(and I am using TC's password type parameter so it is masked, making this easy to do), the user's windows account is locked immediately. I assume this is something TC is doing to send the request multiple times, but regardless of why it is happening and is obviously not ideal.
The most ideal solution would simply be able to run the build using the credentials of the user who is kicking it off. So far as I can tell, there is no 'Run As' option, so is there a way for me to retrieve and use the password of the current user logged in to TeamCity, perhaps as a system variable? I've read through the documentation and have not had any luck finding what I need. Maybe there is a way to do this through powershell?
Any ideas/suggestions would be greatly appreciated.
JetBrains is working on https://github.com/JetBrains/teamcity-runas-plugin
I hope it will appear soon

Does install4j provide a *Completely* unattended auto update?

We are currently evaluating install4j and things are going pretty well, however I have a question about auto-update.
Currently I see options and documentation around 3 options for auto-update and the third one (no version check) seems
to be the closest to what we need. However it sounds as though it still prompts the user to actually start the download/install. Is there
any way to get around this? We are targeting our software as a service on many windows boxes in a server room, so there isn't a user
to click continue for that last step. I believe we can roll our own service to monitor for upgrades that will do a command line
install with an answers file to prevent prompting, but I'd love to know if I missed something that would allow me to utilize
install4j's auto-update.
When you go to Installer->Screens & Actions, click on the "Add" button and choose "Add application", you can choose from a number of pre-defined templates. However, they are just templates and after adding them you can change them completely.
If the updater should be automatic but still show a progress dialog, you can just set the "Default execution mode" property of the updater application to "Unattended mode with progress dialog". In that case, no screens will be shown at all.

Is there a way to automatically log onto a Windows XP machine at specific time?

How to set a specific logon time for a specific user on Windows XP?
For example, the computer is an "always on machine" and most of the time no one is logged on. I want to set a time for my user to log on, without someone actually having to be in front of the machine. I've tried a workaround with the built-in auto logon function (control userpassword2), but I still need a secure system as I'm not the only user, and would still want a password even if I was the only user.
I have searched for third party software, but to no avail. I've a good knowledge of batch and Python scripting and a little of Java, so any pointers with any of those would help.
How can it be "secure" if it logs you on without you being there? Surely it would be better for it to wait for you to type in a password (i.e. the login prompt)?
If you want a fast "startup" time, then you can lock the workstation (ctrl+alt+del to open the Task Manager and then click 'Lock'. This shows a dialog just like the login prompt, but when you enter your password you instantly continue your existing session). Or if you want to be more eco friendly, put your PC into Sleep mode, which most PCs will return from (again with an optional password prompt) in less than 5 seconds.
One way I just thought of: Run a Vnc Server, and hack into an open source viewer program. Then you can rig it with some code to pass keyboard commands back into the computer, maybe implement some screen scraping to make sure it only does it when appropriate.
But seriously, there has to be a better way. Why are you trying to do this?