lifert.blogg.se

Silent start ps script
Silent start ps script




silent start ps script

ArgumentList '-noprofile -command &'Ĭonfirm the User Account Control window "Do you want to allow this app to make changes on your computer." by clicking Yes. Start-Process Powershell.exe -Credential $cred ` Start another PowerShell instance with these stored credentials and the following parameters with Start-Process: Well, here´s the work-around!Īfter the sign-in we have the credentials available in the $cred object. So this is simply not working although it should. See issues at, on github or, or try it out on your local machine.).

silent start ps script

SILENT START PS SCRIPT WINDOWS 10

Unfortunately, there seems to be a bug in Windows 10 and the new PowerShell window freezes (or reacts only after some waiting time and very slowly, you cannot type anything. Note: The straight forward process would be to open a new PowerShell window as that user with the command " Start-Process powershell.exe -Credential $cred". Sign-in with a local user or a domain user and the password. $cred = Get-Credential -UserName 'DOMAIN\USERNAME' -Message ' ' Ask for the user´s credentials as follows: Method 2: Run a PowerShell script as a different user interactively If you just need to run a PowerShell script interactively, you can do it as follows as well. Beside the simple configuration, another benefit is that the script execution can be logged in the History. Alternatively, you can run it anytime in the context menu of that task. The task will execute the script at the configured time as the user who was specified in the task properties. When clicking OK, add the username and the password. Configure the execution as needed, similar as here. Here, I added another local user "Demo" of that machine. Then, add the desired credentials by clicking the Change User or Group button.

silent start ps script

In the Finish step, ensure that the checkbox Open the Properties dialog. When you start a PowerShell script, do it as here: Run PowerShell (or ps.exe) and add the script file with -file as argument. The first method is to create a new basic task in Computer Management / System Tools / Task Scheduler / Task Schedule Library.Ĭreate a New Basic Task and add the desired task with it´s options. Method 1: Run a task as different user with Scheduled Tasks You can easily do this using the following two methods. for reading file shares as a different user with different permissions or similar tasks. Sometimes it´s required to run a script as a service user on a Windows machine, e.g.






Silent start ps script