I need to get in my terminal a table that lists all users together with certain attributes.
I use powershell that was set up using commands Install-Module AzureAD and Connect-AzureAD -Tenant "<mydirectory>.onmicrosoft.com".
When I inquiry a single user, I get this:
О» Get-AzureADUser -ObjectId dacbdd03-... | Select -ExpandProperty ExtensionProperty
Key Value
--- -----
odata.metadata https://graph.windows.net/ee26ec1a.../$metadata#directoryObjects/#Element
odata.type Microsoft.DirectoryServices.User
createdDateTime 31.01.2023 19:57:55
employeeId
onPremisesDistinguishedName
userIdentities []
extension_<largenumber>_customerId 48f6eadf-...
I need now to output a table of all users, so I list its objectId, extension_<largenumber>_customerId and also an email field. Note that I have millions of users (result should be dumped in a file).
You can review all properties to filter by using an example ObjectID (such as your own) by running the following:
Get-AzureADUser -ObjectId example#contoso.com | select *
After you know what filters you'd like, you'll use a few additional flags:
-all $true to run against all users
> results.csv to dump to a csv file
Format-Table -AutoSize to force table output, if you decide to include more than five properties of an AzureADUser
Try using something like this as your starting point.
Get-AzureADUser -all $true | select ObjectID, mail, extension_<largenumber>_customerId | Format-Table -AutoSize > C:\output\results.csv
Name the output file and location as you'd like.
You should also consider narrowing down your search as you're running against a million users. Consider narrowing down your search definition. Perhaps you can search for only users in a particular email domain, company, or department?
I'm not sure of any negligible impact this script could have querying against a million user records. Perhaps someone with more experience could comment.
Related
Can someone help and tell me why these 4 users below ( inside the red circle ) showing the GUID not their names under the identity when I look them in group lookup How do I fix it? The 4 users were recently added and they were created in local Active Directory same way with the others.
Sorry for my english but hopefully you guys will understand me. Thank you so much
$DDLName = "Gold Coast"
$DDLProperties = Get-DynamicDistributionGroup -Identity $DDLName
Get-Recipient -RecipientPreviewFilter ($DDLProperties.RecipientFilter)
I tried to reproduce the same in my environment and got the below results:
$DDLName = "DDLNAME"
$DDLProperties = Get-DynamicDistributionGroup -Identity $DDLName
Get-Recipient -RecipientPreviewFilter ($DDLProperties.RecipientFilter)
Note that: Microsoft updated the naming scheme for the user's Name parameter, being displayed as externaldirectoryobjectid. Refer this blog
To resolve the GUID to Name, you can make use of parameters like DisplayName or Name.
(Get-Recipient 860047a6-a9bc-4d63-8d6f-XXXX).DisplayName
If still the issue persists, check whether users are active and have Office 365 license.
Reference:
Changes in Exchange Mailbox Names and Distinguished Names by Tony Redmond
I'm new with Azure Application Insights service, I want to get data from my app (developed with Xamarin Forms, c#) and I need to make a specific query to be able to get a user stats and display it on my Azure Dashboard. I'm able to make this request for all users but not for one user. I show you my query
customEvents
| where name == "LoggedUserEvent"
| where timestamp > now() - 31d
| extend Properties = todynamic(tostring(customDimensions.Properties))
| extend userId = todouble(todecimal(Properties.UserId))
| where userId == XXX
| summarize Total = count() by bin(timestamp, 1d)
| project Total, timestamp
this query work's well and show me Total and timestamp as you can see
but the issue it's I should specify
| where userId == XXX
Each time I want new data about specific user I have to update this line, is there en easier way to get this info using an input text for example or if you have any suggestions, salespeople will use this platform and need to be simple as possible. Thank you in advance.
To achieve the above requirement you can try with page view method so that we can get specific users who logged in to your application instead of using Custom events.
Example of query:
pageViews
| project user_Id , timestamp
| summarize max(timestamp) by user_Id
For more information please refer the below links:-
SO THREAD : Application Insights - Distinct Users and the last time they visited the site & Trying to create a KQL with users who have not logged in within the last 30 days
I like to check on how to retrieve documents that does not belong to any List or Document Library.
Currently the documents URL in search result is something like this "http://example.com/file.doc"
I suspect the documents where at this location due to data importing using PowerShell script and the script was unable to get the path that I was uploading to.
I will like to get the details of documents like this and delete them.
Thank you.
Use powershell:
$web = Get-SPWeb http://example.com
$web.Files | select Url
if you would like to retreive from all subwebs the code would be:
foreach ($inWeb in $web)
{
$inWeb.Files | select Url
}
Hey I am trying to create a report to display in a matrix type format the navigations and permissions that a user has. I already have a query set up that correctly gets the path associated with each user. I am having trouble creating the XML / BI Publisher template.
The staging table has the format
ROLE | COMPONENT | DISPLAYONLY | NAVIGATION PATH
and I want to convert this into a table where it may look something along the lines of
PATH | COMPONENT | ROLE1 | ROLE2 | ROLE3 | .... | ROLE N |
where it has all of the users access rights given a certain path. Any guidance is very much appreciated. Thanks
It appears your request is to print data horizontally, which has been answered previously here. This can be done via RTF templates, and there are samples provided by oracle here : C:\Program Files (x86)\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\samples\RTF templates\Advanced\Dynamic Columns, where you have installed BIP Word Addon.
I am running the sharepoint 2010 Management Shell and I am did this
Get-SPFeature –Site http://sp2010
Comes back with
DisplayName Id Scope
--------------------------------------------
TheOneIWantIsToLo.... someId Site
Now I need the display name to deactive the feature and active again. Yet I don't know what the full name is as it cuts it off.
How can I make it bigger so it won't do this?
This worked for me:
Get-SPFeature -Site http://sp2010 | format-table -auto
If you just want the display name you can also use:
Get-SPFeature –Site http://sp2010 | ForEach-Object {write-host $_.DisplayName}