Jump to content


anyweb

Updated Script: How can I check for network connectivity & storage before starting a task sequence in System Center 2012 R2 Configuration Manager ?

Recommended Posts

Introduction
In a previous post I showed you how you can check for network connectivity before starting a task sequence in Configuration Manager 2012 R2. In this post I'll add a newer script to also check for storage (SAS, SATA, SCSI, Storage). The added code gives you new abilities to deal with hardware that has changed for whatever reason and it allows you to quickly identify the problem, and identify the storage vendor id and device id so that you can go looking for drivers.

 

As storage is a must (the task sequence must write temp files on your hard disc and also copy packages) adding this change to the script was inevitable. I hope you like the results.

 

Get the new script.

Here's the updated script

 

CheckForNetwork.zip

 

simply replace the earlier script with this one as documented in the process detailed here.

 

Note: if you downloaded the script prior to 2015/4/22 then please download it again as there's a newer version here with fixes and logging added. The new script logs to X:\Windows\Temp\SMSTSLOG\checkfornetwork.log

 

See the results

After implementing the new script in your boot image this is what you'll see when it detects missing storage drivers.

 

warning unable to continue.png

 

As you can see from the message it provides the following info

  • a reason for the popup (no storage detected)
  • lists the detected storage controller
  • lists the PNP Device ID
  • identifies the Computer model

and gives the user some options

  • click OK to reboot.
  • click CANCEL to open a CMD prompt if further troubleshooting is needed

In addition to the above, it also checks for network (if and only if the storage check above passes), and in the event of a network connectivity failure you'll see this

 

cannot connect to network.png

 

which provides the following info

  • a reason for the popup (no network connectivity)
  • lists the detected Network Card
  • lists the PNP Device ID
  • identifies the Computer model

and gives the user some options

  • click YES to retry (for example if the network cable was not connected)
  • click CANCEL to open a CMD prompt if further troubleshooting is needed
  • click OK to reboot.

Well that's it, I hope you like the update ! please test it and give me feedback

 

cheers

niall

Share this post


Link to post
Share on other sites

hi Tim, I havn't tried it in an MDT only environment yet, but i would imagine the results would be similar, feel free to beat me to it and post your results, in my testing I'm using SCCM CB with MDT integrated..and it works just fine

Share this post


Link to post
Share on other sites

so I've implemented the script in an MDT 2013 update 2 boot image (integrated with sccm) , works great, detects when no network or when no disk, really really usefull, should be included by default :) Niall, thanks a lot for putting this together and sharing it!

Now... i'm sometimes using a standalone image, using the same boot image, is there a way in the script to detect it (or prestaged media) and bypass the network detection in this case?

yeah I could choose another boot image without the script but I have other customizations  as well and like to keep thing as simple as possible

thanks a lot

Share this post


Link to post
Share on other sites

Now... i'm sometimes using a standalone image, using the same boot image, is there a way in the script to detect it (or prestaged media) and bypass the network detection in this case? 

can you expand on this please ?

Share this post


Link to post
Share on other sites

well in a standalone image you don't need network connectivity to run the task sequence right? you can just run it from an usb key. But it's still using the boot image to boot in winPE at the beginning, so if we have a script asking for network in the boot image without any way to ignore it the task sequence can't start.

hope it helps, let me know if it still unclear?thanks

Share this post


Link to post
Share on other sites

right then the logic would have to change in the script, so that it knows if it's booted via standalone, and if so, skip the checkfornetwork step

 

check for the following variable

 

_SMSTSLaunchMode

 

Specifies the task sequence launch method. The task sequence can have the following values:

  • SMS - specifies that the task sequence is started by using the Configuration Manager client.

  • UFD - specifies that the task sequence is started by using USB media and that the USB media was created in Windows XP/2003.

  • UFD+FORMAT - specifies that the task sequence is started by using USB media and that the USB media was created in Windows Vista or later.

  • CD - specifies that the task sequence is started by using a CD.

  • DVD - specifies that the task sequence is started by using a DVD.

  • PXE - specifies that the task sequence is started from PXE.

  • HD – specifies that the task sequence was started from a hard disk (prestaged media only).

 

and based on the value it returns do the above...

Share this post


Link to post
Share on other sites

right, but I don't think the TS variables are already set up so early in WinPe (I may be wrong), that's why I was thinking an ignore button would just do the trick (there is probably more clever solutions but my coding abilities are somewhat limited)

Share this post


Link to post
Share on other sites

Any comments as to SCCM CB compatibility? I've implemented this in SCCM CB 1702 using a copy of our standard Win10 1607 boot image. It looks like the script is running and immediately exiting, and WinPE then immediately reboots, presumably because that's how WinPE seems to behave when there is nothing left to run.

Any ideas would be appreciated. Otherwise, I'll have to start a cycle of plopping pauses in the script and recompiling and redistributing the wim :/

Thanks,

== Matt

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.