The term 'get-wsusupdate' is not recognized as the name of a cmdlet,

Shen, Quentin 1 Reputation point
2021-01-14T05:45:41.083+00:00

Dear All

I am a PowerShell newbie.

Recently, I want to export a list of which WSUS server is applied on each server so that I would like to use the command get-wsusserver as my first step to do this.

But it is an error: The term 'get-wsusserver' is not recognized as the name of a cmdlet,

So I have tried to use below command, but no luck.

PS C:\Temp> install-module updateservices
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'updateservices'. Try Get-PSRepository to see all available registered module repositories.

then, i run the below command.
PS C:\WINDOWS\system32> get-psrepository

Name InstallationPolicy SourceLocation


PSGallery Untrusted https://www.powershellgallery.com/api/v2

So, any help is highly appreciated.

Best regards & Thank you!
Quentin

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,406 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 31,166 Reputation points Microsoft Vendor
    2021-01-14T06:32:08.573+00:00

    Hi,

    Is the role Windows Server Update Service installed in your server? If yes, try running Import-Module UpdateServices and see if the cmdlet works.

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Shen, Quentin 1 Reputation point
    2021-01-14T06:35:55.387+00:00

    Hi Lan
    Many thanks for your reply on this.
    All those commands were run on my client laptop, what's the role Windows Server Update Service you mentioned about?
    Best
    Quentin


  3. SUNOJ KUMAR YELURU 13,961 Reputation points MVP
    2021-01-14T06:37:32.3+00:00

    @Shen, Quentin

    It looks module is not installed, Please refer below url.

    Client and patch management using the UpdateServices module

    UpdateServices cmdlets

    Microsoft.UpdateServices.Administration Namespace

    ----------

    Please don’t forget to "Accept the answer" and up-vote wherever the information provided helps you, this can be beneficial to other community members.


  4. Shen, Quentin 1 Reputation point
    2021-01-14T07:09:54.987+00:00

    Hi All

    I realized that module updateservices might be only installed on the server platform so that I enable the roles followed the instruction on server 2016.

    PS C:\Windows\system32> Install-WindowsFeature -Name UpdateServices-RSAT

    Success Restart Needed Exit Code Feature Result


    True No NoChangeNeeded {}

    but when I tried to run the command Get-WsusServer, there is still error showed up. Frustrated a lot.

    PS C:\Windows\system32> Get-WsusComputer
    Get-WsusComputer : Exception of type 'Microsoft.UpdateServices.Administration.WsusInvalidServerException' was thrown.
    At line:1 char:1

    • Get-WsusComputer
    • ~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidData: (Microsoft.Updat...ComputerCommand:GetWsusComputerCommand) [Get-WsusCompute
      r], WsusInvalidServerException
    • FullyQualifiedErrorId : ServerIsInvalid,Microsoft.UpdateServices.Commands.GetWsusComputerCommand

    PS C:\Windows\system32> Get-WsusServer
    Get-WsusServer : Exception of type 'Microsoft.UpdateServices.Administration.WsusInvalidServerException' was thrown.
    At line:1 char:1

    • Get-WsusServer
    • ~~~~~~~~~~~~~~
    • CategoryInfo : InvalidData: (Microsoft.Updat...usServerCommand:GetWsusServerCommand) [Get-WsusServer],
      WsusInvalidServerException
    • FullyQualifiedErrorId : ServerIsInvalid,Microsoft.UpdateServices.Commands.GetWsusServerCommand

    Any suggestions?
    Many thanks in advance.
    Best
    Quentin