Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

NEW Running script on first logon using SCCM

  • Thread starter Thread starter atkinspd
  • Start date Start date
  • Replies Replies 4
  • Views Views 6K

atkinspd

Member
Messages
7
Reaction score
0
Points
1
We have a number of rigs (Small Windows 10 PC's) configured to go into plant equipment. These RIGs once built with a basic Windows 10 image require a script to run to complete the process. The script works if I elevate powershell ISE and run the script by copying and pasting. I would like to automate this in SCCM to run the script on the first logon as the user, removing the need of user intervention as we are constantly rebuilding the RIGS.
This script will only need to run the once completing the setup of the RIG. Does anyone know the best way to do this using SCCM?
 
We have a number of rigs (Small Windows 10 PC's) configured to go into plant equipment. These RIGs once built with a basic Windows 10 image require a script to run to complete the process. The script works if I elevate powershell ISE and run the script by copying and pasting. I would like to automate this in SCCM to run the script on the first logon as the user, removing the need of user intervention as we are constantly rebuilding the RIGS.
This script will only need to run the once completing the setup of the RIG. Does anyone know the best way to do this using SCCM?
why not use GPO ?
anyway you still can use SCCM by deploying the script to user collection and mark it run once per user. it will run with system account so no need for user intervention of course depening on the script
 
Thanks for your response.
The problem with using GPO, to my knowledge; these small PC's follow a specific naming convention. We currently have 700+ across the site, that all start with PFLIMV or PFLRTO. If I setup a GPO to target those two names including a wildcard PFLIMV*, it will modify the existing rigs, instead of the new builds only. Would you agree?
 
Create a Package/program you can set it up to run once per computer.
 
Thanks for your response.
The problem with using GPO, to my knowledge; these small PC's follow a specific naming convention. We currently have 700+ across the site, that all start with PFLIMV or PFLRTO. If I setup a GPO to target those two names including a wildcard PFLIMV*, it will modify the existing rigs, instead of the new builds only. Would you agree?
I think I understand why you cant achieve this with a package or application. if you have a specific collection for new builds then Garth suggestion will work but if you dont have a specific collection for new builds then create a file anywhere on the new system. under c:\ or c:\windows at the end of your task sequence for those new builds and call it lets say atkinspd.txt. In the script that will run with GPO check if the file exist or not then run the script accordingly.

if ((Test-Path "C:\atkinspd.txt"))
{
your script here

}
 

Forum statistics

Threads
7,142
Messages
27,884
Members
18,176
Latest member
Omega

Trending content

Back
Top