In a secured environment, creating and deploying images for systems can be a challenge due to restrictions on network access and software installations. However, using osdimg with PowerShell, it is possible to create ISO files to deploy images to secured systems. This blog post will cover how to use osdimg with PowerShell to create ISO files for a secured environment and provide a PowerShell script to automate this process.

What is osdimg?

osdimg is a tool that is part of the Windows Assessment and Deployment Kit (ADK). It is used to create, capture, and modify Windows images. With osdimg, you can create Windows image files that can be used to deploy Windows to new computers.

Using osdimg with PowerShell

To use osdimg with PowerShell, you must install the Windows ADK on your system. Once installed, open PowerShell as an administrator and navigate to the folder containing the osdimg.exe file. The default location for the osdimg.exe file is:

C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg

To create an ISO file, you will need to use the following command:

osdimg.exe -n -m -b C:\path\to\boot\folder C:\path\to\source C:\path\to\output\ISO\file.iso

The -n parameter specifies that the ISO file should be created in UDF format, which is necessary for larger ISO files. The -m parameter specifies that the ISO file should be created with a maximum size of 4 GB. The -b parameter specifies the path to the boot file folder. Finally, the C:\path\to\source and C:\path\to\output\ISO\file.iso parameters specify the source folder and output ISO file, respectively.

Automating the Process with PowerShell

To automate the process of creating ISO files using osdimg with PowerShell, you can create a PowerShell script using the above command. Here is an example PowerShell script that creates an ISO file for a Windows 10 image:

bashCopy code

# Define the paths to the boot and source folders and the output ISO file

$bootFolder = “C:\Temp\Boot”$sourceFolder = “C:\Temp\Source”

$outputFile = “C:\Temp\Windows10.iso” # Create the ISO file using osdimg & “C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\osdimg.exe” -n -m -b$bootFolder $sourceFolder$outputFile

This script defines the paths to the boot and source folders and the output ISO file. It then uses the osdimg command to create the ISO file using the abovementioned parameters.

Conclusion

Using osdimg with PowerShell effectively creates ISO files for deployment to systems in a secured environment. Following the steps outlined in this blog post and using the provided PowerShell script, you can automate creating ISO files for large-scale deployments. This process allows you to create ISO files without network access or software installations, making it an efficient and effective solution for secured environments.

Thanks

Cristal Kawula MVP