I have Windows OS image advertised in software center which I can manually hit install that reimages the system and does other configuration afterwards. I would like to automate the execution using Powershell. I am able to do do for other advertised software like notepad++, chrome, and software updates but not to OS image. Is there any way automate it at the client side using Powershell or any other script? I do not have SCCM access to push the task sequence. Thank you
-
First thing, we have sccm module for PS. But for that you need to have SCCM. I am not sure what actually your concern is.Ranadip Dutta– Ranadip Dutta2017-01-14 07:18:37 +00:00Commented Jan 14, 2017 at 7:18
-
@RanadipDutta The SCCM module is for the SCCM server environment, which he doesn't have access to. LandOfCake, what you have tried? I'm at home now and can't verify it, but UIResource COM-object should work. Ex. sepago.com/blog/2013/09/06/… . Ask your SCCM admin before running this. The deployment is made optional for a reason. What if someone hasn't saved their work?Frode F.– Frode F.2017-01-14 15:08:59 +00:00Commented Jan 14, 2017 at 15:08
-
My use case is little different than usual: I have automated test execution which depends on successful build. Then I have to reimage around 20 servers with server 2012 r2 std and 20 clients with with dowsing 10 os. I currently do this by selecting task sequence manually from software center. But, it is wasting a lot of my time and preventing to run my tests in fully automated faison. The task sequence to deploy OS, and other configurations are available in the software center but not able to execute it programitacilly. Nobody else is using any of these system but me.LandOfCake– LandOfCake2017-01-16 17:21:04 +00:00Commented Jan 16, 2017 at 17:21
-
@LandOfCake: Please accept/upvote the answer if it helps youRanadip Dutta– Ranadip Dutta2017-01-16 17:26:28 +00:00Commented Jan 16, 2017 at 17:26
-
2As described by David O'Brien at link provided by @Frode F. the solution is to use package ID to execute OSD task sequence. Thank you so much. Here is an example: $UI = New-Object -ComObject "UIResource.UIResourceMgr" $ProgramID = "*" $PackageID = "%PutInYourPackageID%" $UI.ExecuteProgram($ProgramID, $PackageID, $true)LandOfCake– LandOfCake2017-01-16 20:04:28 +00:00Commented Jan 16, 2017 at 20:04
|
Show 3 more comments
1 Answer
Try the UIResourceMgr COM-object. Example (source):
$UI = New-Object -ComObject "UIResource.UIResourceMgr"
$ProgramID = "*"
$PackageID = "PACKAGEID"
$UI.ExecuteProgram($ProgramID, $PackageID, $true)