Jump to content

Sysprep and WMI


Recommended Posts

Posted

The majority of my images these days are built using sysprep, which has proven

quite valuable. I'm now looking to enhance my images by way of post-clone scripts

that perform additional installations based on machine make/model or some other

hardware information. I'm aiming to use WMI for this task.

I've spent some time on this project and i've hit a snag. It appears that during the

mini-setup process, when Cmdlines.txt is processed, the WMI information is either

not yet populated or otherwise unavailable. Can anyone confirm the availability of

WMI at this time?

I did a bit of troubleshooting today and have confirmed that during mini-setup the

WMI service (winmgmt) and related services are running, I am able to connect to

the appropriate namespace (root\cimv2) and I can enumerate the class that I wish

to query (Win32_ComputerSystem). Unfortunately, it appears that there's either

not yet an instance of that class or I can't access the instance... I simply receive

and error (0x8004100a) which is simly listed as an "internal, critical and unexpected

error".

Thoughts? I realize this is somewhat involved, but i'm not yet frustrated enough

to call/pay MS for support.

Thanks.


Posted

Well, as a round about, couldn't you move the execution of the WMI script to after the setup has completed. I don't even know what a WMI script is, so lets use a batch as an example. Using various methods, you could insert the batch into the first startup. I would assume by then that the WMI info would be filled with the units info, as at that point it's fully loaded. And, if you positioned it to run first above all else, you could use the results to effect the next running tasks. So if you don't want a certain application to run if it matches a WMI result, then it would remove it from the list. The nice thing about this would be that you could leave most enabled, and then use results from the WMI script to limit the commands to precisely what you want.

Of course there is more work to test and configure that way, but just in case you can't get any WMI info during mini-setup...good luck!

Posted

JD,

you are right, wmi is not available to use until windows is fully installed, you can set you wmi script to run from the RUNONCE section of your syspreped image, one windows starts for the first time your script will fire off and setup what you want, what are you exactly looking are you looking for the script to do?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...