< Back

Add-GcIamPolicyBinding

Mon Jan 13, 2020 11:02 pm

NAME Add-GcIamPolicyBinding



SYNOPSIS

Adds an IAM policy binding to a project.





SYNTAX

Add-GcIamPolicyBinding [-Project <string>] -User <string> [<CommonParameters>]



Add-GcIamPolicyBinding [-Project <string>] -ServiceAccount <string> [<CommonParameters>]



Add-GcIamPolicyBinding [-Project <string>] -Group <string> [<CommonParameters>]



Add-GcIamPolicyBinding [-Project <string>] -Domain <string> [<CommonParameters>]





DESCRIPTION

Adds an IAM policy binding to a project. The cmdlet will use the default project if -Project is not used.





PARAMETERS

-Project <string>

The project for the IAM Policy Bindings. If not set via PowerShell parameter processing, will default to the

Cloud SDK's DefaultProject property.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-User <string>

Email address that represents a specific Google account.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ServiceAccount <string>

Email address that represents a service account.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Group <string>

Email address that represents a Google group.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Domain <string>

A Google Apps domain name that represents all the users of that domain.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



---------- EXAMPLE 1 ----------



PS C:\\> Add-GcIamPolicyBinding -Role roles/owner -User abc@google.com -Project "my-project"



This command gives user abc@google.com owner role in the project "my-project".

---------- EXAMPLE 2 ----------



PS C:\\> Add-GcIamPolicyBinding -Role roles/container.admin -Group my-group@google.com



This command gives the group my-group@google.com container admin role in the default project.

---------- EXAMPLE 3 ----------



PS C:\\> Add-GcIamPolicyBinding -Role roles/container.admin `

-ServiceAccount service@project.iam.gserviceaccount.com



This command gives the serviceaccount service@project.iam.gserviceaccount.com container admin role in the default

project.

---------- EXAMPLE 4 ----------



PS C:\\> Add-GcIamPolicyBinding -Role roles/editor -Domain example.com



This command gives all users of the domain example.com editor role in the default project.



RELATED LINKS

[Google Cloud IAM] (https://cloud.google.com/iam/docs/overview)