I would like to start a powershell script1 (change the name of the PC): 

1) before windows 10 boot ( preferable) or
2) at the first run (just once)

I prefer the first option but I couldn't find a way to do it. 

About the second option I have tried using a bach file with the commands below in startup folder:

PowerShell -Command "Set-ExecutionPolicy Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1 
PowerShell C:\Users\<user_name>\Desktop\script.ps1 >> "%TEMP%\StartupLog.txt" 2>&1
I located it in start 
C:\Users\admin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
to execute the powershell file at the first start but it didn't work. If I run manually the powershell file works fine.

Thanks
1 Comment   [ + ] Show Comment

Comments

  • How are you deploying your image? Are you using a scripted install?
Please log in to comment

Answers

0
Thanks Chucksteel,
I am few days in my new job position and unfortunately I don't have in loco any useful software or tools that make my job easier. I was not prepared to be honest.
At the moment I am using the on house system...that is: prepare the machine cleaning it with sysprep and later using clonezilla to create the master image and later on with the same software (server option)  push the multicast deployment.

Once done that I wish with my first logon the script start automatically and rename the machine.

PS:If you know a better software or way please advice me because I really need HELP ;) 
Answered 11/16/2017 by: epulone
White Belt

Please log in to comment
This content is currently hidden from public view.
Reason: Removed by member request
For more information, visit our FAQ's.

0
Use MDT. It is free and way more flexible than clonezilla.

It can do everything you wanted in the question and that too without wiring code.
Answered 11/28/2017 by: nagendrasingh
Third Degree Blue Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share