Rename Labels

731 views
Skip to first unread message

Zak Fleming

unread,
Sep 6, 2017, 4:01:07 AM9/6/17
to GAM for G Suite

Hello,

Is there a way to rename labels in GAM please?

Thanks

Ross Scroggs

unread,
Sep 6, 2017, 8:28:37 AM9/6/17
to google-ap...@googlegroups.com
Zak,

gam <UserTypeEntity> update label [search <RegularExpression>] [replace <LabelReplacement>] [merge]

At it's simplest, <RegularExpression> is the old label name, and <LabelReplacement> is the new label name.
To change the label "Foo" to a new label "Bar": gam user us...@domain.com update label search "Foo" replace "Bar"
The label "Bar" must not already exist.

To change the label "Foo" to an existing label "Bar": gam user us...@domain.com update label search "Foo" replace "Bar" merge

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/dfb74e58-c9dd-4bc0-a505-36b91349ae84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zak Fleming

unread,
Sep 6, 2017, 1:38:00 PM9/6/17
to GAM for G Suite
Thanks very much.

We have migrated users from Office 365 and they had sub folders under the Inbox so there are loads of labels name INBOX/name1 INBOX/name2 etc. If there a way to do a find and replace for INBOX please?

Thanks

On Wednesday, 6 September 2017 13:28:37 UTC+1, Ross Scroggs wrote:
Zak,

gam <UserTypeEntity> update label [search <RegularExpression>] [replace <LabelReplacement>] [merge]

At it's simplest, <RegularExpression> is the old label name, and <LabelReplacement> is the new label name.
To change the label "Foo" to a new label "Bar": gam user us...@domain.com update label search "Foo" replace "Bar"
The label "Bar" must not already exist.

To change the label "Foo" to an existing label "Bar": gam user us...@domain.com update label search "Foo" replace "Bar" merge

Ross

On Sep 6, 2017, at 1:01 AM, Zak Fleming <flem...@wardletrust.co.uk> wrote:


Hello,

Is there a way to rename labels in GAM please?

Thanks

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Ross Scroggs

unread,
Sep 6, 2017, 2:01:05 PM9/6/17
to google-ap...@googlegroups.com
Zak,

Do you want INBOX/name1 to just become the label name1?
If so, the following should work. Test on a sample user!!

gam user test...@domain.com update label search "INBOX/(.*)" replace "%s"

search takes a Python regular expression, so, in this case it will match INBOX/whatever and remember whatever.
replace is the new label name, %s will be replaced by the data remembered by search

You could also do something like this if you wanted to nest the Office 365 labels under a common label.
gam user test...@domain.com add label O365
gam user test...@domain.com update label search "INBOX/(.*)" replace "O365/%s"

Ross

On Wed, Sep 6, 2017 at 10:37 AM, Zak Fleming <flem...@wardletrust.co.uk> wrote:
Thanks very much.

We have migrated users from Office 365 and they had sub folders under the Inbox so there are loads of labels name INBOX/name1 INBOX/name2 etc. If there a way to do a find and replace for INBOX please?

Thanks

On Wednesday, 6 September 2017 13:28:37 UTC+1, Ross Scroggs wrote:
Zak,

gam <UserTypeEntity> update label [search <RegularExpression>] [replace <LabelReplacement>] [merge]

At it's simplest, <RegularExpression> is the old label name, and <LabelReplacement> is the new label name.
To change the label "Foo" to a new label "Bar": gam user us...@domain.com update label search "Foo" replace "Bar"
The label "Bar" must not already exist.

To change the label "Foo" to an existing label "Bar": gam user us...@domain.com update label search "Foo" replace "Bar" merge

Ross

On Sep 6, 2017, at 1:01 AM, Zak Fleming <flem...@wardletrust.co.uk> wrote:


Hello,

Is there a way to rename labels in GAM please?

Thanks

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Zak Fleming

unread,
Sep 6, 2017, 2:27:39 PM9/6/17
to GAM for G Suite
Hey,

Using these commands works (to a point)
gam user test...@domain.com add label O365
gam user test...@domain.com update label search "INBOX/(.*)" replace "O365/%s"

It does however pickup some labels that are nested in another label. Is it possible to set it to only pickup labels in the root please?

Thanks very much for your help, its much appreciated.

Zak
Zak,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Ross Scroggs

unread,
Sep 6, 2017, 2:32:09 PM9/6/17
to google-ap...@googlegroups.com
Zak,

Give me an example of what you want to change and what you don't want to change.

Ross

Zak,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Zak Fleming

unread,
Sep 6, 2017, 2:42:32 PM9/6/17
to GAM for G Suite
Hello

These are generally emails from an old employee that have been moved into a folder of someone else.

EG:

"old employee name"
--- "Inbox"
--- "sent"

It picks up that sub folder called inbox.

Thanks for the help.
Zak,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Ross Scroggs

unread,
Sep 6, 2017, 2:54:41 PM9/6/17
to google-ap...@googlegroups.com
Zak,

Try: gam user test...@domain.com update label search "^INBOX/(.*)" replace "O365/%s"
The ^ anchors the search such that INBOX must appear at the beginning (although in your example it may still match the nested Inbox)

Ross

Zak,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Zak Fleming

unread,
Sep 6, 2017, 3:01:57 PM9/6/17
to GAM for G Suite
Thanks, will try now.
Zak,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Zak Fleming

unread,
Sep 6, 2017, 3:24:11 PM9/6/17
to GAM for G Suite
Works! Thanks very much
Reply all
Reply to author
Forward
0 new messages