-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feedback] What additional Google API's would YOU like to see added to PSGSuite? #16
Comments
How about IMAP settings to see what users are enabled? In addition, what OU's have IMAP disabled. |
@ryanfog - Getting the OU level settings for services like Gmail isn't possible at the moment via API that I'm aware of (please send any API links you have otherwise so I can check them out, it would be awesome if doable!), but pulling individual users' Gmail settings is definitely doable 👍 |
Nate are you in active development on this module? I prefer your module over GAM since the output is an actual PowerShell object that I can then do other things with compared to GAM's massive string output. |
@ryanfog yup!I took a break from this module for a while, but have been pretty active with it again since starting work on v2.0.0+. You can check the code-frequency graph to see activity. I'll work on getting an official contributing guide written up! All help is appreciated, I'd love to see full Google API coverage (at least for G Suite related API's) at some point if possible! Wanting a better experience in PowerShell than GAM provides was my initial motivation for writing this module in the first place, I totally get your pains with GAM + PowerShell! |
Quick question being a former Exchange admin now managing Google. We have the option to create contacts in Exchange. Does Google have that ability to create contacts in the Global Directory? If so can you add this feature? |
@ryanfog I want to say yes (I know it does for individual users). Checking it out! |
@ryanfog alright, so the Contacts API is part of the Google Data API's, which are all either deprecated or the libraries are no longer maintained. The GData .NET library hasn't been updated in almost 5 years and doesn't use the same auth Service mechanisms that their current API's (and PSGSuite) use, so it's going to take a bit of work to get working if even possible. There is also the Domain Shared Contacts API, but that's also part of the GData API structure from what I can tell with no available assembly to load in. I will see what I can do about possibly going the route that I took for PSGSuite v1.x.x using the Owin libraries to build an auth token and send API calls via Invoke-RestMethod instead. Updates to follow, but it won't be as quick a turnaround as it was for the Gmail Settings. |
@ryanfog Here's a different option already available as a PowerShell module from CData, in case you have something immediate to handle! https://www.powershellgallery.com/packages/GoogleContactsCmdlets/ |
Hey Nate, would it be possible to get cmdlets to remove or disable email forwarding in Gmail? Update-GSGmailAutoForwardingSettings doesn't appear to let you disable forwarding. |
@jboiselle hey Josh! The parameters for the functions in PSGSuite are typically matched to the Body object parameters the SDK expects (Body object being an AutoForwardingSettings object in this case). Because of this, the parameters may not be quite as expected, but worth keeping in mind that switch parameters like the Update-GSGmailAutoForwardingSettings -Enabled:$false |
@jboiselle - FYI, found an issue with the scope in use for that specific function (#25). Fix is complete and tested and being deployed to PowerShell Gallery as v2.2.1 as we speak though! |
@jboiselle fixed in v2.2.1! Example of setting and disabling autoforwarding: |
I have another request, I would like a way to subscribe a user to a calendar resource. The GAM version appears to be this. Thanks, |
@ryanfog you got it! Adding calendars is a no brainer, I'm on it! |
I am sure you are getting sick of my requests but what about adding an Alias into Google. Does that exist already and I was unable to find it? |
@ryanfog haha no worries at all, that's why I have this post up! User and group aliases are both doable. Adding them to the list! FYI - I'm in the process of prepping for a move right now, so my availability is a little slimmer than usual! Apologies for any delays in additional functionality! Pull requests are always accepted if you're feeling adventurous! |
@ryanfog - CalendarSubscription, Group Alias and User Alias management functions added in v2.3.0! Update when you can and you should see them there! Thanks for the suggestions, let me know how they work for you! |
Hey Nate, what about modifying custom schema attributes on users? As far as I can tell, the tools to create and modify the schemas are already here, but there does not appear to be a way to set/modify custom attributes on individual users (please correct me if I'm wrong). It looks like this is done through the Users 'patch' method in the API? |
@jboiselle I thought I'd had schema updating built-in with Update-GSUser, but checked again and you're right! The I'll work on adding it into Update-GSUser ASAP! It will likely accept a hashtable as the argument, i.e. something like this (using Google's schema as an example here): Update-GSUser -User test -Schema @{
employmentData = @{
employeeNumber = "123456789"
jobFamily = "Engineering"
location = "Atlanta"
jobLevel = 8
projects = @(
@{ value = "GeneGnome" },
@{ value = "Panopticon"; type = "work" },
@{ value = "MegaGene"; type = "custom"; customType = "secret" }
)
}
} |
One of the things I enjoyed with Exchange operations was doing something like Get-Mailbox - ResultSize 25, this would bring me back a random list of 25 mailboxes. If I did something like Get-Mailbox -All I would pull back all mailboxes. I was thinking I could run something like Get-GSUser and get everyone, but that just brings back myself. There are other commands I would like to do on a global level without doing them per user as well. Does Google have the option to pull all the users in one request, I want to be cautious of hitting any throttle limits. |
@ryanfog - I designed Get-GSUser to have as much parity with Get-ADUser as possible, so if you're looking to pull the user list, just run |
I'll check it out as soon as I'm back on a computer tonight! Would you mind
opening up a new issue for it so it's tracked outside of this issue/thread?
On Mon, Apr 16, 2018 at 2:06 PM ryanfog ***@***.***> wrote:
Nate,
In my environment which is slightly more users then yours I get this error
message.
[image: capture]
<https://user-images.githubusercontent.com/25650327/38829611-410ce284-417f-11e8-8db1-5652df9d388f.JPG>
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMIo3S930ymJTkWmE0xawqPjbC6Ra9Iqks5tpOvGgaJpZM4R-rXM>
.
--
Thank you for your time, Nate Ferrell (SCRT HQ)
|
I second interest in adding values for custom user schema! |
Also, will it be possible to query users by custom schema? I want to use an employee identifier for account syncing purposes, but I have to use custom schema because it needs to remain private to domain admins. |
@cooper - You can query by custom schema value, just follow the Users Search syntax here: https://developers.google.com/admin-sdk/directory/v1/guides/search-users Example using PSGSuite to do this with the assumption that you have a schema named "ExtraDetails" and a field in that Schema named "Location" and you are searching for users with 'Sydney' as the location: Get-GSUser -Filter "ExtraDetails.Location='Sydney'" |
@NFLEagles1 - That's awesome to hear! Probably the easiest way to submit your additions would be to send it as a pull request here; that will allow me to review what's there and offer pertinent feedback, then merge those changes into a new release with any adjustments as necessary. I can take care of updating the Wiki once merged (I have a script that regenerates the Help Docs and pushes the updates to the Wiki directly). Rough Contributing GuideStyle/Code GuidelinesAll functions must include the following in order to pass CI tests:
Pull Request How-To
|
@jboiselle & @cooper - Custom User Attribute updating working in dev, just figuring out how to also |
@jboiselle & @cooper - Custom User Attribute updating working in dev, also have clearing them working. Here are a couple options, please let me know which you feel would be easier to work with: Adding a schema value for a user
Option 1: Using a hashtable Update-GSUser -User test -CustomSchemas @{
employmentData = @{
employeeNumber = "123456789"
jobFamily = "Engineering"
}
} Option 2: Using a helper function # Schema Name: employementData
# Schema Fields: employeeNumber & jobFamily
Update-GSUser -User test -CustomSchemas (Add-GSUserCustomSchema -SchemaName employmentData -Fields @{
employeeNumber = "123456789"
jobFamily = "Engineering"
}) Clearing schema values for a user
Option 1: Using a hashtable Update-GSUser -User test -CustomSchemas @{
employmentData = @{
employeeNumber = $null
jobFamily = $null
}
} Option 2: Using a helper function # Schema Name: employementData
# Schema Fields: employeeNumber & jobFamily
Update-GSUser -User test -CustomSchemas (Add-GSUserCustomSchema -SchemaName employmentData -Fields @{
employeeNumber = $null
jobFamily = $null
}) Thoughts? |
Hi Nate, I'm not sure if the API allows, but is is possible to set Forwarding via user-level routing in the Admin console, opposed to doing it at the user level settings? Thanks, |
Hey Jeremy @jasilbs - trying to picture what you're looking to do still, but I can say that Admin level settings (i.e. Apps > G Suite > Gmail > Advanced Settings) aren't configurable through API calls at this time. Any insight on where you would make that change using the WebUI would help me confirm that better in case I'm off-mark 😃 |
@scrthq I personally wouldn't mind either way. I'm leaning towards helper function since New-GSUserSchema itself already uses a helper function already anyway. As long as it is all documented! :) |
Hi Nate,
Thanks for the quick reply.
There appear to be a few benefits to using User-Level routing (forwarding), as opposed to doing it from the users auto-forwarding mailbox options.
1. The admin can configure forwarding, while also preventing the user from having the ability to change it independently. This helps prevent the user screwing something up in the future.
2. User-Level routing forwards all mail before delivering it to the google mailbox. Setting the user based auto-forwarding only forwards the mail post mailbox delivery. When set via the auto-forward mailbox option, Spam/Junk email is not forwarded. This sounds like a good thing, but can be quite a nuisance in the case of false-positives. With Auto-Forward, users have the ability to find forwarded mail in their Archive or Trash location, depending on how the auto-forward is configured. User-Level routing leaves no trace of the mail in the G Suite Mailbox.
Forward messages to a specific recipient
1. Sign in<https://admin.google.com/> to your Google Admin console<https://support.google.com/a/answer/182076>.
Sign in using your administrator account (does not end in @gmail.com).
2. From the Admin console dashboard, go to Users.
3. In the Users list, find the user. If you need help, see Find a user account<https://support.google.com/a/answer/33324>.
4. Click the user’s name to open their account page.
5. Click User information.
6. In the Email routing section, click Configure email routing.
7. Under Email routing, click Add another destination.
8. In the new row that appears, enter the forwarding email address for the user's messages and press Enter.
9. Click Save.
Regards,
Jeremy
From: Nate Ferrell <notifications@github.com>
Sent: Monday, April 30, 2018 3:32 PM
To: scrthq/PSGSuite <PSGSuite@noreply.github.com>
Cc: jasilbs <jeremy-git@silbers.net>; Mention <mention@noreply.github.com>
Subject: Re: [scrthq/PSGSuite] [Feedback] What additional Google API's would YOU like to see added to PSGSuite? (#16)
Hey Jeremy @jasilbs<https://github.com/jasilbs> - trying to picture what you're looking to do still, but I can say that Admin level settings (i.e. Apps > G Suite > Gmail > Advanced Settings) aren't configurable through API calls at this time. Any insight on where you would make that change using the WebUI would help me confirm that better in case I'm off-mark 😃
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#16 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AlEPqLsZFKbUk6cywrcf_TSyc0PYy_pZks5tt2bNgaJpZM4R-rXM>.
|
Thanks, Jeremy! I'm not seeing any ability to configure email route through the Directory API where it would expectedly be located. The now-deprecated Admin Settings API used to be able to set that at the Org level, but the assemblies for that have not been updated in years and will not be as it stands without Google developing and releasing a full replacement. Going to keep looking for email route configuration via the Directory API in case I wasn't seeing it on first look, but everything I'm seeing now indicates it's not doable through API, unfortunately. |
@jboiselle that's my initial thought towards the helper function route (keeping the expectation the same), but in this case it adds a lot of extra typing IMHO, especially considering it would only be abstracting the top level key of the hashtable. The "fields" level hashtable would still be needed and may be less desirable syntactically. I think for this instance, I'm going to keep it as a pure Hashtable for simplicity (also since that code is ready to push). If there's natural confusion due to the expectation of the helper function, I'll revisit and update it 😄 |
@jboiselle @cooper - User Schema value management added to Update-GSUser docs also updated: https://github.com/scrthq/PSGSuite/wiki/Update-GSUser#-customschemas |
Hi Nate,
Thanks for looking into it for me.
Jeremy
From: Nate Ferrell <notifications@github.com>
Sent: Monday, April 30, 2018 4:07 PM
To: scrthq/PSGSuite <PSGSuite@noreply.github.com>
Cc: jasilbs <jeremy-git@silbers.net>; Mention <mention@noreply.github.com>
Subject: Re: [scrthq/PSGSuite] [Feedback] What additional Google API's would YOU like to see added to PSGSuite? (#16)
Thanks, Jeremy!
I'm not seeing any ability to configure email route through the Directory API where it would expectedly be located. The now-deprecated Admin Settings API<https://developers.google.com/admin-sdk/admin-settings/#managing_email_routing_settings> used to be able to set that at the Org level, but the assemblies for that have not been updated in years and will not be as it stands without Google developing and releasing a full replacement.
Going to keep looking for email route configuration via the Directory API in case I wasn't seeing it on first look, but everything I'm seeing now indicates it's not doable through API, unfortunately.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#16 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AlEPqEWveEcmkbBLQPrEs1zjQhN4OyPBks5tt27LgaJpZM4R-rXM>.
|
The API supports a Query/Filter feature for groups. Is it possible to update the functions to account for this? |
@phatmandrake - So, the odd part about that particular API call is there's no apparent Query parameter in the .NET SDK's implementation of Groups.List() like there is on the REST API directly. Without resorting back to making pure REST API calls, the implementation would need to still pull the full list of groups then filter them down by piping to a
The only similar parameter that the .NET SDK provides on Not sure how many groups you're working with or how long it takes you to pull all of them, but the API acts pretty quick for me even when returning the 1730 groups we have (~4 seconds to pull all of them):
|
Pull 2FA enrollment / settings info. Not sure if this is already included in a module and I'm just missing it. |
hey @megan201296 - you can pull 2FA/2SV enrollment/enforcement stats a few different ways, with my most preferred way going pure PowerShell filtering against the full User List
# Filter using Google's syntax
### Fastest method
### About 99% accurate
PS > $unenrolled = Get-GSUser -Filter "IsEnrolledIn2Sv=false" -Verbose
VERBOSE: Building ServiceAccountCredential from P12Key as user 'natxxxxxxxxxxxxxxxx@xxxxxxx.xxx'
VERBOSE: Getting Users for customer 'xxxxxxxxxx' matching filter: "IsEnrolledIn2Sv=False"
VERBOSE: Retrieved 500 users...
VERBOSE: Retrieved 1000 users...
VERBOSE: Retrieved 1500 users...
VERBOSE: Retrieved 2000 users...
VERBOSE: Retrieved 2500 users...
VERBOSE: Retrieved 3000 users...
VERBOSE: Retrieved 3335 users...
PS > ($unenrolled | Where-Object {$_.IsEnrolledIn2Sv}).Count
1
###
# Pull full list of users and filter by piping the results to Where-Object
### Can be slower depending on the user count matching your filter vs total user count
### 100% Accuracy
PS $unenrolled = Get-GSUser -Filter * -Verbose | Where-Object {!$_.IsEnrolledIn2Sv}
VERBOSE: Building ServiceAccountCredential from P12Key as user 'natxxxxxxxxxxxxxxxx@xxxxxxx.xxx'
VERBOSE: Getting all Users for customer 'xxxxxxxxxx'
VERBOSE: Retrieved 500 users...
VERBOSE: Retrieved 1000 users...
VERBOSE: Retrieved 1500 users...
VERBOSE: Retrieved 2000 users...
VERBOSE: Retrieved 2500 users...
VERBOSE: Retrieved 3000 users...
VERBOSE: Retrieved 3500 users...
VERBOSE: Retrieved 4000 users...
VERBOSE: Retrieved 4500 users...
VERBOSE: Retrieved 5000 users...
VERBOSE: Retrieved 5500 users...
VERBOSE: Retrieved 6000 users...
VERBOSE: Retrieved 6500 users...
VERBOSE: Retrieved 7000 users...
VERBOSE: Retrieved 7500 users...
VERBOSE: Retrieved 8000 users...
VERBOSE: Retrieved 8500 users...
VERBOSE: Retrieved 9000 users...
VERBOSE: Retrieved 9099 users...
PS > ($unenrolled | Where-Object {$_.IsEnrolledIn2Sv}).Count
0
# Useful if you need a report that includes pure numbers already
### Reports are specified by date
### Some dates don't capture every data point, including 2SV stats
PS > $usage = Get-GSUsageReport -Date (Get-Date).AddDays(-2)
PS > ($usage | Where-Object {$_.Name -like '*2SV*'})
Date : 2018-05-22
BoolValue :
DatetimeValueRaw :
DatetimeValue :
IntValue : 3555
MsgValue :
Name : accounts:num_users_2sv_enforced
StringValue :
Date : 2018-05-22
BoolValue :
DatetimeValueRaw :
DatetimeValue :
IntValue : 5763
MsgValue :
Name : accounts:num_users_2sv_enrolled
StringValue :
Date : 2018-05-22
BoolValue :
DatetimeValueRaw :
DatetimeValue :
IntValue : 3554
MsgValue :
Name : accounts:num_users_2sv_enrolled_and_enforced
StringValue :
Date : 2018-05-22
BoolValue :
DatetimeValueRaw :
DatetimeValue :
IntValue : 5528
MsgValue :
Name : accounts:num_users_2sv_not_enforced
StringValue :
Date : 2018-05-22
BoolValue :
DatetimeValueRaw :
DatetimeValue :
IntValue : 3320
MsgValue :
Name : accounts:num_users_2sv_not_enrolled
StringValue :
Date : 2018-05-22
BoolValue :
DatetimeValueRaw :
DatetimeValue :
IntValue : 3319
MsgValue :
Name : accounts:num_users_2sv_not_enrolled_and_not_enforced
StringValue :
Date : 2018-05-22
BoolValue :
DatetimeValueRaw :
DatetimeValue :
IntValue : 1
MsgValue :
Name : accounts:num_users_2sv_not_enrolled_but_enforced
StringValue : |
Love to see RoleAssignmentsResource so I can grant users admin role. Thanks! |
@nsclarkson On it! |
If it were possible, could we get a corresponding set of functions for Google Documents as PSGSuite currently has for Google Sheets? (i.e. clear, copy, export, import, new, get-info) In addition, is it possible for both sheets and documents to be converted to other file formats, like PDF? |
@queks - There's no Docs specific API like there is for Sheets, unfortunately, so you're limited to Drive File level interaction not file content interaction. This would allow you to do things like getting file metadata (via Please note that there is a current bug with |
Got it. Thank you. |
@queks - v2.6.3 has been released with the fix for issue #51 ( Regarding replication of
Worth noting that this will always return a single string, so if you need it split to replicate the behavior of
I could add a wrapper function designed specifically for this if desired, something along the lines of the following (let me know!):
Also, I should be able to get something going to allow updating of Docs, just trying to figure out how to best approach it in a way that makes sense. Some scenarios here, let me know your feedback on them:
|
Thanks Nate, didn't realize i could export a Doc that way.
As for the writing to Docs... I have to admit i'm not quite the expert. I'd
say that the first approach (sending strings) makes more sense to me,
especially if there are ways to format the text (i.e. by having
placeholders - kinda like content controls in docx). But I don't see those
in Google Docs...
I still think this way is simpler and more convenient though, as opposed to
having to stream a byte array and handle special characters. You would be
able to do string manipulation prior to updating the Google doc, so i think
its a more flexible of the two options.
…On Sat, Jun 9, 2018 at 2:22 PM Nate Ferrell ***@***.***> wrote:
@queks <https://github.com/queks> - v2.6.3 has been released with the fix
for issue #51 <#51> (
Export-GSDriveFile). Couple other useful pieces of info for you:
------------------------------
Regarding replication of Import-GSSheet for Docs; you can use the
following to pull the content of a Doc down in PlainText, effectively
pulling down that Doc's text, with the following:
Export-GSDriveFile -FileId $doc.id -Type PlainText
------------------------------
Also, I should be able to get something going to allow updating of Docs,
just trying to figure out how to best approach it in a way that makes
sense. Some scenarios here, let me know your feedback on them:
1. Writing plain text to a doc (i.e. logging, etc).
- This would be similar to Out-File and would support an -Append
switch to attach new strings to the end of the file.
- This would be limited to *PlainText only*
2. Pull in an existing file as a byte array and update the file in
Drive
- This would allow updating of any file type, including binary files
- No option to send strings directly, but not limited to PlainText
either
- This would be literally updating a Drive file's content with a
local file's content.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AggCMujffs9cttnWiqDsgKD_3rF7kxywks5t62mQgaJpZM4R-rXM>
.
--
*Samuel QUEK*
*IT Associate Director*
*Taipei American School*
800 Chung Shan N. Rd., Section 6 | Taipei | Taiwan ROC 11152
Tel: 886-2-2873-9900 ext 286
www.tas.edu.tw
*TAS is Green:* Please consider the environment before printing this email.
--
Confidentiality Notice: The information contained in this message may
be
privileged and confidential and protected from disclosure. If the reader
of
this message is not the intended recipient, or an employee or agent
responsible
for delivering this message to the intended recipient, you are
hereby notified
that any dissemination, distribution, or copying of this
communication is
strictly prohibited. If you have received this
communication in error, please
notify us immediately by replying to the
message and deleting it from your
computer. Thank you.
|
@queks sometimes I forget about the code that I wrote myself even, so no worries! 😜 You can also swap to For the writing to Docs bits, I think I'm going to implement both. The first option would be for purely using a Doc the same as a local text file, while the second option allows for updating of any filetype (even binary files). Converting to a byte stream is easy and there wouldn't be any special character issues in that case, pure byte goodness. I'll keep you updated! |
Hey everyone! Since there are a few feature requests on the board now, I've transitioned them out to their own issues to better track. I am going to shut this issue down now, but the discussion has been great so far! If you have any questions/comments/feature requests/bug reports/etc, please feel free to open up a new issue 😄 Thanks, y'all! |
PSGSuite was originally created for personal and work-related automation, so functions were created somewhat sporadically without 100% coverage of each API in scope. For most, the functions available should cover what's needed, but I'd like to increase the coverage as much as possible!
Please leave a comment with any Google APIs/endpoints* you would like to see added into PSGSuite! If you have a link to Google's documentation page for that API, that would be appreciated as well to remove any possible confusion.
*At the moment, this is going to be somewhat limited to APIs outside of Google Cloud Platform, but if the demand is there, I'm open to digging into GCP API's like Vision API and the like.
Looking forward!
Progress Checklist
The text was updated successfully, but these errors were encountered: