User Profile
fstorer
Brass Contributor
Joined 6 years ago
User Widgets
Recent Discussions
Get a report showing specific shared mailboxes and Display Names of their members on one line.
Dear Community, I have been asked to generate an excel report showing all our shared mailboxes starting with "jobs-". For each shared mailbox we want to see the members' Display Names (not the email addresses) sorted in alphabetical order, and these should stay on one line (not in a column). I was able to get the shared mailboxes and the Display Names, but not the "one line" request. Is there anyone who can help me with the code? Many thanks in advance! $jobs = Get-EXOMailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited -Filter { DisplayName -like 'jobs-*' } $JobsReport = @() foreach ($job in $jobs) { $Members = Get-MailboxPermission $job.identity | Where-Object { ($_.User -like '*@*') | Sort-Object User foreach ($Member in $Members) { $DisplayName = ((Get-User $Member.User).DisplayName) -join ', ' $JobsReport += [PSCustomObject]@{ SharedMailbox = $job.Alias MemberDN = $DisplayName } } }Solved746Views0likes7CommentsIs there a way to reset/wipe all data from M365 user accounts in order to re-use the same accounts?
Dear all, I apologize in advance if I am posting my question in the wrong place. Every year we have external people coming to our campus who need to access specific school resources just for a few months. We have created several accounts for them with policy restrictions and we are happy with this solution. We were wondering if there is a way to automate the deletion of all their data (mainly OneDrive files/Outlook emails) at the end of their stay here in order to keep those accounts clean for the upcoming persons. We don't want to do this task manually. Is it quicker to delete the accounts and re-create them every year? Many thanks in advance for any help FrancescoSolvedShared Calendars - is there a way to set them up in Outlook client without accepting an invite?
Hello everyone, We have a shared mailbox with several calendars inside, and they should all be accessible from the staff. We have generated ICS links for each of them, but some needed a restricted view because the link is shared also with external people. When new staff members start working for our company, we shared all these calendars with them assigning "Reviewer permissions". The way we share these calendars is via outlook invites (they only need to click on the "Accept" button and the calendars pop up under the "Shared Calendars" area). Sometimes people lose their connection with the shared calendars, getting the following message: If I check the mailboxfolderpermissions I can see that these users are still there with the correct permissions, but they can't open the shared calendars anymore. I usually remove the user and send him/her another invite. Is there a way for the users to add these calendars themselves? They can't use all the generated ICS links because some of them have restricted views and if they try to add the shared mailbox in their outlook clients, only the default calendar shows up. Or is there a third party tool that can do this? Any help would be much appreciated! Francesco1.2KViews0likes2CommentsHow to quickly assign different permissions to shared calendars to different people
Hello everyone, In our organization we have a shared mailbox with multiple calendars within (around 10 calendars). These calendars need to be shared with all staff members, who should have "Reviewer" permissions. There are a few people (the secretaries), though, who need to have "Editor" permissions, because they are responsible of editing all these calendars. Also, every year our Staff security group is populated with new staff members who need to access those calendars possibly via email notifications. Would it be possible to create a script which: - Check all the members within the Staff Security group; - Identify the (new) members who don't have any access/permissions to the shared calendars; - Assign "Reviewer" permissions to each of them; then - Check all the members in a variable named $Secretaries (it would be great to populate this variable finding the word "Secretary" in the job title of each staff member); - Assign "Editor" permissions to all the secretaries. In the past new members were added manually one by one via the GUI. I created a variable with all the calendars inside: $SharedCalendars = @( "email address removed for privacy reasons:\Calendar\Test Dates", "email address removed for privacy reasons:\Calendar\Test1 Dates", "email address removed for privacy reasons:\Calendar\Test2 Dates", "email address removed for privacy reasons:\Calendar\Test3 Dates", "email address removed for privacy reasons:\Calendar\Test4 Dates", etc. ) Then I know that I can run for each calendar the Add-MailboxFolderPermission and also send the notifications $SharedCalendars.ForEach{ Add-MailboxFolderPermission -Identity $_ -User email address removed for privacy reasons -AccessRights Reviewer -SendNotificationToUser $true } If I want to populate the $Secretaries variable, I can use something like this: $Users = Get-MgGroupMember -GroupId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -All $UsersJob = $Users.ForEach{ Get-MgUser -UserId $_.Id -Property Id, DisplayName, UserPrincipalName, Mail, JobTitle } $Secretaries = $UsersJob | Where-Object {($_.JobTitle -like '*Secretary*')} | Select-Object -Property Id, DisplayName, UserPrincipalName, Mail, JobTitle | Sort-Object -Property UserPrincipalName but I am missing all the part of assigning the "Reviewer" permissions for each new member and the "Editor" permissions for the secretaries. Any help would be much appreciated. Many thanks in advance! FrancescoFind all the AzureADUsers created after a certain date via PowerShell Graph
Hello everyone, As Microsoft will eventually retire the AzureAD and MSOL PowerShell modules (March 2023?), I am trying to update all the PowerShell scripts based on those modules with new ones based on Microsoft Graph API calls and PowerShell Graph SDK. I am struggling with a script which should find all the AzureAD members created after 1 July 2022 inside a specific Security Group. The script should generate a list of these "new starters" and retrieve the following information: DisplayName, UPN, ID, Email, JobTitle. This is what I got so far: [datetime]$Date = (Get-Date).adddays(-60) $Users = Get-MgGroupMember -GroupId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -All $Users.Count $UsersCreatedDate = $Users.ForEach{ Get-MgUser -UserId $_.Id | Select-Object -Property Id, UserPrincipalName, JobTitle, CreatedDateTime } Getting all the users takes some time (we have around 400 members in that Security group), I am not sure if there is a quicker way to get those information. Then I tried to filter that list using the "where-object" $UsersCreatedDate | Where-Object {($_.CreatedDateTime -gt '$Date')} but to no avail.I am always getting the error Could not compare "06/20/2017 09:00:00" to "$DateTime". Error: "Cannot convert value "$DateTime" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."" What am I doing wrong? Any help would be much appreciated! Many thanks in advance FrancescoSolvedStream Audit Log - Script to check who viewed/liked a video returns the same element multiple times
Hello everyone, I have been asked to find out who viewed/liked a specific video in Microsoft Stream. I am using the following script to get the first info (for the second I replace the StreamInvokeVideoView with StreamInvokeVideoLike): $StartDate = (Get-Date).AddDays(-30) $EndDate = (Get-Date) $Viewers = Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate -RecordType MicrosoftStream -Operations StreamInvokeVideoView -ObjectIds "VIDEOLINK" -ResultSize 500 | Sort-Object CreationDate $ConvertAudit = $Viewers | Select-Object -ExpandProperty AuditData | ConvertFrom-Json $ConvertAudit | Select-Object CreationTime, ResourceTitle, UserId, ClientIP, Operation, Workload, ResultStatus The issue I am having is that when I check the $Viewers and the $ConvertAudit variables, I have several repeated elements (e.g. I see the same user with the same creationdate and the same auditdata repeated almost 100 times). What am I doing wrong? I will then export the results to a csv or xlsx file. Any help would be greatly appreciated! Many thanks in advance! FrancescoSolvedExclude test guest users from a script listing all guest users
Dear All, I am trying to find a quick way to exclude all our "test" guest users from a powershell script which lists all the guest users in our tenant. The script is quite simple: $GuestUsers = Get-AzureADUser -Filter "UserType eq 'Guest'" -All $true | Sort-Object DisplayName | Select-Object DisplayName,JobTitle,Mail,UserType,AccountEnabled $GuestUsers | Export-Excel -path "C:\Temp\Guest2022.xlsx" -AutoSize -TableName GuestAccounts -WorksheetName GuestAccounts The problem is that we have 15 test guest users that always appear in the list. It's not a big number so I can remove them manually afterward but it would be great if I can exclude them directly in the script. Any help would be much appreciated! Many thanks in advance! Francesco The problemSolved3.4KViews1like5CommentsWhat is the difference between "OtherMails" and "ProxyAddresses" when using PowerShell?
Dear all, From time to time we have to change the name of a staff member, and we usually keep the old email address (which is strictly related to the name) as an alias. I noticed that when I run the command "Get-AzureADUser" I get two properties called "OtherMails" and "ProxyAddresses". The old email appears in "OtherMails" but NOT in the "ProxyAddresses" (as an additional "smtp"). Is that normal? What is the difference between the two properties? Thanks in advance for any clarification Francesco15KViews0likes1CommentStaff leavers still appearing in the Staff notebooks
Hello everyone, We had several staff members leaving our company and all their accounts have been permanently deleted. However, when we open some Microsoft Staff Teams which were created via SDS (Microsoft School Data Sync) and take a look at the related Staff Notebooks, we see that their names are still in the list just after the "_Content Library". As the "Add/Remove Staff" option doesn't work on those notebooks, is there another way to remove those name sections from the notebooks? I thought that they would have been automatically removed together with the deleted accounts, but they are still there. Any ideas? Many thanks in advance FrancescoUser receiving appointments acceptances from a shared mailbox calendar without having access
Hello everyone, We have a user who was once a member of a shared mailbox. He had full access to this mailbox and its calendar. Lately he has been removed because he doesn't need access to the shared mailbox any longer. If I check the mailboxpermission and the mailboxfolderpermission with PowerShell, his name doesn't appear on the users' list. However, he is receiving all the appointments' acceptances from that shared mailbox's calendar on his personal mailbox. It's quite annoying for him, as these confirmation messages can be 20-30 every day. I am not sure where to look to avoid this, he shouldn't receive any email from that shared mailbox. Could you please advise on this matter? Many thanks in advance for your help! Francesco18KViews0likes13Comments
Groups
Recent Blog Articles
No content to show