taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
729 stars 85 forks source link

Based on account profile information group memberships #233

Closed tacimbulut closed 2 years ago

tacimbulut commented 2 years ago

Hi, When I run the code below

gam update group member test1@tacimbulut.com add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

taers232c commented 2 years ago

This is not a vaild command: gam update group member @. @.> add nosuspend query "costCenter!=ee" I'm not clear what you want. Are you tryiing to update a group, user?

Ross

@.***

On Jan 21, 2022, at 5:53 AM, tacimbulut @.***> wrote:

Hi, When I run the code below

gam update group member @. @.> add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL525PVNZVBUOW3TQPTUXFQNDANCNFSM5MPSQ6GQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.

tacimbulut commented 2 years ago

I'm trying create a dynamic group. While I do this I want able to remove a user "costCenter" different from a group. So this group i create become hold all same "costCenter" users in group. I use the code down below add user to group i create. "gam update group @.*** add member query "costCenter=ee""

Ross Scroggs @.***>, 21 Oca 2022 Cum, 17:53 tarihinde şunu yazdı:

This is not a vaild command: gam update group member @. @.> add nosuspend query "costCenter!=ee" I'm not clear what you want. Are you tryiing to update a group, user?

Ross

@.***

On Jan 21, 2022, at 5:53 AM, tacimbulut @.***> wrote:

Hi, When I run the code below

gam update group member @. @.> add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACCTYL525PVNZVBUOW3TQPTUXFQNDANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.

You are receiving this because you are subscribed to this thread.

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018581042, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGHXNUTRCLAHZOSZ2RVI7LUXFXN5ANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

-- Kayaları delen damlaların büyüklüğü değil sürekliliğidir...

taers232c commented 2 years ago

Here is the query documentation: https://developers.google.com/admin-sdk/directory/v1/guides/search-users This updates the group with members from Cost Center ee gam update group @.*** add member query "orgCostCenter=ee"

Are you trying to remove members as well?

Ross

On Fri, Jan 21, 2022 at 9:32 AM tacimbulut @.***> wrote:

I'm trying create a dynamic group. While I do this I want able to remove a user "costCenter" different from a group. So this group i create become hold all same "costCenter" users in group. I use the code down below add user to group i create. "gam update group @.*** add member query "costCenter=ee""

Ross Scroggs @.***>, 21 Oca 2022 Cum, 17:53 tarihinde şunu yazdı:

This is not a vaild command: gam update group member @. @.> add nosuspend query "costCenter!=ee" I'm not clear what you want. Are you tryiing to update a group, user?

Ross

@.***

On Jan 21, 2022, at 5:53 AM, tacimbulut @.***> wrote:

Hi, When I run the code below

gam update group member @. @.> add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233>, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACCTYL525PVNZVBUOW3TQPTUXFQNDANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you are subscribed to this thread.

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018581042 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ALGHXNUTRCLAHZOSZ2RVI7LUXFXN5ANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you authored the thread.Message ID: @.***>

-- Kayaları delen damlaların büyüklüğü değil sürekliliğidir...

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018718614, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLYNVU3IVAYTPS27HODUXGKCRANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- Ross Scroggs @.***

tacimbulut commented 2 years ago

Yes, i trying to remove members who doesn't equal to costCenter

21 Oca 2022 Cum 21:16 tarihinde Ross Scroggs @.***> şunu yazdı:

Here is the query documentation: https://developers.google.com/admin-sdk/directory/v1/guides/search-users This updates the group with members from Cost Center ee gam update group @.*** add member query "orgCostCenter=ee"

Are you trying to remove members as well?

Ross

On Fri, Jan 21, 2022 at 9:32 AM tacimbulut @.***> wrote:

I'm trying create a dynamic group. While I do this I want able to remove a user "costCenter" different from a group. So this group i create become hold all same "costCenter" users in group. I use the code down below add user to group i create. "gam update group @.*** add member query "costCenter=ee""

Ross Scroggs @.***>, 21 Oca 2022 Cum, 17:53 tarihinde şunu yazdı:

This is not a vaild command: gam update group member @. @.> add nosuspend query "costCenter!=ee" I'm not clear what you want. Are you tryiing to update a group, user?

Ross

@.***

On Jan 21, 2022, at 5:53 AM, tacimbulut @.***> wrote:

Hi, When I run the code below

gam update group member @. @.> add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233>, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACCTYL525PVNZVBUOW3TQPTUXFQNDANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

You are receiving this because you are subscribed to this thread.

— Reply to this email directly, view it on GitHub <

https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018581042

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ALGHXNUTRCLAHZOSZ2RVI7LUXFXN5ANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

You are receiving this because you authored the thread.Message ID: @.***>

-- Kayaları delen damlaların büyüklüğü değil sürekliliğidir...

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018718614 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACCTYLYNVU3IVAYTPS27HODUXGKCRANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you commented.Message ID: @.***>

-- Ross Scroggs @.***

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018749098, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGHXNQR25KDANCAFBN34STUXGPHDANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

taers232c commented 2 years ago

There is no not equals in query, this is not valid: query "orgCostCenter!=ee" How did those members get in the group?

Ross

On Fri, Jan 21, 2022 at 10:30 AM tacimbulut @.***> wrote:

Yes, i trying to remove members who doesn't equal to costCenter

21 Oca 2022 Cum 21:16 tarihinde Ross Scroggs @.***> şunu yazdı:

Here is the query documentation: https://developers.google.com/admin-sdk/directory/v1/guides/search-users This updates the group with members from Cost Center ee gam update group @.*** add member query "orgCostCenter=ee"

Are you trying to remove members as well?

Ross

On Fri, Jan 21, 2022 at 9:32 AM tacimbulut @.***> wrote:

I'm trying create a dynamic group. While I do this I want able to remove a user "costCenter" different from a group. So this group i create become hold all same "costCenter" users in group. I use the code down below add user to group i create. "gam update group @.*** add member query "costCenter=ee""

Ross Scroggs @.***>, 21 Oca 2022 Cum, 17:53 tarihinde şunu yazdı:

This is not a vaild command: gam update group member @. @.> add nosuspend query "costCenter!=ee" I'm not clear what you want. Are you tryiing to update a group, user?

Ross

@.***

On Jan 21, 2022, at 5:53 AM, tacimbulut @.***> wrote:

Hi, When I run the code below

gam update group member @. @.> add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233>, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACCTYL525PVNZVBUOW3TQPTUXFQNDANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

You are receiving this because you are subscribed to this thread.

— Reply to this email directly, view it on GitHub <

https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018581042

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ALGHXNUTRCLAHZOSZ2RVI7LUXFXN5ANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

You are receiving this because you authored the thread.Message ID: @.***>

-- Kayaları delen damlaların büyüklüğü değil sürekliliğidir...

— Reply to this email directly, view it on GitHub <

https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018718614

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACCTYLYNVU3IVAYTPS27HODUXGKCRANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

You are receiving this because you commented.Message ID: @.***>

-- Ross Scroggs @.***

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018749098 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ALGHXNQR25KDANCAFBN34STUXGPHDANCNFSM5MPSQ6GQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018759296, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL5ID3WWKKZJIIA5DKLUXGQ4VANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- Ross Scroggs @.***

tacimbulut commented 2 years ago

Hello again, I am not fluent in English so we couldn’t communicate. My apologies. What I am trying to do is, if the users orhcostCenter value in the profile is not on the finance group the user should be removed

21 Oca 2022 Cum 17:53 tarihinde Ross Scroggs @.***> şunu yazdı:

This is not a vaild command: gam update group member @. @.> add nosuspend query "costCenter!=ee" I'm not clear what you want. Are you tryiing to update a group, user?

Ross

@.***

On Jan 21, 2022, at 5:53 AM, tacimbulut @.***> wrote:

Hi, When I run the code below

gam update group member @. @.> add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACCTYL525PVNZVBUOW3TQPTUXFQNDANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.

You are receiving this because you are subscribed to this thread.

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018581042, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGHXNUTRCLAHZOSZ2RVI7LUXFXN5ANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

taers232c commented 2 years ago

gam config csv_output_row_drop_filter "organizations.0.costCenter:regex:^ee$" redirect csv ./EENotInGroup.csv group @. print users fields primaryemail,organizations Inspect EENotInGroup.csv, verify that is what is expected gam update group @. remove member csvfile ./EENotInGroup.csv:primaryEmail

@.***

On Jan 23, 2022, at 8:19 AM, tacimbulut @.***> wrote:

Hello again, I am not fluent in English so we couldn’t communicate. My apologies. What I am trying to do is, if the users orhcostCenter value in the profile is not on the finance group the user should be removed

21 Oca 2022 Cum 17:53 tarihinde Ross Scroggs @.***> şunu yazdı:

This is not a vaild command: gam update group member @. @.> add nosuspend query "costCenter!=ee" I'm not clear what you want. Are you tryiing to update a group, user?

Ross

@.***

On Jan 21, 2022, at 5:53 AM, tacimbulut @.***> wrote:

Hi, When I run the code below

gam update group member @. @.> add nosuspend query "costCenter!=ee"

ERROR: Invalid Query

My target is costCENTER If not entered, but that person is a member of the group, I want to remove. This much

— Reply to this email directly, view it on GitHub < https://github.com/taers232c/GAMADV-XTD3/issues/233>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACCTYL525PVNZVBUOW3TQPTUXFQNDANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.

You are receiving this because you are subscribed to this thread.

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1018581042, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGHXNUTRCLAHZOSZ2RVI7LUXFXN5ANCNFSM5MPSQ6GQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/233#issuecomment-1019518031, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL2B7WQ35ZRS3D2IGI3UXQTCFANCNFSM5MPSQ6GQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.