I have a host machine with Hyper-V enabled, and I have a Hyper-V guest running on this machine. Becauze I can't drag&drop files to the VM, I wrote a script to do this for me, which is integrated in TotalCommander, and which uses Copy-VMFile.
My problem is that the PS script works only if I run it as admin, otherwise I get the error "You do not have the required permission to complete this task."
Why do I need admin to copy from the host machine to the guest OS? And is there a way, some policy which would allow me to circumvent this? It is annoying to enter a password every time I want to copy some files.
Related
I need to use my local computer to simulate a test stand which will be on a domain and access a remote computer which is on a workgroup using PsExec. The testing computer is built from an imaging tool. The IP will be the same every time but the name isn't. The process I'm working with was used on an embedded XP system and is now being upgraded to WIN10. I've added network security using GPO and have found workarounds to be able to open the connection but for some reason just trying to run cmd on the remote machine does not work when using the IP, only the name. Using the IP returns the "access is denied" error. I have already added the token filter key to the registry. Has anyone heard of something like this before?
I have a script I'm trying to run but in the meantime I'm just trying to get
psexec \IP_ADDERESS -h -u USER_NAME(this is an admin) -p PASSWORD cmd
edit: I have to keep my computer on a domain but I have a spare that I was able to put on a workgroup with the test system. Running psexec went perfect. It makes no sense why it works for the name and not ip on a domain->workgroup connection and works exactly how I need it to on a workgroup->workgroup connection.
I have two remote PC's that are being used to execute some powershell scripts, one is windows 7 and one is windows 10. Occasionally (if a reboot needs to happen) the scripts require admin privilege. On the windows 7 remote PC it always runs powershell as admin so it works fine. However on the remote windows 10 PC it does not, stopping the program from executing. What I need to know is how to get the remote windows 10 PC to run powershell as admin by default, anytime a powershell script is run.
I know this is possible because on a separate PC I've used powershell always opens in admin, but I've searched through the settings and can't figure out why.
Any help would be appreciated,
Thanks
If you fully disable UAC by changing the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Value: "EnableLUA"
to 0, it will default run all programs (including powershell) as admin
I have a script to assign static IP address to HyperV VM's whenever it found 169.x.x.x series IP,and the script start work when we logged in to the machine as Administrator.
Is it possible to run the script while machine booting ? So that, we don't need to log in to the VM's to run the script ?
You don't give us any information about your deployment process. But you could essentially use the SetupComplete.cmd. Run your PowerShell script from there.
See Add a Custom Script to Windows Setup.
I have a linux machine with Jenkins installed on it. It executes variety of different jobs on other linux machines.
Now - I would like to connect to a Windows machine and execute a PS script. Is it possible to do that from the Linux Jenkins by installing PS plugin (note that I do not want to execute a PS script on a local linux machine but execute all that on remote hosts)? If not, what is the proper way of doing that?
Yes you can run jobs on slave windows machine with Linux master.
Add windows machine as a new node(slave), give it a distinct label. The following link can help you in adding new slaves (https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines)
Go to job where you want to run PS script on windows machine and check the option "Restrict where this project can be run". Enter name of your windows machine label here.
To execute all jobs on remote machines, you can give all of them a separate label and use the step 2 to only use them for your jobs.
To execute job on local host you can enter "master" in the restrict run editbox.
I am facing a very strange issue trying to run a Remote PowerShell script from the new build system of Visual Studio Online.
Context:
I have a Build server that I host on my own VM. I have also created a second VM where I want the PowerShell script to be run on.
When I run a build from the Build server, I want to create a task that run a PowerShell script on a remote machine. Sounds easy.
Both machines have everything configured to run the Remote PowerShell. (I think)
Problem:
If I manually run the script from the build server, the script is properly executed on my remote machine.
But, if I run the script by starting a new build, it doesn't work, I always get an error message
New-PSSession : [xxx.cloudapp.net] Connecting to remote server xxx.cloudapp.net failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
Have you faced this issue before with VSOnline?
This can happen if there isn't a trust relationship between the remote machine and the build machine. E.g. you could look at the hosts.equiv file on the remote machine and make sure it trusts the build machine.
If that doesn't help then more info might be needed, like how you're trying to sign in, what build agent account you're running as.
Guy