none
Powershell Microsoft.powershell.localaccounts RRS feed

  • Question

  • Hi,

    I cannot user the supposed built-in and imported module Microsot.powershell.localaccounts, it is seen unrecognized,

    It is supposed to be existent in Windows server 2016 and Windows 10 but in my case it isn't,

    any advise?


    Cherif Benammar

    Wednesday, June 19, 2019 11:16 AM

Answers

All replies

  • What command have you tried and what is the error?  This will only work with PS 5.1.  It will not work with PowerShell Core.

    Get-LocalUser


    \_(ツ)_/

    Wednesday, June 19, 2019 12:02 PM
  • I cannot user the supposed built-in and imported module Microsot.powershell.localaccounts, it is seen unrecognized,


    What is the exact command that you are running and the error that is produced? FYI, you misspelled Microsoft in your post. Did you do the same in Powershell? 

    On Win 10 I get:

    PS C:\WINDOWS\system32> get-localuser
    Name               Enabled Description                                                                                   
    ----               ------- -----------                                                                                   
    Admin              True                                                                                                  
    Administrator      False   Built-in account for administering the computer/domain                                        
    DefaultAccount     False   A user account managed by the system.                                                         
    Guest              False   Built-in account for guest access to the computer/domain                                      
    sshd               True                                                                                                  
    testuser           True                                                                                                  
    WDAGUtilityAccount False   A user account managed and used by the system for Windows Defender Application Guard scenarios.

    Wednesday, June 19, 2019 12:07 PM
  • add-localgroupmember cmdlet is not recognized

    Cherif Benammar

    Wednesday, June 19, 2019 12:48 PM
  • this command is not regonnized as cmdlet, script or program

    Cherif Benammar

    Wednesday, June 19, 2019 12:49 PM
  • get-module Microsoft.PowerShell.LocalAccounts

    $env:psmodulepath -split ';'

    This must contain 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules'


    \_(ツ)_/

    Wednesday, June 19, 2019 1:00 PM
  • Also be sure you are not running the 32 bit version of PowerShell.  The module is only available in 64 bit PS.


    \_(ツ)_/

    Wednesday, June 19, 2019 1:03 PM
  • get-module Microsoft.PowerShell.LocalAccounts didn't raise any error;

    but still getting error with "add-localgroupmember " as not recognized


    Cherif Benammar

    Wednesday, June 19, 2019 1:29 PM
  • I ran ISE 64 bit

    Cherif Benammar

    Wednesday, June 19, 2019 1:29 PM
  • get-module Microsoft.PowerShell.LocalAccounts didn't raise any error;

    but still getting error with "add-localgroupmember " as not recognized


    Cherif Benammar

    You didn't answer both questions.

    Also run this:

    get-module -List Microsoft.PowerShell.LocalAccounts


    \_(ツ)_/

    Wednesday, June 19, 2019 1:39 PM
  • I ran that then I have to do?

    Cherif Benammar

    Wednesday, June 19, 2019 1:44 PM
  • I ran that then I have to do?

    Cherif Benammar

    What did you run.  What was the results.  Please try to be clear.   Please provide clear and complete answers to the questions.


    \_(ツ)_/

    Wednesday, June 19, 2019 1:50 PM
  • I tried get-module -List Microsoft.PowerShell.LocalAccounts on server 2016 and returned 

    PS C:\Users\smsadmin> get-module Microsoft.PowerShell.LocalAccounts

    ModuleType Version    Name                                ExportedCommands                                                                                         
    ---------- -------    ----                                ----------------                                                                                         
    Binary     1.0.0.0    Microsoft.PowerShell.LocalAccounts  {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser, Get-LocalGroup...}                           

    that same command didn't return the same output on Windows 10 v1809;

    am I clear now?


    Cherif Benammar

    Wednesday, June 19, 2019 2:02 PM
  • Yes much clearer.  There was no way we could guess that that was what you were trying to explain.

    Now answer the other question which you keep ignoring.


    \_(ツ)_/

    Wednesday, June 19, 2019 2:05 PM
  • PS C:\Windows\system32> Add-LocalGroupMember -Group "configmgr remote control users" -Member sms_remote_control -Confirm
    Add-LocalGroupMember : The term 'Add-LocalGroupMember' 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:1 char:1
    + Add-LocalGroupMember -Group "configmgr remote control users" -Member sms_re ...
    + ~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Add-LocalGroupMember:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     

    Cherif Benammar

    Wednesday, June 19, 2019 2:15 PM
  • Please tell us the module path list. I have asked for this three times now.  Why?

    This is what I posted a long time ago.

    get-module Microsoft.PowerShell.LocalAccounts
    
    $env:psmodulepath -split ';'
    
    This must contain 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules'
    

    Please post the answer to the second line of code.


    \_(ツ)_/

    Wednesday, June 19, 2019 2:36 PM
  • ok,

    PS C:\Windows\ccmcache\gf> $env:psmodulepath -split ';'
    C:\WINDOWS\system32\config\systemprofile\Documents\WindowsPowerShell\Modules
    C:\Program Files (x86)\WindowsPowerShell\Modules
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
    C:\Program Files (x86)\Microsoft Azure Information Protection\Powershell


    Cherif Benammar

    Wednesday, June 19, 2019 3:14 PM
  • Thankyou now do this:

    dir C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.LocalAccounts -recurse


    \_(ツ)_/

    Wednesday, June 19, 2019 3:29 PM
  • C:\>dir C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.LocalAccounts -recurse
     Le volume dans le lecteur C n’a pas de nom.
     Le numéro de série du volume est CEB4-AFDF

     Répertoire de C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules

    Fichier introuvable

     Répertoire de C:\

    Fichier introuvable

    C:\>

    Cherif Benammar

    Wednesday, June 19, 2019 3:34 PM
  • The module is missing.  You will need to do a full repair on your Windows installation.


    \_(ツ)_/

    Wednesday, June 19, 2019 3:48 PM
  • thank you for your guidance,

    I appreciate


    Cherif Benammar

    Wednesday, June 19, 2019 4:01 PM