Use the dism /online /get-features command in an elevated Command Prompt to list all available Windows Server features. To install a feature like IIS, use dism /online /enable-feature /featurename:Web-Server /all. This method works on Windows Server 2022 Standard Evaluation without requiring additional media or external sources.
Understanding DISM Feature Management
Deployment Image Servicing and Management (DISM) is a powerful command-line utility included in Windows Server operating systems. It allows administrators to service and repair Windows images, including running instances of the operating system. When managing roles and features on a live server, DISM provides a reliable alternative to the graphical Server Manager interface. The primary advantage of using DISM for feature management is its scriptability and precision. You can automate the installation of multiple components across many servers by creating simple batch files or PowerShell scripts. Unlike the graphical interface, which may hide advanced options or require multiple clicks, DISM exposes every available component directly through the command line. This transparency helps administrators verify exactly what will be installed before executing the command. For Windows Server 2022 Standard Evaluation, the process remains identical to the licensed versions. The evaluation period does not restrict access to core servicing tools like DISM. However, it is important to note that some features may require source files if they are not present in the local image cache. In most standard installations, the necessary files are already cached locally, allowing offline or online installation without pointing to external media.Running Commands with Elevated Privileges
Before attempting any feature enumeration or installation, you must ensure that your command prompt has administrative privileges. Standard user accounts do not have permission to modify system-level components. To achieve this, right-click the Start menu and select "Terminal (Admin)" or "Command Prompt (Admin)". If you are using PowerShell, run it as Administrator from the same context. Without elevation, DISM commands will fail immediately with an "Access Denied" error. This is a common pitfall for new administrators who assume their current session carries sufficient rights. Always verify the title bar of your terminal window shows "Administrator" before proceeding. This single step prevents the majority of permission-related errors during feature management tasks.Listing Available Features
To discover which features are available for installation, use the/get-features switch. This command queries the currently installed image and returns a comprehensive list of all possible components. The output includes the internal name of the feature, its display name, and its current state (Enabled, Disabled, or Not Present).
Run the following command in your elevated terminal:
dism /online /get-features
This command may take several seconds to complete depending on the number of components installed. The output is verbose, so you might want to redirect it to a file for easier searching. For example, you can pipe the output to find specific strings related to web services or database components.
When reviewing the list, pay close attention to the "State" column. A state of "Disabled" means the feature is part of the OS but not active. A state of "Not Present" indicates that the component files are missing from the image, which often happens in minimal installations or custom WIM files. In such cases, you may need to specify a source path for the installation command to locate the required binaries.
Installing Features via DISM
Once you have identified the correct internal feature name, you can enable it using the/enable-feature switch. The syntax requires the /featurename: parameter followed by the exact internal name found in the previous step. For Internet Information Services (IIS), the correct internal name is Web-Server, not IIS-WebServer. Using incorrect names will result in an error indicating the feature was not found.
To install IIS along with all its subcomponents and dependencies, use the /all flag. This ensures that dependent features, such as the HTTP Logging or Request Filter modules, are automatically included. Without this flag, you might end up with a partially functional service that lacks essential supporting components.
dism /online /enable-feature /featurename:Web-Server /all /norestart
The /norestart option is recommended because it prevents the server from rebooting immediately after installation. This allows you to install multiple features in sequence before performing a single controlled restart. Restarting after every single feature installation is inefficient and disrupts other services running on the server.
After the command completes successfully, you should see a message confirming that the operation completed successfully. You can verify the installation by checking the status again using /get-features or by opening the Server Manager console. The IIS role should now appear as installed and enabled.
Handling Source File Requirements
In some scenarios, particularly with stripped-down or highly customized server images, DISM may report that source files are missing. If you encounter an error stating that the source could not be found, you must provide the location of the Windows Server 2022 installation media. This media can be a mounted ISO image or a network share containing thesxs folder.
Specify the source using the /source: parameter. The path must point to the sxs directory within the installation media, not the root of the drive. For example, if you mount an ISO to drive D:, the source path would be D:\sources\sxs.
dism /online /enable-feature /featurename:Web-Server /all /source:D:\sources\sxs /norestart
Providing the correct source path resolves most installation failures related to missing binaries. This approach is particularly useful when building reference images or automating deployments where local caching has been cleared. Ensure that the account running the command has read access to the specified source location.
Related Resources
If you encounter connectivity issues after setting up server roles, check our guide on Windows Server 2022 VPN Setup Hell: Can't Connect Windows 11 Client for troubleshooting steps. Additionally, for broader server maintenance tasks, refer to Troubleshooting: Unable to Reach Website After Downloading File During Windows Server Upgrade to understand how updates interact with installed services.Frequently Asked Questions
How do I uninstall a feature installed via DISM?
You can remove a feature by replacing the /enable-feature switch with /disable-feature in the command syntax. Use the same /featurename: parameter with the internal name of the component you wish to remove. Adding /all will also remove dependent features if they are no longer needed by other installed components.
Can I use DISM to install .NET Framework on Server 2022?
Yes, DISM supports installing .NET Framework features. You can use dism /online /enable-feature /featurename:NetFx3 /all for version 3.5 or NetFx4-AdvSrvs for version 4.x. These features are often pre-cached in the OS image, so external source paths are rarely required unless the cache is corrupted.
What is the difference between DISM and PowerShell Cmdlets?
PowerShell cmdlets like Install-WindowsFeature are wrappers around DISM and provide a more modern, object-oriented interface. However, DISM offers lower-level control and is often preferred for scripting in environments where PowerShell modules may not be fully loaded or compatible. Both tools achieve the same result, but DISM is universally available across all Windows Server versions.
Why does DISM say the source file could not be found?
This error occurs when the required binary files are not present in the local Component Store and no external source is provided. It is common in minimal installations or after clearing the package cache. Mounting the original Windows Server ISO and specifying the \sources\sxs path resolves this issue by giving DISM access to the missing binaries.
Does enabling IIS via DISM require a reboot?
No, enabling IIS does not strictly require an immediate reboot. By using the /norestart flag, you can defer the restart until you are ready to apply changes. However, some configuration changes or subsequent service starts may require a reboot to take full effect, so plan your maintenance window accordingly.