locked
Get-WindowsFeature DHCP - Power Shell Script failed to run RRS feed

  • Question

  • Hello all,

    I have problem with the DiscoverDHCPServer2012R2 - Power Shell Script failed to run

    System.Management.Automation.CommandNotFoundException: The term 'Get-WindowsFeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At line:74 char:10

    + $DHCP = Get-WindowsFeature DHCP

    My environment:MP DHCP version 6.0.7307.0, SCOM ver 1801, DHCP Server 2012R2.

    I am asking for help, I can not find a solution to the problem.

    Tom


    • Edited by TomaszDZ Thursday, July 5, 2018 12:30 PM
    Thursday, July 5, 2018 12:22 PM

All replies

  • Hi,

    Do you have other DHCP management packs installed, for W2008 or..... ?


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, July 5, 2018 12:34 PM
  • Hi,

    No, only MP for 2012

    Microsoft Windows Server DHCP 2012

    Microsoft Windows Server DHCP 2012 R2

    Microsoft Windows Server DHCP Library


    • Edited by TomaszDZ Thursday, July 5, 2018 12:41 PM
    Thursday, July 5, 2018 12:41 PM
  • Hi,

    According to this there is no support for SCOM 2016, could that be the issue?

    System Center Management Pack for Windows Server 2012 DHCP

    https://www.microsoft.com/en-us/download/details.aspx?id=39062

    Supported Operating System

    Windows Server 2012, Windows Server 2012 R2
    The Windows Server DHCP Management Pack for Operations Manager is designed for the following versions of System Center Operations Manager: • System Center Operations Manager 2012 • System Center Operations Manager 2012 SP1 • System Center Operations Manager 2012 R2


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, July 5, 2018 12:48 PM
  • I have the same problem on my other SCOM 2012R2 :(
    Thursday, July 5, 2018 12:58 PM
  • Hi,

    Looks more like a Powershell issue to me. Where are you getting this error? Can you check if the servermanager module is installed?

    Cheers


    Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar

    Thursday, July 5, 2018 1:19 PM
  • Hi,

    As Sameer Mhaisekar mentioned, please try 'import-module servermanager'


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, July 5, 2018 1:26 PM
  • Hi,

    Did not help :(

    ModuleType Version    Name                                ExportedCommands

    ---------- -------    ----                                ----------------

    Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...

    Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}

    Script     2.0.0.0    ServerManager                       {Get-WindowsFeature, Install-WindowsFeature, Uninstall-Win...

    I wonder if the anti-virus has an impact on it 

    Tom

    • Edited by TomaszDZ Friday, July 6, 2018 10:48 AM
    Friday, July 6, 2018 10:25 AM
  • Hi,

    From the Management Pack Guide to DHCP 2012 R2.docx - page 42. Is Powershell installed on the DHCP server?

    -----------------------------------------------------------------

    KNOWN ISSUES AND TROUBLESHOOTING

    KNOWN ISSUE: DISCOVERIES FAIL ON AGENTS WITHOUT POWERSHELL
    Issue: Discoveries will fail on the agents without PowerShell installed on the server.
    Workaround: Install PowerShell, or disable “DHCP Cluster 2012 Server Discovery Data Source” and “DHCP 2012 Server Discovery Data Source” discoveries on these agents. Then, run the following command in the “Operations Manager Shell”: Remove-SCOMDisabledClassInstance.
    -----------------------------------------------------------------

    System Center Management Pack for Windows Server 2012 DHCP

    https://www.microsoft.com/en-us/download/details.aspx?id=39062


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, July 6, 2018 10:58 AM
  • Hi,

    Yes, Powershell is installed.

    Windows PowerShell 4.0 (Installed)

    Windows PowerShell 2.0 Engine (Installed)

    Windows PowerShell ISE (Installed)

    the workaround does not work :(

    I have several DHCP servers and all have the same error Get-WindowsFeature' is not recognized
    • Edited by TomaszDZ Friday, July 6, 2018 12:04 PM
    Friday, July 6, 2018 11:45 AM