Set‐SMBSecurityOwner - microsoft/SMBSecurity GitHub Wiki
Replaces the Owner in a SecurityDescriptor.
Set-SMBSecurityOwner [-SecurityDescriptor] <PSObject> [[-Account] <Object>] [-PassThru] [<CommonParameters>]
Replaces the Owner in a SecurityDescriptor.
PS C:\> $SD = Get-SMBSecurity -SecurityDescriptorName SrvsvcDefaultShareInfo
PS C:\> Set-SMBSecurityOwner -SecurityDescriptor $SMBSec -Account "Administrator"Changes the owner of the SrvsvcDefaultShareInfo SMB SecurityDescriptor to the Administrator account.
WARNING! Extreme caution should be used when chaning SMB SecurityDescriptor owner!
The owner name. String SID or account name, [System.Security.Principal.NTAccount], [System.Security.Principal.SecurityIdentifier] (SID), [SMBSecAccount], and ,[SMBSecGroup] objects are accepted. Strings accept input in 'username', 'domain\username', and 'user@domain' format.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseReturns the result to the success stream.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe SMBSecurityDescriptor object where the Owner will be changed. The SMBSecurityDescriptor object must originate from Get-SMBSecurity.
Type: PSObject
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
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.