Skip to main content
Version: 2.2.0

Invoke-MtSysvolSmbClient

SYNOPSIS​

Invokes smbclient with bounded execution and protected credentials.

SYNTAX​

Invoke-MtSysvolSmbClient [-Server] <String> [-Domain] <String> [[-Credential] <PSCredential>]
[-Arguments] <String[]> [[-TimeoutSeconds] <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION​

Creates a mode-600 smbclient authentication file when explicit credentials exist, invokes smbclient without a shell, enforces a timeout, and removes the authentication file in a finally block. Kerberos is used when no explicit credential is present.

EXAMPLES​

EXAMPLE 1​

Invoke-MtSysvolSmbClient -Server 'dc.contoso.com' -Domain 'contoso.com' -Arguments @('--command', 'ls')

PARAMETERS​

-Server​

Resolved domain controller DNS name.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Domain​

Resolved Active Directory DNS domain.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Credential​

Session credential used for SYSVOL access.

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Arguments​

Non-secret smbclient arguments following the share name.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TimeoutSeconds​

Maximum duration of the smbclient process.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: 60
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction​

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters​

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS​

OUTPUTS​

System.Management.Automation.PSObject​

NOTES​