Showing posts with label OSD Automation. Show all posts
Showing posts with label OSD Automation. Show all posts

Updating the country or region settings in windows 10

Hello Friends,

 

We observed sometimes, we are facing issues while updating the country or region settings in windows 10. Thus, it is important to keep the correct settings. If you can’t change country or region, it might be for one of these reasons:

You changed the country or region within the last three months.

Your account is suspended. For example, the credit card on a subscription has expired, or your subscription has a balance due.

You’re legally a minor in your current country or region and won’t be a minor in the new region, or vice-versa.

 

For more details about country or region settings in Windows 10, refer to the below link.

 

Update Task Sequence, DP info in registry

Hello Friends,

Is there a way I can know which task sequence is used to deploy a particular machine?

Yes, we can update the registry key with the Task Sequence info like, which Task Sequence is used to deploy the OS on a particular machine?

from Which DP the contents are downloaded? Is the machine built with Boot media or it is PXE boot?

Is this a machine desktop or laptop? what is the machine type, machine model?

Also, we can get when the machine is imaged(date and time when the Task Sequence is deployed).

First, we have to gather all the information which we want to update in the registry.

let's take the example of DP's name...

How do we know from which DP the contents are getting downloaded? from where I can get this information? is it a simple variable which I can use to update the registry? No.

While running the Task Sequence all the variable data is stored in a .dat file and we can fetch that using "New-Object -ComObject 'Microsoft.SMS.TSEnvironment"

OSD Driver installation via PowerShell

Today we are going to install the model-specific driver packages using PowerShell script. The advantage of using this method of driver installation during the Operating System deployment is to reduce the overall Task Sequence deployment time, This method is more suitable if you have multiple hardware devices with multiple vendors (Dell, HP, Lenovo, Microsoft, etc...) 

In order to achieve this method follow the below steps. 

1. Create the folder structure as below.
        a. Vendor\Hardware model\

2. Download the specific hardware model driver package from the vendor website and extract the cab files.

3. Archive/Zip all the extracted drivers into one single folder called "Drivers.zip".

4. Copy DISM folder from ADK installed machine and place into the "Vendor\Hardware model\"
path of DISM-(C:\Program Files (x86)\Windows Kits\<version>\Assessment and Deployment Kit\Deployment Tools\10\DISM)

TaskBand customization during TS execution PowerShell Solution

Friends, Hope you are doing well. Today we are going to automate the taskband during the imaging process. We will create the taskband package using Powershell and deploy the package via a task sequence. alternatively, you can use the batch file instead of PowerShell.

What first?

First, we have to log in on the reference machine from where we are capturing the taskband files and settings.

Pin the taskbar items whatever you want😊 as per your org requirement, not blindly😏




go to location "%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\"

TaskBar Customization during Task Sequence execution Batch Script

There are two ways to customize your TaskBand during the Task Sequence execution.

1. Using PowerShell script

2. Batch Script as described here.

Pin the taskbar items whatever you want😊 as per your org requirement, not blindly😏

go to the location "%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\" 

copy all the shortcut files from this location and save them to your reference package folder.

for me, I have created one folder on the reference machine desktop named "TaskBandAutomation\Taskbar".

now what next? open registry settings for users and navigate to "Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" and say export and save as TaskBand.reg. where? on your desktop or anywhere you want. anyway, we have to delete this file after getting some info from it.

Make CMTrace as default log viewer during the Imaging process(OSD)

While analyzing the SCCM logs every engineer wants to open log files by default in CMTrace. But When you log in to a new build machine and open the CCM logs or any *.log files from the machine, the log files will open in the notepad by default. Reading the SCCM log files into notepad is very difficult, Microsoft is providing the live log reading tool call CMTrace with the SCCM suite. In this post, we are going to make it the default app for log files. We will create the SCCM package and deploy it via Task Sequence execution while Operating System Deployment step.

To achieve this, create a new package using the below PS1 code and deploy it on required DPs

Cleanup Image before Capture - Event Viewer cleanup batch file

Guys, Why WIM Image cleanup is more important ? This is because it delivers error-free images to the customer and reduces the manufacturer's bugs and issues. While troubleshooting the end-user machine, there should not be previous logs that can create confusion.

If you are going to clean up the event viewer logs one by one manually it will take your whole day and also an irritating job for you. don't worry we have created a simple and easy script that helps you to clean the event viewer logs within a minute.

clean reference images before capturing them in WIM format.


Auto Diskpart and stale entry delete from SCCM during Imaging process

I know many of the build administrators are deploying the Task Sequence on unknown device collection. I purpose and the idea behind it is to do not deploy the task sequence on a production device and prevent accidental data loss.

If the machine is in SCCM collection and we want to run the task sequence on it, we must SCCM Console and do a manual deletion job and wait for a couple of minutes to restart the imaging on the target machine

This is a time-consuming and repetitive task for us. Can we create a way to do this in an automotive way? Like, create the PowerShell Script, which will automatically read the machine's MAC Address and connect to the SCCM database from the WinPE environment for getting all the hostnames to hold by that mac address and delete each.

Also, can we do a diskpart at the same time to avoid further imaging failure? Yes we can create the PowerShell Script and integrate it with Boot Image, which will automatically check whether the machine having an internal storage device attached or not, and based on the results script will perform Diskpart operation, if the internal storage device is faulty or not connected in BIOS, the script will prompt the error.

Image Validation Script used in TS execution, OSD validation

Hello Friends,

As a build administrator, post Operating system deployment, Image Validation is a very very important task. There are multiple parameters we have to check post OS installation.
Like, we have to check each and every application installed on the machine and also check the version of each application, whether it's installed correctly or not?

We have to check whatever the patches we have targeted to the device are installed properly or not?

Sometimes we are getting requirements from clients saying that we have to set some services in disabled mode and some services we need to set as an automatic start. These services' startup type and status should be the same as we configured before executing Task Sequence or while capturing the WIM file.

Manual drivers validation is again a very difficult task, why not capture all the drivers installed on the machine and save it in the same CSV file for further validation.

AD Authentication PowerShell script.

 Hello friends, In some scenarios tech guys have to provide their username and password to join the machine into the domain. and Task Sequence wants to store the info somewhere before execute the actual domain join step.

I have seen the problem, that sometimes builds engineers are not providing the correct username and password to the TS and the domain join step is getting failed due to incorrect username and password.

Don't worry! this is a common issue with anyone and we can fix it by checking the user is present on AD and will authenticate him at the same time when he provides the credential details to the Task Sequence.

How?

Domain join is failed due to network unavailability during TS execution

Hello friends,

Domain join is the most important step in the Task Sequence. If the domain join does not happen, there is no value to execute the task sequence ahead. Because if we missed joining the domain during the task sequence execution, the domain users can not log in to the machine and we have to reimage the machine again, simply this waste of time.

Here is one important thing we have to note down, this step is not failing anyhow. So, if the domain join is failed even. Still, a task sequence will execute the next step.

We only know that domain join is failed while login in the machine post-task sequence completes.

Why is domain join fail sometimes?

We are joining the machines to the domain once driver installation is done (before first reboot the machine). We observed post drivers’ installation sometimes network drivers loos the connectivity and this is causing the domain join failure.

User base Drivers installation - Max Audio Pro For Dell

User base drivers?

yes, We have some drivers which need to be installed in the users' contexts.

This post is not about the driver's installation but moreover about installing any package which is purely created for the user. 

The below script will install the user base "Max Audio Pro For Dell" drives post Task Sequence execution and on first-time users login into the machine.

We have to place the whole setup file along with the below script on the target machine for user base installation post Task Sequence.

The trigger.bat we have to create with the script code:

MKDIR "C:\ProgramData\OSD_MaxAudio"

xcopy.exe ".\*.*" "C:\ProgramData\OSD_MaxAudio" /D /E /C /I /Q /H /R /Y /S

Services management during OSD Task Execution

Hello Friends, During the OSD Task Sequence execution process, We have to disable and stop some services, or sometimes we have to enable and start the services from Windows services.msc console.

We can use cmdlet from PowerShell "set-service" to manage the services on the windows operating system.

To manage the bunch of services during Task Sequence execution, We have created the below PowerShell script and managed some of the services. you can change the service name and startup type as per your requirement.

also, you can use this PowerShell script before capture the WIM file or it can be used during the TS execution time. in both scenarios, we can manage the services.

Services management during OSD Task Execution
Use the below script to manage the services during OSD.

Inject the Drivers during Task Sequence execution via Auto IT Script

Hello Friends, Here is another way to inject the drivers is based on the hardware mode. This time we are using the AutoIT script solution to create the script and us in the Task Sequence.

In order to achieve this method follow the below steps. 

1. Create the folder structure as below.

        a. Vendor\Hardware model\

2. Download the AutoIT script editor here and install it on your machine.

3. Write the below script in the "SciTE Script Editor" located  at C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoIt v3

Inject the Drivers during Task Sequence execution via Auto IT Script


4. Save the file as InjectDrivers.au3

Remove Windows10 bloatware from WIM using PowerShell

The logic behind writing this script is to remove unwanted built-in apps from Windows 10 1909 Operating System. This script can be used to remove Windows 10 built-In Apps in OS as well as in Task Sequence Deployment.

You can mention the list of applications to remove from the OS, based on your business requirement.

<#

    .SYNOPSIS

    Removing Windows 10 1909 Built-In Apps.

    .DESCRIPTION

   

    .NOTES

    =============================================================================================================================================

    Created with:     Windows PowerShell ISE

    Created on:       Wednesday, October 6, 2021 5:41:31 PM

    Created by:       Dashrath Chate

 

Create batch file to replace xml file restart app service and create detection rule

Hello friends, there are a lot of customized XML files we are using in the WIM and even during the Task Sequence execution. like startlayout.xml, defaultAppAssociation.xml, UDIWizard.xml.

Sometimes we are creating custom application installation through UDI Wizard using XML, some application settings need to overwrite using an XML file.

post OSD, technicians can’t copy-paste each and every XML file into the application install directory and there are chances of mistakes and can lead to a functionality break.

To overcome this issue, we can replace the application-related XML files safely during the Task sequence execution.

you have to customize your XML file and create a package along with one batch script inside it.

the batch file will act as a trigger while executing the action and use the %~dp0 functionality before the XML file name to replace the existing XML file from the package source directory. to overwrite the existing XML, we have to use the /y switch at the end of xcopy command.

Create local admin account with password during task sequence execution

What if the machine gets failed during the task sequence execution and not joined the domain too? How to login machine for further troubleshooting?? Is there any mechanism to create a local admin account??? (there are so many organizations not enabling the built-in administrator for security purposes)?

Yes, we can create the custom local administrator account and add them to the local administrators’ group. Also, we can set the password expiry - wmic useraccount where name='localadmin' set passwordexpires=false and password to the account - net user /add localadmin P@$$W)rd (you can choose a local admin username and password as per your requirement).

This script is more important because there is one default function also available in TS to use the built-in administrator or rename and use it. Then why we are putting extra effort and using this script?

The advantage is we are not creating the local administrator account if everything goes well, instead of, if domain join is failed then only, we are going to create custom local account to enable to local login functionality and help technician to gather the logs and take further action.

Cleanup unwanted files from the reference machine during Image Capture

Hello Friends, how are you doing today?

While capturing the WIM file, the Build Engineer has to clean the temp files created during the Image customization.

Also need to perform the System drive cleanup for defragmenting and windows update cleanup.

We have a simple solution to perform Image cleanup by executing the below batch script.

Cleanup unwanted files from the reference machine during Image Capture

Move all desktop shortcuts into one folder after complete the OSD

Hi folks, while working on projects we are getting so many Image customization requests and we have to fulfill those in a timed manner.

Here is one requirement requested by one of the customers to remove all the installed application shortcuts from the desktop and place them into one single folder on the desktop. The idea behind it freshly build machine's desktop should be clean and users should not bother with so many shortcuts.

While executing the applications from TS, machine base application shortcuts are getting created in the public user’s desktop and normal users cannot delete or move these shortcuts by themselves as they don’t have permissions to the public desktop directory.

Cool, we can move all the installed application shortcuts to a single folder in one click. How? using below script 😊

Xcopy during the Task Sequence execution achieve through batch file

Hey guys, We have to place wallpapers, screen savers, user profile pictures, machine base run scripts, userbase runonce scripts into the machine.

We cannot add these files and scripts into the WIM because it needs to change from time to time and should use the latest as per customer requirements. That’s why we always add these types of files into Task Sequence.

There is Xcopy command utility we can use in our script program to get this done.

While using the xcopy always use the %~dp0 and provide either each file name to copy to the destination or use wildcard *.*