Option 1:
PS C:\Windows\system32> get-WmiObject -class Win32_Share
Name Path Description
---- ---- -----------
ADMIN$ C:\Windows Remote Admin
C$ C:\ Default share
D$ D:\ Default share
IPC$ Remote IPC
P$ P:\ Default share
Option 2:
PS C:\Windows\system32> net share
Share name Resource Remark
-------------------------------------------------------------------------------
C$ C:\ Default share
D$ D:\ Default share
IPC$ Remote IPC
P$ P:\ Default share
ADMIN$ C:\Windows Remote Admin
The command completed successfully.
Option 3:
PS C:\Windows\system32> Get-SmbShare
Get-SmbShare : The term 'Get-SmbShare' 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
+ Get-SmbShare
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-SmbShare:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Typically, File server roles are required for the powershell module to be available on such systems. Run the below command, without the whatif switch to install such roles.
PS C:\Windows\system32> Add-WindowsFeature FS-FileServer,FS-Resource-Manager -whatif
What if: Checking if running in 'WhatIf' Mode.
What if: Performing the operation "Add-WindowsFeature" on target "[File Services] File Server Resource Manager".
What if: Performing the operation "Add-WindowsFeature" on target "[File Services] File Server".
What if: This server may need to be restarted after the installation completes.
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True Maybe Success {}
Other Commands to identify features of localhost
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14409.1018
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1018
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\Windows\system32> Get-Module -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...
Script 1.0.0.1 PowerShellGet {Install-Module, Find-Module, Save-Module, Update-Module...}
Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.0.0 ADRMS {Update-ADRMS, Uninstall-ADRMS, Install-ADRMS}
Manifest 1.0.0.0 AppLocker {Set-AppLockerPolicy, Get-AppLockerPolicy, Test-AppLockerP...
Manifest 1.0 BestPractices {Get-BpaModel, Invoke-BpaModel, Get-BpaResult, Set-BpaResult}
Manifest 1.0.0.0 BitsTransfer {Add-BitsFile, Remove-BitsTransfer, Complete-BitsTransfer,...
Manifest 1.0.0.0 CimCmdlets {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance,...
Script 1.0.0.0 ISE {New-IseSnippet, Import-IseSnippet, Get-IseSnippet}
Manifest 1.0.1.0 Microsoft.PowerShell.Archive {Compress-Archive, Expand-Archive}
Manifest 3.0.0.0 Microsoft.PowerShell.Diagnostics {Get-WinEvent, Get-Counter, Import-Counter, Export-Counter...
Manifest 3.0.0.0 Microsoft.PowerShell.Host {Start-Transcript, Stop-Transcript}
Manifest 1.0.0.0 Microsoft.PowerShell.LocalAccounts {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser...
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path...
Script 1.0 Microsoft.PowerShell.ODataUtils Export-ODataEndpointProxy
Manifest 3.0.0.0 Microsoft.PowerShell.Security {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Format-List, Format-Custom, Format-Table, Format-Wide...}
Manifest 3.0.0.0 Microsoft.WSMan.Management {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredS...
Manifest 1.0.0.0 NetworkSwitchManager {Disable-NetworkSwitchEthernetPort, Enable-NetworkSwitchEt...
Manifest 1.1 PSDesiredStateConfiguration {Set-DscLocalConfigurationManager, Start-DscConfiguration,...
Script 1.0.0.0 PSDiagnostics {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WS...
Binary 1.1.0.0 PSScheduledJob {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-Jo...
Manifest 2.0.0.0 PSWorkflow {New-PSWorkflowExecutionOption, New-PSWorkflowSession, nwsn}
Manifest 1.0.0.0 PSWorkflowUtility Invoke-AsWorkflow
Manifest 1.0.0.0 ServerManager {Get-WindowsFeature, Add-WindowsFeature, Remove-WindowsFea...
Manifest 2.0.0.0 SoftwareInventoryLogging {Get-SilComputer, Get-SilComputerIdentity, Get-SilSoftware...
Manifest 1.0.0.0 TroubleshootingPack {Get-TroubleshootingPack, Invoke-TroubleshootingPack}
Manifest 1.0.0.0 WebAdministration {Start-WebCommitDelay, Stop-WebCommitDelay, Get-WebConfigu...
Directory: C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 7.0.5000.0 Microsoft.MonitoringAgent.PowerS... {Checkpoint-WebApplicationMonitoring, Get-WebApplicationMo...
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if(!('Nuget' -in (Get-PackageProvider).Name)){Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force}
Install-Module SmbShare -Force
PS C:\Windows\system32> install-module smbshare
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'smbshare'.
Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Option 4:
PS C:\Windows\system32> Install-Module -Name Find-SMBShare
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y
PS C:\Windows\system32> find-smbshare
ComputerName Status Total AdminShare PrinterShare NotAdmin NotAdminShare
Share Found
------------ ------ ----- ---------- ------------ -------- -------------
TESTSERVER0005 Connected 5 {ADMIN$, C$, D$, IPC$... False
Categories: