App installation(?) being blocked on user's Win10 machine, Get-WmiObject - powershell

We have a small custom data-conversion application developed in .Net+WinForms. We distribute it as a ZIPped .exe, no installer or anything. One of our customers is having the installation blocked. None of the other users at the same company are having any problems.
The error is a screen snap from an unidentified app and I'm typing this in, forgive any fat-fingers. It says the category is "script", and the details are:
Script Command: if (Get-WmiObject Win32_USBControlerDevice...
Googling that, it seems this is part of a PowerShell script? Can anyone offer a reason this might be happening? Perhaps part of unzipping or some other process? Does Window's own security check run scripts perhaps?

Related

How to fix msedgewebview2 error in VS2022 when admin?

I have installed the relatively fresh Visual Studio 2022 on a Windows installation. The work I do often requires administrative privileges (local IIS). To do this I have two users, one 'normal' account that is logged in to Windows and one administrator account. When starting VS2022 with the administrator account, an error keeps coming. It happens especially during debugging and it reads as follows:
Microsoft Edge can't read and write to its data directory:
C:\Users\<administrator_user>\AppData\Local\Temp\VSWebView2Cache\<guid>\EBWebView
What appears to happen is that Microsoft Edge WebView2 (msedgewebview2.exe) is running as the user that is logged in to Windows, while trying to write temporary files for the administrator user where it does not (and should not) have write or read access.
Here we can see the process details that says the application user is the logged in user and not the administrator:
Does anyone know how to fix this issue?
The error happen even when I run debugging on a .net 5 console application. In that particular situation I don't see why it needs to run anything in a WebView instance, but apparently some background process is running something anyway. Is this something that can be turned off?
My best solution so far is to create a shared folder.
I decided to make C:\Users\<administrator_user>\AppData\Local\Temp\VSWebView2Cache\ shared. The "VS" prefix indicates that this is a Visual Studio-specific folder, and I think it is acceptable that my normal user can have access to that folder as it seems to contain temporary Visual Studio files.
To do so I logged in to Windows with the administrator account.
I navigated to the folder and made it a shared folder. I added my no-admin user with "Read/Write" privileges.
I then tested by logging out of the admin account and into my no-admin account. There I first tried the full path in File Explorer and was granted access to the folder. I then tested with VS2022 and during debugging no error box appeared and files were generated in the folder.
If anyone finds a better approach, I'd really like to hear about it. Also if you have knowledge to why this approach is either good or bad, that would be highly appreciated as well.
I only had to create the folder "VSWebView2Cache" with my normal Windows account and after that it worked.

Windows 10 application issues. Start and Cortana freeze

Recently forced upgraded to windows 10 by microsoft. Windows Start and cortana froze. Searched google and from powershell ran
Get-AppXPackage -AllUsers | Foreach
{Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Now lot of my windows application have disappeared. They show up with #{AppPackageName} in taskmanager or when searched using cortana for example #{Microsoft.ZuneMusic_2019.6.15131.0_neutral_~_8wekyb3d8bbwe}. I can not remove these app using any command like
Tried to install store app manually and get error Merge Failure : error 0x80070003 : Cannot register the Microsoft.WindowsStore_2015.21.25.0_x64__8wekyb3d8bbwe package because there was a merge failure with the following file: C:\Program Files\WindowsApps\Microsoft.WindowsStore_2015.21.25.0_neutral_split.scale-100_8wekyb3d8bbwe\resources.pri
Full log below:
Now I understand that store app is not getting add because add process is causing error or merge failure with another package (?). The problem is get/Add-AppxPackage are resolving dependency of application with package-version: Microsoft.WindowsCalculator_10.1510.13020.0_neutral_split.scale-100_8wekyb3d8bbw‌​e
AND/OR
Microsoft.WindowsCalculator_10.1510.13020.0_neutral_split.language-hi_8wekyb3d8bbwe
My laptop c:\program files\windowsapp only has Microsoft.WindowsCalculator_10.1510.9020.0_neutral_split.scale-100_8wekyb3d8bbwe (not diff in version 13020 and 9020). Note: The version no on app is 13020 but dependent package on drive is 9020.
Second package is missing from drive (Microsoft.WindowsCalculator_10.1510.13020.0_neutral_split.language-hi_8wekyb3d8‌​bbwe).
How to get my calculator and windows store application back.
<1>Create a new user account and Log into the new account
<2>You can also try
Running the System File Checker by running
sfc /scannow
Download files from Windows Update to replace the corrupt ones by running
DISM /Online /Cleanup-Image /RestoreHealth
You may try the following, at your own risk.
I had the same issue after trying to reinstall the apps via that powershell thingy. Fixed it and returned the apps to their out-of-box state by first wiping everything from C:\Program Files\WindowsApps and C:\Users*\AppData\Local\Packages and then reinstalling Windows over itself from the tech bench ISO (from under Windows and keeping "traditional" apps and files in place, of course). I had to use the ISO because the media creation tool wasn't cooperative at all, throwing some error at me. Just in case, the aforesaid wiping didn't cripple the vitals like the immersive control panel or something else, just the typical no start menu/dead modern apps/no right click on the taskbar items.
By the way, the whole problem started after the 1511 update. Modern apps would refuse to remember their settings, and windows shell experience host would freeze for no reason, taking the start menu and things like volume control with it. I've had this Windows installation for a couple of years now, and the system has gone pretty smoothly through the 8.0-8.1-10 update process over that time, but that 1511 screwed something big time.

Launch local PowerShell script from link in local browser session

My boss has asked me to look into launching a PowerShell script I've written (which is to be deployed to all users desktops) when the user clicks on a link in their web browser (and not by the clicking on a desktop icon as I've proposed). I did not think this was possible for security reasons and can't understand how this can be done. Does anyone know if this is possible ? i.e. a web link can somehow trigger the running of a PowerShell script held locally on the user's machine? Seems dangerous to me but he says it can be done !!!
No, it won't automatically run a linked script and will require the user to download and then run it.
The way to accomplish the goal of running a script when they click on something, though, would be to do it with server-side code that launches the script remotely or creates a scheduled task on the user's system. However, this may not work if the user needs to see the command window or interact with the script.

How to run scheduled Coded UI Tests on Virtual Machine without having a RDP connection

Situation in short:
Virtual Machine with Visual Studio 2013 installed. PowerShell script
runs on the VM to execute Get Latest, Build and Execute Coded UI
Tests. Windows Scheduled Task to execute PowerShell nightly.
auto-logon is enabled (or I'm doing something wrong?)
yes, I've read post Is it possible to run Coded UI tests without having to connect via remote desktop?
I've seen posts about TCM. Does this help and how can I use it in my
situation?
I made some tests in Microsoft Test Manager and I also executed and recorded them.
I've loaded these tests in a test project (and changed the script providing categories and custom checks).
I then categorized these (as Development or Acceptance).
I executed out using a PowerShell script on a VM (with Visual Studio 2013 installed) with following actions:
Get Latest
Build
Run latest build with a selected set aka category using mstest.exe
So far everything is going perfectly. All the tests pass.
However, when I create a Scheduled Task on my VM run the PowerShell script everything fails because of a missing session.
Do I have the VM (I have no knowledge of Virtual Machines) then unlock or something?
Side-Note:
I also tried to fix this with a Test Agent and Controller, but once I had installed these, all other users of TFS lost their rights, so I prefer not to do this again.
I would be very grateful if you know something that can solve this.
I spent hours on Google finding a solution for this issue, but no solution helped me.
Do I need to provide more information?
The problem you're seeming to have is that the testagent is not setup correctly. You need an active desktop session for Coded UI to be able to run (it needs it to perform all the actions such as clicks).
Microsoft has some nice info about setting up your test agent here.
But to tackle your exact problem of the test failing because of a missing session I'd suggest the following:
Run AutoLogOn.exe from the sysinternals suite (can be found at http://live.sysinternals.com/). It will automatically log in with specified user when the machine starts, and keeps the desktop session active.
Alright...I'm making progress.
I've installed test agent and controller. It's all running fine.
Next I've opened Lab Center on my own MTM to create a new environment.
Test Controller is found, but I receive the message in this post "Microsoft Test Manager cannot install test agent on these machines" when creating new Lab Center environment
File and Printer sharing exception is enabled. I don't get the other message.
I don't understand what is wrong.
Maybe I'm completely on the wrong track and it's not necessary to use the Lab Center.
Then the only remaining issue is the non-active desktop issue.

Windows 7 - Eclipse now needs me to run as administrator

I installed Eclipse (Kepler) on this W7 64-bit machine and initially I could run it "normally" by just clicking the desktop icon or whatever.
Then I replaced the whole "workspace" directory with one from another machine (because I'm changing systems).
Now if I run Eclipse not "as administrator" it opens and will even run apps... but nothing can be saved, including changes to files and updates to the .metadata of any kind.
I changed all the "ownership" and "permissions" which could possibly be involved. I am the only user of this machine, and I am in the administrators group. I CAN still use it, if I run "as an administrator". But I'm stumped why the UAC should have been happy to run Eclipse before without the "as 'strator" but now refuses...
Because... what I've understood about this question is that the UAC looks at apps and decides whether or not they look dodgy and on that basis decides whether you have to run "as 'strator". So what's changed?
I have the option of uninstalling Eclipse and reinstalling it, and then incrementally adding the various project folders... fine, it may work. But I like to understand these things as far as is feasibly possible!
Because... what I've understood about this question is that the UAC looks at apps and decides whether or not they look dodgy and on that basis decides whether you have to run "as 'strator".
UAC doesn't do anything like that. UAC is an ability of Windows to run an application as an administrator. There are three four ways an application can be run as an administrator (causing the UAC consent dialog to appear):
you right-click the application and select "Run As Administrator"
the application has been manifested with a requestedExecutionLevel of requireAdministrator
the application has a filename that looks like a setup application (e.g. setup.exe, install.exe, update.exe), in which case the Shell opts to run it elevated just in case
you call ShellExecute with the runas verb.
i think there's one of two things happening:
you missed a spot, in which case you should use Process Monitor to look for Access denied errors
you tried copying files to a protected location (e.g. Program Files) and they were instead redirected to:
C:\Users\Mike\AppData\Local\VirtualStore\Program Files(x86)\Eclipse
And then when you run Eclipse, the files are not there.
Again, use Process Monitor to find where Eclipse is looking for what.