다음을 통해 공유


New-CustomPermissions

Creates an ad-hoc protection policy for custom permissions.

구문

Default (기본값)

New-CustomPermissions
    -Users <String[]>
    -Permissions <Permissions>
    [-ExpirationDate <DateTime>]

Description

The New-CustomPermissions cmdlet creates an ad-hoc protection policy object for custom permissions that you store as a variable and then use to protect a file or files when you run the labeling cmdlet, Set-FileLabel.

If the label that is applied is configured for protection settings, the custom permissions from the ad-hoc protection policy replace the protection settings from the label.

예제

Example 1 - Create an ad-hoc protection policy object for a single user

PS C:\> $permissions = New-CustomPermissions -Users user1@contoso.com -Permissions Viewer

This command creates an ad-hoc protection policy object that grants user1 from contoso.com usage rights from the Reviewer permissions and stores this policy in a variable named permissions. This ad-hoc protection policy can then be used to apply protection to a file or files.

There is no output displayed for this command.

Example 2 - Create an ad-hoc protection policy object for multiple users and that has an expiration date

PS C:\> $permissions = New-CustomPermissions -Users user1@contoso.com, user2@vanarsdel.com -Permissions Reviewer -ExpirationDate (Get-Date -Month 1 -Day 1 -Year 2020)

This command creates an ad-hoc protection policy object that grants users from different organizations usage rights from the Reviewer permissions, and also applies an expiration date. The ad-hoc protection policy object is stored in a variable named permissions, which can then be used to apply this protection to a file or files.

There is no output displayed for this command.

매개 변수

-ExpirationDate

Specifies an expiration date for the ad-hoc protection policy.

After this expiry date, the specified users will no longer be able to access the file or files. However, the owner and a super user can always access the file, even after the expiry period is reached.

매개 변수 속성

형식:DateTime
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Permissions

Specifies a permissions level that groups usage rights that are typically used together. Use this parameter and the Users parameter to grant usage rights to specified users.

To see which individual usage rights are included in each of the permissions levels, see Rights included in permission levels.

매개 변수 속성

형식:Permissions
Default value:None
허용되는 값:Viewer, Reviewer, CoAuthor, CoOwner
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:True
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Users

Specifies users who will have rights to use the file or files. Use this parameter and the Permission parameter to grant rights to specified users or groups.

매개 변수 속성

형식:

String[]

Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:True
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

입력

None

출력

System.Object