Backup‐SMBSecurity - microsoft/SMBSecurity GitHub Wiki
Creates a file-based copy of an SMB SecurityDescriptor (SD).
Backup-SMBSecurity [[-SecurityDescriptorName] <String[]>] [[-Path] <String>] [-RegOnly] [-WithReg]
[-FilePassThru] [<CommonParameters>]
Creates a file-based copy of an SMB SecurityDescriptor (SD). Individual SMB SDs are written as XML files. A full, or registry, backup file is written as a REG file. These files can by used by Restore-SMBSecurity to quickly revert changes. When no backup path is set the automatic backup path is used: %LOCALAPPDATA%\SMBSecurity.
PS C:\> Backup-SMBSecurityBacks up all SMB Security Descriptors (SD) individually. A total of 14 XML files will be created in the automatic backup path %LOCALAPPDATA%\SMBSecurity (PowerShell: $ENV:LOCALAPPDATA\SMBSecurity).
PS C:\> Backup-SMBSecurity -RegOnlyBacks up all SMB Security Descriptors (SD) to a single REG file. The files will be saved to the automatic backup path, %LOCALAPPDATA%\SMBSecurity.
PS C:\> Backup-SMBSecurity -SecurityDescriptorName SrvsvcDefaultShareInfo -Path C:\Backups\SMBSecurity -WithRegBacks up the SrvsvcDefaultShareInfo SMB SecurityDescriptor to an XML file, and all SMB Security Descriptors (SD) to a single REG file. The files will be saved to the custom backup path, C:\Backups\SMBSecurity.
PS C:\> $files = Backup-SMBSecurity -Path C:\Backups\SMBSecurity -WithReg -FilePassThruAll SMB SecurityDescriptor will be backed up individually to XML files and as a single REG file. The files will be saved to the custom backup path, C:\Backups\SMBSecurity. The full file paths will be returned and stored in the $files variable.
Returns an array of full paths to each file created by Backup-SMBSecurity.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSets the backup path. The automatic backup path (%LOCALAPPDATA%\SMBSecurity) is used when the path is not set or is invalid.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOnly a full registry export-based backup is created. Individual backups using XML files are not created.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe name(s) of the SMB SecurityDescriptor(s) to be backed up. The valid set of names are: SrvsvcConfigInfo, SrvsvcConnection, SrvsvcFile, SrvsvcServerDiskEnum, SrvsvcSessionInfo, SrvsvcShareAdminConnect, SrvsvcShareAdminInfo, SrvsvcShareChange, SrvsvcShareConnect, SrvsvcShareFileInfo, SrvsvcSharePrintInfo, SrvsvcStatisticsInfo, SrvsvcTransportEnum, and SrvsvcDefaultShareInfo.
Type: String[]
Parameter Sets: (All)
Aliases: SDName, Name
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseCreates a full registry export-based backup in addition to the individual XML-based backup.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.