This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Dear,
I created a script, which give me out all Intune Registered devices based on a specific time frame (for e.g. registered in the last two days):
Install-Module -Name Microsoft.Graph.Intune
Import-Module Microsoft.Graph.Intune
Connect-MSGraph
$targetaadgroupname = "RegisteredDevices"
$limit = (Get-Date).AddDays(-2)
Get-IntuneManagedDevice -filter "operatingSystem eq 'Windows'" |Where-Object { $_.enrolledDateTime -gt $limit } | Select deviceName, enrolledDateTime, operatingSystem |ft
Now I want, that the devices I get from this output will be added as a member to the Group "RegisteredDevices".
I tried to do it with the Add-AzureADGroupMember cmdlet, but unfortunately it's not working (no member are added). Also tried to work with a pipe, but result is the same.
Can you may assist in this case on how to add the output (devices) into the group?
Thanks in advance!
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Intune/comm...