Creating a Pinpoint DNS Zone

You want to return different IP addresses for the same hostname from different DNS servers for users that are in different regions. For example, have DNS servers in the ABC return “1.2.3.4” for my.domain.com and DNS servers in XYZ return “5.6.7.8” for same name.

domain.com is an internal Active Directory DNS zone

With pinpoint DNS, you are creating a primary DNS zone in your namespace for the purposes of controlling replication traffic and delivering it to people who are only using that DNS server.

In a nutshell, we are creating a Standard/Primary DNS zone named the same as the hostname you want to answer for (in this case, my.domain.com) with a single host and then choosing which DNS servers will receive a replica of this zone.  The zone will have a single A record for “my.”, which will resolve to 1.2.3.4 for ABC users and 5.6.7.8 for our XYZ users.

Configure First Primary DNS Server

  1. Launch the DNS Management Console and connect to your primary DNS server.
  2. Right-click Forward Lookup Zones and select New Zone.
  3. On the New Zone Wizard page, click Next.
  4. Ensure that the radio button Primary Zone is selected (it is selected default).
  5. If the DNS server is also a Domain Controller, the Store the zone in Active Directory checkbox will be selected by default. CLEAR IT and click Next.
  6. In the Zone name text box, enter the FQDN of the new zone (in our example, my.domain.com, and click Next).
  7. The radio button Create a new file with this file name is selected by default. Click Next.
  8. The radio button Do not allow dynamic updates is selected by default. Click Next.
  9. Click Finish.
  10. Expand Forward Lookup Zones and select your newly created zone (my.domain.com is what we are configuring).
  11. Right-click on the new zone (my.domain.com) and select Properties.
  12. Select the Zone Transfers tab.
  13. The Allow zone transfers checkbox is selected by default. Select the Only to the following servers radio button.
  14. Click Edit.
  15. In the Allow Zone Transfers dialog box, click the blank line that says <Click here to add an IP Address or DNS name> and enter the addresses (one per line) for the additional DNS servers you want to host this zone.
  16. Click OK when done to close the Allow Zone Transfers dialog box.
  17. Click OK to close the DNS zone properties dialog box.
  18. Right-click on the new zone (my.domain.com) and select New  Host (A or AAAA)…
  19. In the New Host dialog box, leave the Name field blank (the record will be created with an “my.”, meaning it answers for the name of the zone that it’s in).
  20. In the New Host dialog box, enter the IP address for this host (1.2.3.4, in our example) and click the Add Host button.

Configure First Secondary DNS Server

  1. Launch the DNS Management Console and connect to your secondary DNS server.
  2. Right-click Forward Lookup Zones and select New Zone.
  3. On the New Zone Wizard page, click Next.
  4. Select the radio button for Secondary Zone and click Next.
  5. In the Zone name text fox, enter the FQDN of the zone you created in step 6 above and click Next.
  6. On the Master DNS Servers page, enter the IP address of the Primary DNS Server (the server used in Step 1 under “Configure Primary DNS Server”) and press Enter.
  7. Click Next.
  8. Click Finish.
  9. Repeat for each additional secondary DNS server to configure.

Configure Second Primary DNS Server

  1. Follow steps 1-19 outlined for the first Primary DNS server.
  2. Replace the IP address in step 20 with the IP address of the second host you want to use (in our example, 5.6.7.8).

Configure Second Secondary DNS Server

  1. Follow steps 1-5 outlined for the first Secondary DNS server.
  2. Replace the IP address in step 6  with the IP address used for the second Primary DNS server.
  3. Complete steps 7-9.

Purge Mailbox Deleted Items Folder

Get current Settings

Get-Mailbox service@contoso.de | Format-List SingleItemRecoveryEnabled,RetainDeletedItemsFor

or use

Get-mailbox service@contoso.de | fl *retention*,*retain*

Set New Settings

Set-Mailbox -Identity service@contoso.de -SingleItemRecoveryEnabled $false -RetainDeletedItemsFor 1

#Purges folder deletes after 1 day

Delete Items in Dumpster

Search-mailbox -identity service@contoso.de -SearchDumpsterOnly -DeleteContent

View Recoverable items in Dumpster

Get-MailboxFolderStatistics service@contoso.de -FolderScope RecoverableItems | Format-List Name,FolderAndSubfolderSize

Remove a Name Server from All Reverse Zones

##############################

# The following section contains all input parameters

$DC = “DC1.contoso.internal” # Domain controller to be used

$nameserver = “DNS.contoso.internal” # Nameserver to remove

#

##############################

$list = Get-DnsServer -ComputerName $DC | select -Property serverzone -ExpandProperty serverzone | where  {$_.isdsintegrated -eq “true” -and $_.isreverselookupzone -eq “true”} | select -Property zonename

foreach ($zone in $list ) {Remove-DnsServerResourceRecord -ComputerName $DC -ZoneName $zone.zonename -RRType Ns -Name “@” -RecordData $nameserver -Force}

Get all DNS Zones and Records in CSV

$results = Get-DnsServerZone | % {

    $zone = $_.zonename

    Get-DnsServerResourceRecord $zone | select @{n=’ZoneName’;e={$zone}}, HostName, RecordType, @{n=’RecordData’;e={if ($_.RecordData.IPv4Address.IPAddressToString) {$_.RecordData.IPv4Address.IPAddressToString} else {$_.RecordData.NameServer.ToUpper()}}}

}

$results | Export-Csv -NoTypeInformation c:\temp\DNSRecords.csv -Append

Add/Update DNS servers for Azure VM

Log onto Azure > Find VM > Operations, Run Command > Run PowerShell Script

Get-NetAdapter | Select-Object InterfaceAlias , InterfaceIndex

Take a note of the InterfaceIndex

Get-DnsClientServerAddress -InterfaceIndex 7

Checks current DNS servers.

Set-DnsClientServerAddress -InterfaceIndex 7 -ServerAddresses (“10.215.153.11″,”168.63.129.16″,”10.230.160.15”)

Sets DNS servers

Register-DnsClient

PS equivalent of Ipconfig /registerDNS

Get-DnsClientServerAddress -InterfaceIndex 7

Check interface for new DNS servers

Assign full permissions for a user to another users calendar

Cannot assign folder permissions in mixed hybrid environment i.e. cannot grant a M365 user calendar permissions to an On-Prem 2016 mailbox or vice versa.

john@contoso.com is the calendar being shared
scahill@xyz or dirk@contoso.de is the person who is being granted permission

Get Existing Permissions

Get-MailboxFolderPermission -Identity john@contoso.com:\Calendar

If user is not English speaking get calendar or other folder local name using
Get-MailboxFolderStatistics -Identity dirk@contoso.de -FolderScope Calendar

Get the existing permissions using the local calendar name
Get-MailboxFolderPermission -Identity dirk@contoso.de\Kalendar

Grant Edit Permissions

Set-MailboxFolderPermission -Identity john@contoso.com:\Calendar-User <alias> -AccessRights Editor

Grant Manage Permissions

Add-MailboxFolderPermission -Identity john@contoso.com:\Calendar -User scahill@xyz -AccessRights Editor -SharingPermissionFlags Delegate,CanViewPrivateItems

Note -SharingPermissionFlags is cloud only

Grant Free/Busy Permissions Only

Add-MailboxFolderPermission -Identity john@contoso.com:\Calendar -AccessRights AvailabilityOnly -User scahill@xyz.com

Grant Read-Only Permissions

Add-MailboxFolderPermission -Identity john@contoso.com:\Calendar -AccessRights Reviewer -User scahill@xyz.com

Grant Limited Details Permissions

Set-MailboxFolderPermission -Identity john@contoso.com:\Calendar -User normilg -AccessRights Editor – scahill@xyz.com -SharingPermissionFlags Delegate,CanViewPrivateItems

Remove Permissions

Remove-MailboxFolderPermission -Identity john@contoso.com:\Calendar -User scahill@xyz.com

Calendar Sharing Rights aka Access Rights

Author: CreateItems, DeleteOwnedItems, EditOwnedItems, FolderVisible, ReadItems

Contributor: CreateItems, FolderVisible

Editor: CreateItems, DeleteAllItems, DeleteOwnedItems, EditAllItems, EditOwnedItems, FolderVisible, ReadItems

None: FolderVisible

NonEditingAuthor: CreateItems, FolderVisible, ReadItems

Owner: CreateItems, CreateSubfolders, DeleteAllItems, DeleteOwnedItems, EditAllItems, EditOwnedItems, FolderContact, FolderOwner, FolderVisible, ReadItems

PublishingEditor: CreateItems, CreateSubfolders, DeleteAllItems, DeleteOwnedItems, EditAllItems, EditOwnedItems, FolderVisible, ReadItems

PublishingAuthor: CreateItems, CreateSubfolders, DeleteOwnedItems, EditOwnedItems, FolderVisible, ReadItems

Reviewer: FolderVisible, ReadItems