Skip to content
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

Getting Non-Default Attributes/Properties #2

Open
cradixus opened this issue Feb 11, 2014 · 3 comments
Open

Getting Non-Default Attributes/Properties #2

cradixus opened this issue Feb 11, 2014 · 3 comments

Comments

@cradixus
Copy link

I see in AADGraphUser.psm1, this is the backbone of the Get-AADUser function:

 Get-AADObject -Type "users"

However, the attribute I'm interested in (thumbnailPhoto) doesn't seem to be included by default.

With Get-ADUser, I would use the "-Properties" parameter to include the thumbnailPhoto attribute:

 Get-ADUser "matt.wilson" -Properties thumbnailPhoto

Is there a similar method we can use to achieve the same result with AADGraph? NOTE: Keep in mind that once I'm able to GET the thumbnailPhoto attribute, I'll next want to be able to SET it. ;-)

Thanks for your help!
Matt

@cradixus
Copy link
Author

Hmmm... Actually, two things:

  1. I noticed that when I get a single user by ID, if that user has a thumbnailPhoto, the property exists like this (but this is missing if they don't have a photo rather than existing with $null value):
 [email protected] : image/Png
  1. ...however; I've also noticed that the Get-AADUser appears to be limited to 100 users returned. Is there a way to override this? Otherwise, I have no way of -filtering or using Where-Object to "search" for users based on variables.

Either way, I'm left with the question of how to get/set the actual content of the thumbnailPhoto attribute, since a returned value of "image/Png" doesn't give me hope that I will be able to "set" JPG/PNG data back to the attribute in a fashion similar to:

 Import-RecipientDataProperty -Identity "Bharat Suneja" -Picture -FileData ([Byte[]]$(Get-Content -Path "C:\pictures\BharatSuneja.jpg" -Encoding Byte -ReadCount 0))

@cradixus
Copy link
Author

Okay, I see now you actually have a function specifically for setting a thumbnailPhoto attribute!!

Set-AADUserThumbnailPhoto

Let me play with this and see how it goes. I'm still concerned, though, with how I would return all users in my organization in a Get-AADUser function call.

@katalin2003
Copy link

Hello @cradixus, I see this issue is still open so I'll answer one of your questions which concerns returning more than 100 results.
I use ?$top=250 when constructing my URL.
i.e.:
https://graph.windows.net/myCompany/users?$top=250&api-version=1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants