あなたはモジュールをインポートするImport-Module Microsoft.Powershell.LocalAccounts
を使用する必要があります。 Get-Module
はモジュールをインポートしません。
PS C:\> Import-Module Microsoft.Powershell.LocalAccounts
PS C:\> Get-Module
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0.0.0 ISE {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
Binary 1.0.0.0 Microsoft.Powershell.LocalAccounts {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser, Get-LocalGroup...}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest 3.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Manifest 3.0.0.0 Microsoft.WSMan.Management {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP...}
ローカルグループとユーザーコマンドレットは、Win10 1607以降でのみ使用できます。どのバージョンのWindowsを使用していますか? – BenH
ベン、私はWindows 8のバージョンを使用しています。 – Jason
これらのコマンドレットを使用することはできません。 WinNTドライブでは 'net.exe localgroup'、ADSI、WMI Win32_Group *クラスを使用できます。ただし、コマンドレットは機能しません。 [この記事では、あなたがこれを達成する方法のいくつかについて詳しく説明します](https://www.petri.com/use-powershell-to-find-local-groups-and-members) – BenH