PackageDeployment Module Help

Package Deployment Module

Connect-SmbShare Cmdlet

Version 3.1.0.0

Connect-SmbShare

Synopsis

Connects a SMB share to a network drive (net use)

Syntax

Connect-SmbShare [-ShareName] <String> [[-Username] <String>] [[-Password] <String>] [[-Drive] <String>] [-Persistent] [-PreventUninstall] [[-Context] <String>] [-ContinueOnError] [<CommonParameters>]

Description

Connects a SMB share to a network drive (net use).

Parameters

-SmbShare <String>

The resource to access.

Required

True

Position

1

Accepts pipeline input

False

-UserName <String>

The user account under which the connection should be established. Data can be input as follows: <Username> , <Domain>\<Username>

Required

False

Position

2

Accepts pipeline input

False

-Password <String>

The password for the selected user account

Required

False

Position

3

Accepts pipeline input

False

-Drive <String>

The drive letter to assign

Required

False

Position

4

Accepts pipeline input

False

-Persistent <SwitchParameter>

If used, the drive will be connected permanently (will be reconnected after a reboot)

Required

False

Position

Named

Accepts pipeline input

False

-PreventUninstall <SwitchParameter>

If used, the drive will not be disconnected during uninstall

Required

False

Position

Named

Accepts pipeline input

False

-Context <String>

User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user.
UserPerService: User-related command, execution in Service context.
Computer: Execution under user account; logging in HKEY_CURRENT_MACHINE, i.e. for the computer.
ComputerPerService: Execution in service context; logging in HKEY_LOCAL_MACHINE, i.e. for the computer.

Required

False

Position

1

Accepts pipeline input

False

-ContinueOnError <SwitchParameter>

If switch is used the script won't abort if an error occurs

Required

False

Position

Named

Accepts pipeline input

False

<CommonParameters>

For more information about common parameters, type "Get-Help about_CommonParameters".