Enabling Windows features from the command line

Windows Server has available only the basic services after installation. We can enable additional features on request. We may later enable other features, like SNMP service. In addition, sometime we have to do that from a script or command line.

We have a powerful command for such task – DISM. This command can be used with both online Windows folders and offline installation disks.

We already mentioned this command in this article about the IE11 installation. The command exists on all Windows versions, from version 7 onward. You must be administrator on the local machine and to open the elevated command prompt to execute it.

 

Available features

I guess that you don’t know the names of all available features. That’s fine. I don’t try to remember them, too. But I can find the list easily.

dism get features

Execute the command

dism /online /get-features

The DISM command will execute and enlist all available features and their states.

dism get features - lista

 

Enabling SNMP service

One of most common tasks in my practice is to enable the SNMP service on the server. I need the SNMP service for the remote monitoring in Mikrotik Dude. However, the detailed story about the SNMP monitoring is a theme for other post.

Of course, we can do that from the GUI tool, but then I need to wait on the Wizard. Moreover, the Core version don’t have the GUI tools.

dism za snmp svc

We need to execute following command:

dism /online /enable-feature /featurename:SNMP

It will takes up to a minute for the DISM command to execute and install the service. After that, we can configure the SNMP service as usual.

As you can see, using the DISM command can be very easy. Next time you can try to enable some feature using the DISM command instead of the GUI tool.

Stay tuned.

Advertisements

One thought on “Enabling Windows features from the command line

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s