Problem with undelete command

284 views
Skip to first unread message

Scott Bedrick

unread,
Aug 9, 2018, 6:06:02 PM8/9/18
to GAM for G Suite

I am attempting to use the undelete command but it doesn’t seem to be working.  Just to back up, in the last 3 days, we have loaded 120,000 users into our domain using GAM scripts and we have deleted 120,000 users.  Today I wanted to undelete a user so I used the following command:


Gam undelete user John...@mydomain.com


I get the following and then nothing.


Looking up UID for john...@mydomain.com


I have to Ctrl-C to break out and back to a command prompt.  Could it be the sheer number of deleted users that is causing the issue? 

Jay Lee

unread,
Aug 9, 2018, 6:22:47 PM8/9/18
to google-ap...@googlegroups.com
Yes. The undelete API call must know the I'd of the user to undelete (because you may have deleted the same email  address multiple times). The only way to get the id is to list out all deleted users which will take a very long time in your case. I'd suggest listing them all out with:

gam print users deleted_only id todrive

This should give you a spreadsheet of deleted users and their id. Then you can undelete a user with:

gam undelete user id:<id>

And save on the (very expensive) user email -> id look up.

Jay 

--
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/433e8317-5f88-489a-b687-a0ce0fa4002c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Bedrick

unread,
Aug 10, 2018, 12:06:57 PM8/10/18
to GAM for G Suite
Thanks for the quick reply Jay

I am still not able to get the undelete to work.  I ran the report and can see two fields, promarEmail and id, I assume that I need to pass the ID to the undelete command but I'm not having any luck.  can you give me an example of the command?  I assume that I need to somehow pass the unique ID number I have tried:

gam undelete user j...@domain.com id:000044444440000
or
gam undelete user id:00000444444400000
or 
gam undelete user 00000004444444000000

Gam keeps appending the domain to the end of the ID


On Thursday, August 9, 2018 at 6:22:47 PM UTC-4, Jay Lee wrote:
Yes. The undelete API call must know the I'd of the user to undelete (because you may have deleted the same email  address multiple times). The only way to get the id is to list out all deleted users which will take a very long time in your case. I'd suggest listing them all out with:

gam print users deleted_only id todrive

This should give you a spreadsheet of deleted users and their id. Then you can undelete a user with:

gam undelete user id:<id>

And save on the (very expensive) user email -> id look up.

Jay 

On Thu, Aug 9, 2018, 6:06 PM 'Scott Bedrick' via GAM for G Suite <google-ap...@googlegroups.com> wrote:

I am attempting to use the undelete command but it doesn’t seem to be working.  Just to back up, in the last 3 days, we have loaded 120,000 users into our domain using GAM scripts and we have deleted 120,000 users.  Today I wanted to undelete a user so I used the following command:


Gam undelete user John...@mydomain.com


I get the following and then nothing.


Looking up UID for john...@mydomain.com


I have to Ctrl-C to break out and back to a command prompt.  Could it be the sheer number of deleted users that is causing the issue? 

--
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,
Aug 10, 2018, 12:13:48 PM8/10/18
to google-ap...@googlegroups.com
Scott,

$ gam version

GAM 4.60 - https://git.io/gam

...

The second form is what you want: gam undelete user id:123456789

Note that the first is not appending the domain

$ gam undelete user id:123456789

Undeleting account for 123456789


ERROR: 400: Bad Request - badRequest


$ gam undelete user 123456789

Looking up UID for 1234...@rdschool.org...


ERROR: could not find deleted user with that address.


Ross


On Fri, Aug 10, 2018 at 9:07 AM 'Scott Bedrick' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
Thanks for the quick reply Jay

I am still not able to get the undelete to work.  I ran the report and can see two fields, promarEmail and id, I assume that I need to pass the ID to the undelete command but I'm not having any luck.  can you give me an example of the command?  I assume that I need to somehow pass the unique ID number I have tried:

gam undelete user j...@domain.com id:000044444440000
or
gam undelete user id:00000444444400000
or 
gam undelete user 00000004444444000000

Gam keeps appending the domain to the end of the ID


On Thursday, August 9, 2018 at 6:22:47 PM UTC-4, Jay Lee wrote:
Yes. The undelete API call must know the I'd of the user to undelete (because you may have deleted the same email  address multiple times). The only way to get the id is to list out all deleted users which will take a very long time in your case. I'd suggest listing them all out with:

gam print users deleted_only id todrive

This should give you a spreadsheet of deleted users and their id. Then you can undelete a user with:

gam undelete user id:<id>

And save on the (very expensive) user email -> id look up.

Jay 

On Thu, Aug 9, 2018, 6:06 PM 'Scott Bedrick' via GAM for G Suite <google-ap...@googlegroups.com> wrote:

I am attempting to use the undelete command but it doesn’t seem to be working.  Just to back up, in the last 3 days, we have loaded 120,000 users into our domain using GAM scripts and we have deleted 120,000 users.  Today I wanted to undelete a user so I used the following command:


Gam undelete user John...@mydomain.com


I get the following and then nothing.


Looking up UID for john...@mydomain.com


I have to Ctrl-C to break out and back to a command prompt.  Could it be the sheer number of deleted users that is causing the issue? 

--
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.

--
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.

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


--

Ullfig, Roberto Alfredo

unread,
Aug 10, 2018, 12:48:04 PM8/10/18
to google-ap...@googlegroups.com

If it helps, I’m using 3.7 and had no issue with undelete using this format:

 

gam undelete user user@domain

 

Looking up UID for …

Undeleting account for …

 

However, I’m not sure if it worked or if it needs more time.

 

---

Roberto Ullfig - rul...@uic.edu

Systems Administrator

Enterprise Architecture and Development | ACCC

University of Illinois - Chicago

Scott Bedrick

unread,
Aug 10, 2018, 1:08:41 PM8/10/18
to GAM for G Suite
I am not able to use the standard 

gam undelete user user@domain

because I have recently deleted 120,000 IDs so that command just sit's for ever.  I need to undelete the email address by it's unique ID.  That's where I am having issues.

I just updated to gam 4.60, but the command is still failing

gam undelete user id:12345

ERROR:  400:  Invalid Imput: 12345 - invalid

Thanks Scott

Ross Scroggs

unread,
Aug 10, 2018, 1:17:54 PM8/10/18
to google-ap...@googlegroups.com
Scott,

What does this do: gam info user id:12345

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.

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


--

Scott Bedrick

unread,
Aug 10, 2018, 2:28:15 PM8/10/18
to GAM for G Suite
I get the following:

$ ./gam info user id:106414075101073000000

ERROR: 404: Resource Not Found: userKey - userNotFound


On Friday, August 10, 2018 at 1:17:54 PM UTC-4, Ross Scroggs wrote:
Scott,

What does this do: gam info user id:12345

Ross

On Fri, Aug 10, 2018 at 10:08 AM 'Scott Bedrick' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
I am not able to use the standard 

gam undelete user user@domain

because I have recently deleted 120,000 IDs so that command just sit's for ever.  I need to undelete the email address by it's unique ID.  That's where I am having issues.

I just updated to gam 4.60, but the command is still failing

gam undelete user id:12345

ERROR:  400:  Invalid Imput: 12345 - invalid

Thanks Scott

On Thursday, August 9, 2018 at 6:06:02 PM UTC-4, Scott Bedrick wrote:

I am attempting to use the undelete command but it doesn’t seem to be working.  Just to back up, in the last 3 days, we have loaded 120,000 users into our domain using GAM scripts and we have deleted 120,000 users.  Today I wanted to undelete a user so I used the following command:


Gam undelete user John...@mydomain.com


I get the following and then nothing.


Looking up UID for john...@mydomain.com


I have to Ctrl-C to break out and back to a command prompt.  Could it be the sheer number of deleted users that is causing the issue? 

--
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,
Aug 10, 2018, 4:14:03 PM8/10/18
to google-ap...@googlegroups.com
Scott,

$ gam delete user id:112268042003882501048

Deleting account for 112268042003882501048

$ gam undelete user id:112268042003882501048

Undeleting account for 112268042003882501048


How long ago was the user deleted?


Ross


On Fri, Aug 10, 2018 at 11:28 AM 'Scott Bedrick' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
I get the following:

$ ./gam info user id:106414075101073000000

ERROR: 404: Resource Not Found: userKey - userNotFound


On Friday, August 10, 2018 at 1:17:54 PM UTC-4, Ross Scroggs wrote:
Scott,

What does this do: gam info user id:12345

Ross

On Fri, Aug 10, 2018 at 10:08 AM 'Scott Bedrick' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
I am not able to use the standard 

gam undelete user user@domain

because I have recently deleted 120,000 IDs so that command just sit's for ever.  I need to undelete the email address by it's unique ID.  That's where I am having issues.

I just updated to gam 4.60, but the command is still failing

gam undelete user id:12345

ERROR:  400:  Invalid Imput: 12345 - invalid

Thanks Scott

On Thursday, August 9, 2018 at 6:06:02 PM UTC-4, Scott Bedrick wrote:

I am attempting to use the undelete command but it doesn’t seem to be working.  Just to back up, in the last 3 days, we have loaded 120,000 users into our domain using GAM scripts and we have deleted 120,000 users.  Today I wanted to undelete a user so I used the following command:


Gam undelete user John...@mydomain.com


I get the following and then nothing.


Looking up UID for john...@mydomain.com


I have to Ctrl-C to break out and back to a command prompt.  Could it be the sheer number of deleted users that is causing the issue? 

--
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.


--

--
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.

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


--

Kendrick Chan

unread,
Aug 10, 2018, 4:57:07 PM8/10/18
to google-ap...@googlegroups.com
Hi,

Is this API available in GAM to pull the email count for a User's mailbox?


num_emails_exchangedintegerThe total number of emails exchanged. This is the total of num_emails_sent and num_emails_received.




Thanks
Ken

Greg Haverkamp

unread,
Aug 10, 2018, 4:59:21 PM8/10/18
to google-ap...@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-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.
Reply all
Reply to author
Forward
0 new messages