TestimoX

API Reference

Command

Repair-CxSmbShare

Namespace ComputerX.PowerShell
Inputs
System.String System.String[]
Outputs
ComputerX.Smb.SmbShareOwnershipRepairPlan ComputerX.Smb.SmbSharePermissionRepairPlan ComputerX.Smb.SmbShareRepairResult

Builds or applies SMB share permission and ownership repair plans.

Examples

Authored help example

Example 1: Previews a share ACL merge.

PS>


Repair-CxSmbShare -ComputerName FS01 -ShareName Finance -Identity 'CONTOSO\\Finance' -Rights Change
        

Example 2: Applies a share-root ownership repair after reviewing the plan.

PS>


Repair-CxSmbShare -ShareName Finance -Owner 'CONTOSO\\File Admins' -Apply -Confirm
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Repair-CxSmbShare [-ComputerName <string>] -ShareName <string> [-Apply] [-Deny] [-Identity <string[]>] [-Owner <string>] [-Replace] [-Rights <Read|Change|FullControl>] [<CommonParameters>]
#

Parameters

ComputerName string optionalposition: 0pipeline: true (ByPropertyName)
Target computer name. Use . for the local machine or provide a DNS/NetBIOS name.
ShareName string requiredposition: 1pipeline: true (ByPropertyName)
Share to repair.
Apply SwitchParameter optionalposition: namedpipeline: false
Applies the generated plan. Without this switch the cmdlet returns the plan only.
Deny SwitchParameter optionalposition: namedpipeline: false
Adds deny entries instead of allow entries.
Identity string[] optionalposition: namedpipeline: true (ByPropertyName)
Desired share permission identities.
Owner string optionalposition: namedpipeline: false
Desired owner for the share root.
Replace SwitchParameter optionalposition: namedpipeline: false
Replaces the share ACL instead of merging desired entries into the existing ACL.
Rights SmbShareRights optionalposition: namedpipeline: falsevalues: 3
Desired share permission rights for the identities. Possible values: Read, Change, FullControl
Possible values: Read, Change, FullControl

Outputs

ComputerX.Smb.SmbShareOwnershipRepairPlan, ComputerX.Smb.SmbSharePermissionRepairPlan, ComputerX.Smb.SmbShareRepairResult