New-SmbShare
New-SmbShare
Creates a new Server Message Block (SMB) share.
Sintassi
Parameter Set: CreateShare0
New-SmbShare [-Name] <String> [-Path] <String> [[-ScopeName] <String> ] [-AsJob] [-CachingMode <CachingMode> ] [-CATimeout <UInt32> ] [-ChangeAccess <String[]> ] [-CimSession <CimSession[]> ] [-ConcurrentUserLimit <UInt32> ] [-ContinuouslyAvailable <Boolean> ] [-Description <String> ] [-EncryptData <Boolean> ] [-FolderEnumerationMode <FolderEnumerationMode> ] [-FullAccess <String[]> ] [-NoAccess <String[]> ] [-ReadAccess <String[]> ] [-Temporary] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descrizione dettagliata
The New-SMBShare cmdlet exposes a file system folder to remote clients as a new Server Message Block (SMB) share.
To delete a share that was created by this cmdlet, use the Remove-SMBShare cmdlet.
Parametri
-AsJob
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-CachingMode<CachingMode>
Specifies the caching mode of the offline files for the SMB share. There are five different caching modes:
-- None: Prevents users from storing documents and programs offline.
-- Manual: Allows users to identify the documents and programs they want to store offline.
-- Programs: Automatically stores documents and programs offline.
-- Documents: Automatically stores documents offline.
-- BranchCache: Enables BranchCache and manual caching of documents on the shared folder.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-CATimeout<UInt32>
Specifies the continuous availability timeout for the share.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-ChangeAccess<String[]>
Specifies which user will be granted modify permission to access the share. Multiple users can be specified by using a comma-separated list.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-CimSession<CimSession[]>
Esegue il cmdlet in una sessione remota o in un computer remoto. Immettere un nome di computer o un oggetto di sessione, ad esempio l'output del cmdlet New-CimSession o Get-CimSession. Il valore predefinito è la sessione corrente nel computer locale.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-ConcurrentUserLimit<UInt32>
Specifies the maximum number of concurrently connected users that the new SMB share may accommodate. If this parameter is set to zero (0), then the number of users is unlimited. The default value is zero (0).
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-ContinuouslyAvailable<Boolean>
Indicates that the share is continuously available.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Description<String>
Specifies an optional description of the new SMB share. A description of the share is displayed by running the Get-SmbShare cmdlet. The description may not contain more than 256 characters. The default value no description, or an empty description
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-EncryptData<Boolean>
Indicates that the share is encrypted.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-FolderEnumerationMode<FolderEnumerationMode>
Specifies which files and folders in the new SMB share are visible to users. I valori accettabili per questo parametro sono:
-- AccessBased: SMB will not the display the files and folders for a share to a user unless that user has rights to access the files and folders. By default, access-based enumeration is disabled for new SMB shares.
-- Unrestricted: SMB will display files and folders to a user even when the user does not have permission to access the items.
The default value is Unrestricted.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-FullAccess<String[]>
Specifies which accounts are granted full permission to access the share. Use a comma-separated list to specify multiple accounts. An account may not be specified more than once in the FullAccess, ChangeAccess, or ReadAccess parameter lists, but may be specified once in the FullAccess, ChangeAccess, or ReadAccess parameter list and once in the NoAccess parameter list.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Name<String>
Specifies a name for the new SMB share. The name may be composed of any valid file name characters, but must be less than 80 characters in length. The names pipe
and mailslot
are reserved for use by the computer.
Alias |
nessuno |
Obbligatorio? |
true |
Posizione? |
2 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
True (ByPropertyName) |
Accetta caratteri jolly? |
false |
-NoAccess<String[]>
Specifies which accounts are denied access to the share. Multiple accounts can be specified by supplying a comma-separated list.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Path<String>
Specifies the path to the location of the folder to share. The path must be fully qualified; relative paths or paths that contain wildcard characters are not permitted.
Alias |
nessuno |
Obbligatorio? |
true |
Posizione? |
3 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
True (ByPropertyName) |
Accetta caratteri jolly? |
false |
-ReadAccess<String[]>
Specifies which user is granted read permission to access the share. Multiple users can be specified by supplying a comma-separated list.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-ScopeName<String>
Specifies the scope name of the share.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
4 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
True (ByPropertyName) |
Accetta caratteri jolly? |
false |
-Temporary
Specifies the lifetime of the new SMB share. A temporary share does not persist beyond the next reboot of the computer. By default, new SMB shares are persistent, and non-temporary.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-ThrottleLimit<Int32>
Specifica il numero massimo di operazioni simultanee che è possibile stabilire per eseguire il cmdlet. Se il parametro viene omesso o si specifica il valore 0
, Windows PowerShell® calcola un valore limite ottimale per il cmdlet basato sul numero di cmdlet CIM in esecuzione nel computer. Questo valore limite si applica solo al cmdlet corrente, non alla sessione o al computer.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
False |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
False |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
<CommonParameters>
Questo cmdlet supporta i parametri comuni: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Per altre informazioni, vedere about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Input
Il tipo di input è il tipo degli oggetti che è possibile reindirizzare al cmdlet.
- None
Output
Il tipo di output corrisponde al tipo di oggetti generati dal cmdlet.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/SMB/MSFT_SmbShare
L'oggetto
Microsoft.Management.Infrastructure.CimInstance
è una classe wrapper per la visualizzazione di oggetti Strumentazione gestione Windows (WMI). Il percorso dopo il segno del cancelletto (#
) fornisce lo spazio dei nomi e il nome della classe per l'oggetto WMI sottostante.
The MSFT_SmbShare object represents the new SMB share.
Esempi
EXAMPLE 1
This example creates a new SMB share.
PS C:\> New-SmbShare –Name VMSFiles –Path C:\ClusterStorage\Volume1\VMFiles -FullAccess Contoso\Administrator, Contoso\Contoso-HV1$
EXAMPLE 2
This example creates a new encrypted SMB share.
PS C:\> New-SmbShare -Name Data -Path J:\Data -EncryptData $true