User Profile
AustinSundar
Copper Contributor
Joined Jul 20, 2021
User Widgets
Recent Discussions
Re: Creating a Custom RBAC Role for exchange
i am trying to restrict the role to use only get-commands. and remving any set commands Get-ManagementRoleEntry "XXX - ViewOnly Recipients\*" | Where {$_.Name -notlike "*Get"} | Remove-ManagementRoleEntry however, i receive the error below... could you help? Write-ErrorMessage : Cannot process argument transformation on parameter 'Identity'. Cannot convert value "XXX- ViewOnly Recipients" to type "Microsoft.Exchange.Configuration.Tasks.RoleEntryIdParameter". Error: "The format of the value you specified in the Microsoft.Exchange.Configuration.Tasks.RoleEntryIdParameter parameter isn't valid. Check the value, and then try again. Parameter name: identity"1.2KViews0likes0CommentsCreating a Custom RBAC Role for exchange
New-ManagementRole -Parent "View-Only Organization Management" -Name "Custom - ViewOnly Recipients" Get-ManagementRoleEntry "Custom - ViewOnly Recipients\*" | Where {$_.Name -notlike "*Get-"} | Remove-ManagementRoleEntry $name = "ServiceDesk Management" $roles = "Custom - ViewOnly Recipients" $Description = "Members of this management role group have rights to view Exchange recipient objects in the organization" New-RoleGroup -Name $name -Roles $roles -ManagedBy "Manager" -Description $Description i am trying to create a RABC for service desk engineers to view exchange recipients only could someone confirm the steps below are correct?Solved1.3KViews0likes2CommentsRe: Ps session disconnecting
Harm_Veenstra i tried with less than 20 mailboxes. i am getting the output, but the format seems to be not correct .may be i need to check formatting in excel. But when i tried to query all mailboxes, it seems be very slow to get the output. not sure if this is because of querying multiple items or number of mailboxes. in 5hrs it queried only 2560 mailboxes1.2KViews0likes2CommentsRe: Ps session disconnecting
Harm_Veenstra i am not an expert in PS, but tried something like below. however, it failed after getting information of 8500 mailboxes. i also see the error below Could you help to correct the mistakes in the script? or guide me $report = @() $Mbxs = Get-Mailbox -ResultSize unlimited -RecipientTypeDetails UserMailbox, SharedMailbox foreach ($Mbx in $Mbxs) { $TotalItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName).TotalItemSize $ItemCount = (Get-MailboxStatistics $Mbx.UserPrincipalName).ItemCount $TotalDeletedItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName).TotalDeletedItemSize $ArchiveTotalItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName -Archive -WarningAction SilentlyContinue).TotalItemSize $ArchiveItemCount = (Get-MailboxStatistics $Mbx.UserPrincipalName -Archive -WarningAction SilentlyContinue).ItemCount $ArchiveTotalDeletedItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName -Archive -WarningAction SilentlyContinue).TotalDeletedItemSize #$email= Get-Mailbox $mbx | select @{Name='EmailAddresses'; Expression={$_.EmailAddresses -join ","}} $report = $null $reportObj = New-Object PSObject $reportObj | Add-Member NoteProperty -Name "DisplayName" -Value $mbx.DisplayName $reportObj | Add-Member NoteProperty -Name "RecipientTypeDetails" -Value $mbx.RecipientTypeDetails $reportObj | Add-Member NoteProperty -Name "PrimarySmtpAddress" -Value $mbx.PrimarySmtpAddress $reportObj | Add-Member NoteProperty -Name "EmailAddresses" -Value $mbx.EmailAddresses $reportObj | Add-Member NoteProperty -Name "RetentionPolicy" -Value $mbx.RetentionPolicy $reportObj | Add-Member NoteProperty -Name "ArchiveName" -Value $mbx.ArchiveName $reportObj | Add-Member NoteProperty -Name "AutoExpandingArchiveEnabled" -Value $mbx.AutoExpandingArchiveEnabled $reportObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $TotalItemSize $reportObj | Add-Member NoteProperty -Name "ItemCount" -Value $ItemCount $reportObj | Add-Member NoteProperty -Name "TotalDeletedItemSize" -Value $TotalDeletedItemSize $reportObj | Add-Member NoteProperty -Name "ArchiveTotalItemSize" -Value $ArchiveTotalItemSize $reportObj | Add-Member NoteProperty -Name "ArchiveItemCount" -Value $ArchiveItemCount $reportObj | Add-Member NoteProperty -Name "ArchiveTotalDeletedItemSize" -Value $ArchiveTotalDeletedItemSize $report += $reportObj $report|Export-Csv "" -Append -NoTypeInformation } $report1.2KViews0likes4CommentsPs session disconnecting
unable to retrieve all mailbox config. PS session disconnecting or script is not running if we set result size to unlimited. Could someone please help on how to get the below details of all mailboxes? we have around 40000 mailboxes. $report = @() $Mbxs = get-mailbox -resultsize unlimited -RecipientTypeDetails userMailbox,sharedmailbox foreach ($Mbx in $Mbxs) { $TotalItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName).TotalItemSize $ItemCount = (Get-MailboxStatistics $Mbx.UserPrincipalName).ItemCount $TotalDeletedItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName).TotalDeletedItemSize $ArchiveTotalItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName -Archive -WarningAction SilentlyContinue).TotalItemSize $ArchiveItemCount = (Get-MailboxStatistics $Mbx.UserPrincipalName -Archive -WarningAction SilentlyContinue).ItemCount $ArchiveTotalDeletedItemSize = (Get-MailboxStatistics $Mbx.UserPrincipalName -Archive -WarningAction SilentlyContinue).TotalDeletedItemSize #$email= Get-Mailbox $mbx | select @{Name='EmailAddresses'; Expression={$_.EmailAddresses -join ","}} $reportObj = New-Object PSObject $reportObj | Add-Member NoteProperty -Name "DisplayName" -Value $mbx.DisplayName $reportObj | Add-Member NoteProperty -Name "RecipientTypeDetails" -Value $mbx.RecipientTypeDetails $reportObj | Add-Member NoteProperty -Name "PrimarySmtpAddress" -Value $mbx.PrimarySmtpAddress $reportObj | Add-Member NoteProperty -Name "EmailAddresses" -Value $mbx.EmailAddresses $reportObj | Add-Member NoteProperty -Name "RetentionPolicy" -Value $mbx.RetentionPolicy $reportObj | Add-Member NoteProperty -Name "ArchiveName" -Value $mbx.ArchiveName $reportObj | Add-Member NoteProperty -Name "AutoExpandingArchiveEnabled" -Value $mbx.AutoExpandingArchiveEnabled $reportObj | Add-Member NoteProperty -Name "TotalItemSize" -Value $TotalItemSize $reportObj | Add-Member NoteProperty -Name "ItemCount" -Value $ItemCount $reportObj | Add-Member NoteProperty -Name "TotalDeletedItemSize" -Value $TotalDeletedItemSize $reportObj | Add-Member NoteProperty -Name "ArchiveTotalItemSize" -Value $ArchiveTotalItemSize $reportObj | Add-Member NoteProperty -Name "ArchiveItemCount" -Value $ArchiveItemCount $reportObj | Add-Member NoteProperty -Name "ArchiveTotalDeletedItemSize" -Value $ArchiveTotalDeletedItemSize $report += $reportObj } $reportSolved1.5KViews0likes8Comments
Recent Blog Articles
No content to show