0

Receive the following error message when I run the Get-WindowsOptionalFeature command.

PS C:\Windows\system32> Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol 

Get-WindowsOptionalFeature : An error occured. No operation was performed. 
Verify that DISM is installed properly in the image, and then try the operation again.
At line:1 char:1
+ Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo      : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand

1 Answers1

0

Make sure your DISM is actually working with:

dism /online /Get-FeatureInfo /FeatureName:SMB1Protocol

Double-check that you have the correct version for your build of windows as well. Sometimes this can be caused if you have some other version of the WAIK installed for example:

gwmi win32_operatingsystem | fl *
  caption      : Microsoft Windows Server 2012 R2 Standard
  BuildNumber  : 9600
  Version      : 6.3.9600

dism /online /get-feature
  Deployment Image Servicing and Management tool
  Version: 6.3.9600.19408  # Version of dism
  Image Version: 6.3.9600.19397  # Version of windows
Cpt.Whale
  • 4,784
  • 1
  • 10
  • 16
  • I get a difference between the version of DISM and version of Windows. Currently I have been unable to run a Windows Update. Been receive a Code 80072EFD for Windows Update. – Nebeyu Daniel Jun 22 '21 at 18:55
  • @NebeyuDaniel you're going to want to fix that issue first if possible. That error generally just means the local update service can't see either: 1) The internet, 2) WSUS, or whatever server is providing updates, or 3) Your proxy server (if one is configured). – Cpt.Whale Jun 22 '21 at 20:10
  • Did the dism command above work to get the feature? You can also manage SMB1 through `Get/Set-SmbServerConfiguration -EnableSMB1Protocol $false` if dism is misbehaving. – Cpt.Whale Jun 22 '21 at 20:14
  • The DISM command above worked to get the feature. Issue is that the Tenable scan only accepts the Get-WindowsOptionalFeature command to show a feature is disabled. Currently, working on the Windows Update issue. Figured it's one of those three errors. – Nebeyu Daniel Jun 23 '21 at 13:27
  • @NebeyuDaniel that makes sense. In that case, you can try running the command manually with logging enabled, then check the log to see if there is a better error message: `Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol -LogLevel WarningsInfo -LogPath C:\temp\dismlog.log`, but `-Loglevel` might need to be `4` instead, depending on the powershell/module version. – Cpt.Whale Jun 23 '21 at 17:57