Let's say you want to get a preview of how DFS is setup before you start making any changes. Following script will output the current dfs setup. This script first imports the DFS module using Import-Module DFSR. It then uses the Get-DfsnServerConfiguration cmdlet to get a list of all DFS Namespace servers in the domain.... Continue Reading →
Script to list The Members of Nested Distribution Groups
Connect to Exchange Online PowerShell $UserCredential = Get-Credential$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirectionImport-PSSession $Session Get list of all distribution groups $groups = Get-DistributionGroup -ResultSize unlimited Loop through each group and get its members foreach ($group in $groups) {Write-Host "Group: $($group.Name)"$members = Get-DistributionGroupMember -Identity $group.Name -ResultSize unlimitedforeach ($member in $members)... Continue Reading →
The ACE doesn’t exist on the object Mailbox Permissions
If you have recently upgraded from exchange 2013 or older to 2016/2019, you might experience the following when you try to remove mailbox permissions using exchange PowerShell. It will let you remove the permissions using exchange admin centre without any error sometimes but when you go back to check the permissions, you will notice that... Continue Reading →
Get Members of Nested Distribution Groups
I recently came up with a request to get a list of all members of a distribution group which can easily be done using Power shell. Get-DistributionGroupMember -Identity "testgroup@xyz.com" This will output all members of the group including other groups. Other groups have nested groups as well so it would be cumbersome process to get... Continue Reading →
Exchange Online: Viewing / Changing Calendar permissions for All Users
I come across this request a lot i.e. to view or change calendar permissions for all mailboxes. For e.g. UserA would like to have Publishing Editor rights on all mailboxes or UserA needs to be removed as publishing editor access off all mailboxes. Let’s assume that there are 100+ users to apply this to so... Continue Reading →
Testing Mail Relay / Sending Email Using PowerShell
Sometimes we need to test sending an email using mail relay and normally we telnet to mail relay on port 25 which is a bit complicated and extensive method in my view. Using that method if you make any typo, you would have to start from scratch. A simple PowerShell command can be used instead... Continue Reading →
How to run Power shell commands Remotely?
It's tedious to log on to server(s) just to check something simple or even complicated. You can create a remote session to the server instead of manually logging on to it and run the commands / programs like if you were physically logged on to it. Open Power shell as admin.Type in Enter-PSSession -Computername fqdn... Continue Reading →
Apply Settings to all users in specific Exchange Database
Let's say you want to apply some settings to all users in a specific exchange database, you don't want to apply that to each individual mailbox especially if there are a lot of mailboxes in the database. For e.g. You would want to disable MAPI for all users in Test_db database. You can run the... Continue Reading →
Power shell Truncated Output
Type in FormatEnumerationLimit=-1 Run the command again now and output should display full results. If that doesn't work, please try the following, add switch -wrap -autosize after fl or ft.