-
Notifications
You must be signed in to change notification settings - Fork 3
Set‐SMBSecurityGroup
Replaces the Group in a SecurityDescriptor.
Set-SMBSecurityGroup [-SecurityDescriptor] <PSObject> [[-Account] <String>] [-PassThru] [<CommonParameters>]
Replaces the Group in a SecurityDescriptor.
PS C:\> $SD = Get-SMBSecurity -SecurityDescriptorName SrvsvcDefaultShareInfo
PS C:\> Set-SMBSecurityGroup -SecurityDescriptor $SMBSec -Account "Administrators"
Changes the primary group of the SrvsvcDefaultShareInfo SMB SecurityDescriptor to the Administrators group.
WARNING! Extreme caution should be used when chaning SMB SecurityDescriptor group!
The group name. String SID or account/group name, [System.Security.Principal.NTAccount], [System.Security.Principal.SecurityIdentifier] (SID), [SMBSecAccount], and ,[SMBSecGroup] objects are accepted. Strings accept input in '[username|group]', 'domain\[username|group]', and '[username|group]@domain' format.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Returns 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: False
The 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: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Development on this project has ended in a pre-release state. Please use with extreme caution! |
This project can be used AS-IS, with no warranties, guarantees, or support of any kind! A registry setting backup file is created prior to any change being committed. Use that reg file to restore the previous state, then restart the Server (LanmanServer) service to restore the old security state. |
📝 NOTE |
---|
The -ComputerName parameter is currently not supported! Please use PSRemoting to manage servers remotely. |