Uncategorized

Outlook error moving folders

I have noticed below error while moving folders with in the outlook.

“Cannot copy this folder because it may contain private items”

This mostly there are private items in the folder trying to move.

Microsoft suggested solutions

https://support.microsoft.com/en-us/help/3205975/-cannot-copy-this-folder-because-it-may-contain-private-items-error-in

But in my case below steps helped to resolve the issue

  1. Open the shared mail box as default mail box (bit tricky with exchange 2013 and outlook 2013. I have to add a profile as my user mail box and modify the Data file settings going to control panel / Mail to the shared mail box name.)
  2. Open Outlook as the shared mailbox (or the user mail box) where we have issues with private items. Click on File, Account Settings and then Delegate Access.
  3. Click on Add, then find the account of the user who is facing the issue.
  4. Select Delegate can see my private items (last one)
  5. Click save.

If we receive error complaining cannot delegate send on behalf two ways to solve.

  1. Add the above user send on behalf from Exchange (ECP or Shell).
  2. then the user will appear in the Access delegation window
  3. Delegate access to private items

or else

add the registry key

HKCU\Software\Microsoft\Office\14.0\Outlook\Preferences -> add DWORD “IgnoreSOBError” with value 1.
Restart Outlook

 

 

Standard
Uncategorized

FSMO Roles

FSMO roles are:

  • Schema master – Forest-wide and one per forest.
  • Domain naming master – Forest-wide and one per forest.
  • RID master – Domain-specific and one for each domain.
  • PDC – PDC Emulator is domain-specific and one for each domain.
  • Infrastructure master – Domain-specific and one for each domain

This can be transferred to a different DC after the domain Setup and is recommended to keep on two different DCs.

 

 

 

Do this only in case you no longer able to access the FSMO role holder DCs,

Also there is lot of things you have to consider before doing below steps and it is very well explained on Petri https://www.petri.com/seizing_fsmo_roles

I will not recommend to do these steps in a production environment.

Steps to seize the roles

On the domain controller where you want to seize the roles run NTDSUTIL

ntdsutil:
type and enter “roles”
type and enter “connections”
type enter “connect to server “local server name””
type and enter q

Now Seize Roles (accept the warnings with yes)

Seize naming master (please note its not domain naming master)
Seize infrastructure master
Seize PDC (please note its not PDC emulator)
Seize RID master
Seize schema master

 

 

 

Standard
Uncategorized

HTTP redirection to HTTPS

HTTP to HTTPS redirection with IIS7

  • Select the web site you want to modify
  • In the right section select the “URL REWRITE”
  • In the action menu section, select the “Add rule” options
  • Use the blank rule template
  • The following windows open
  • Enter a name for your rules
  • Expand the menu “Match URL”
  1. Select in the  “Requested URL” drop down, “Matches the Pattern”
  2. Select in the  “Using” drop down, “Regular Expression”
  3. Enter the folling pattern in the text box : “(.*)”
  4. Be sure that the “Ignore case” check box is checked
  • Select the “Condition” section
  • Click the “Add” button to create a new connection
  • Enter in the “Condition” text box : {HTTPS}
  • Select in the “Request URL” drop down : “Match the Pattern”
  • Enter in the “Pattern” text box : ^OFF$
  • Make sure that the “Ignore Case” check box is checked
  • Click the “OK” button to validate
  • Select the “Action” section
  • In the “Action Type” drop down, select “redirection”
  • In the text box “URL redirect” entrez : https://{HTTP_HOST}/{R:1}
  • Make sure that the check box “Append to query string” is checked
  • In the next drop down, select the “303” option
  • Click “Apply” in the upper right corner to save the new rules

 

From : http://www.lebleuet.net/redirection-de-http-a-https-avec-iis7

Standard
Uncategorized

DNS Details Export

Thanks to : http://www.lebleuet.net

How to generate statistics of your DNS server with powershell

On 6 January 2016, in DNS, IT Procedure, Powershell, Programming, by Himselff

Here is a litle script i’ve build by digging through differents article to match what i needed :

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

#Extracting the date

$day = get-date -Format dd

$month = get-date -format MM

$year = get-date -format yy

$hour = get-date -Format hh

$min = get-date -Format mm

$today = $day+$month+$year+”-“+$hour+$min

$myFile = “c:\DATA\stats” + $today + “.txt”

 

#Getting stats from each zone and send all to the text file

Get-DnsServerZone | select zonename | Get-DnsServerStatistics > $myFile

 

#Sending stats file per email

$PSEmailServer = “email server IP”

Send-MailMessage -From “dnsserver@domain.com” -To “who need the report@domain.com” -Subject $Today” DNS Stats” -Attachments $myFile

First save that into a .ps1 file and then run that through a schedule task with that batch file

@ECHO OFF
PowerShell.exe -Command “& ‘getstats.ps1’”
PAUSE

 

Standard
Uncategorized

Remove SMTP Address

Thanks to the blog : –

https://www.exchangecore.com/blog/powershell-removing-secondary-smtp-addresses-specified-domain/

$Mailboxes = Get-Mailbox -result unlimited
$Mailboxes | foreach{
for ($i=0;$i -lt $_.EmailAddresses.Count; $i++)
{
$address = $_.EmailAddresses[$i]
if ($address.IsPrimaryAddress -eq $false -and $address.SmtpAddress -like “*domainToRemove.com” )
{
Write-host($address.AddressString.ToString() | out-file c:\addressesRemoved.txt -append )
$_.EmailAddresses.RemoveAt($i)
$i–
}
}
Set-Mailbox -Identity $_.Identity -EmailAddresses $_.EmailAddresses

Standard
Uncategorized

Uninstall Exchange 2013

Follow below steps to decommission an exchange 2013 server

Remove all Mail Boxes

  1. Get-User | Disable-Mailbox
  2. Get-Mailbox -Arbitration | Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed
  3. Get-Mailbox -Monitoring | Disable-Mailbox
  4. Get-Mailbox | Get-MailboxStatistics | Where {$_.DisconnectReason -eq “Disabled” } | |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState Disabled}
  5. Get-Mailbox | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”} |foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

 

 

Remove all Databases

Get-MailboxDatabase | Remove-MailboxDatabase

Remove partner application configuration:

Get-PartnerApplication| Remove-PartnerApplication

Check
1. Get-Mailbox
2. Get-Mailbox -Arbitration
3. Get-Mailbox -Monitoring

Uninstall

Uninstall Exchange 2013 from Add/Remove Programs

OR

PowerShell

Setup /Mode:Uninstall /iacceptexchangeserverlicenseterms

Standard
Uncategorized

Manual DC decommission

https://technet.microsoft.com/en-us/library/cc816907(v=ws.10).aspx#bkmk_graphical

Clean up server metadata by using GUI tools

When you use Remote Server Administration Tools (RSAT) or the Active Directory Users and Computers console (Dsa.msc) that is included with Windows Server 2008 or Windows Server 2008 R2 to delete a domain controller computer account from the Domain Controllers organizational unit (OU), the cleanup of server metadata is performed automatically. Previously, you had to perform a separate metadata cleanup procedure.

You can also use the Active Directory Sites and Services console (Dssite.msc) to delete a domain controller’s computer account, which also completes metadata cleanup automatically. However, Active Directory Sites and Services removes the metadata automatically only when you first delete the NTDS Settings object below the computer account in Dssite.msc.

As long as you are using the Windows Server 2008, Windows Server 2008 R2, or RSAT versions of Dsa.msc or Dssite.msc, you can clean up metadata automatically for domain controllers running earlier versions of Windows operating systems.

Membership in Domain Admins, or equivalent, is the minimum required to complete these procedures. Review details about using the appropriate accounts and group memberships at Local and Domain Default Groups (http://go.microsoft.com/fwlink/?LinkId=83477).

To clean up server metadata by using Active Directory Users and Computers

  1. Open Active Directory Users and Computers: On the Start menu, point to Administrative Tools, and then click Active Directory Users and Computers.
  2. If you have identified replication partners in preparation for this procedure and if you are not connected to a replication partner of the removed domain controller whose metadata you are cleaning up, right-click Active Directory Users and Computers <DomainControllerName>, and then click Change Domain Controller. Click the name of the domain controller from which you want to remove the metadata, and then click OK.
  3. Expand the domain of the domain controller that was forcibly removed, and then click Domain Controllers.
  4. In the details pane, right-click the computer object of the domain controller whose metadata you want to clean up, and then click Delete.
  5. In the Active Directory Domain Services dialog box, click Yes to confirm the computer object deletion.
  6. In the Deleting Domain Controller dialog box, select This Domain Controller is permanently offline and can no longer be demoted using the Active Directory Domain Services Installation Wizard (DCPROMO), and then click Delete.
  7. If the domain controller is a global catalog server, in the Delete Domain Controller dialog box, click Yes to continue with the deletion.
  8. If the domain controller currently holds one or more operations master roles, click OK to move the role or roles to the domain controller that is shown.

You cannot change this domain controller. If you want to move the role to a different domain controller, you must move the role after you complete the server metadata cleanup procedure.

To clean up server metadata by using Active Directory Sites and Services

  1. Open Active Directory Sites and Services: On the Start menu, point to Administrative Tools, and then click Active Directory Sites and Services.
  2. If you have identified replication partners in preparation for this procedure and if you are not connected to a replication partner of the removed domain controller whose metadata you are cleaning up, right-click Active Directory Users and Computers <DomainControllerName>, and then click Change Domain Controller. Click the name of the domain controller from which you want to remove the metadata, and then click OK.
  3. Expand the site of the domain controller that was forcibly removed, expand Servers, expand the name of the domain controller, right-click the NTDS Settings object, and then click Delete.
  4. In the Active Directory Domain Services dialog box, click Yes to confirm the NTDS Settings deletion.
  5. In the Deleting Domain Controller dialog box, select This Domain Controller is permanently offline and can no longer be demoted using the Active Directory Domain Services Installation Wizard (DCPROMO), and then click Delete.
  6. If the domain controller is a global catalog server, in the Delete Domain Controller dialog box, click Yes to continue with the deletion.
  7. If the domain controller currently holds one or more operations master roles, click OK to move the role or roles to the domain controller that is shown.
  8. Right-click the domain controller that was forcibly removed, and then click Delete.
  9. In the Active Directory Domain Services dialog box, click Yes to confirm the domain controller deletion.

 

 

Standard
Uncategorized

Cannot remove server from DAG

While trying to remove EXCH02 from 2013 DAG received below error and exch02 was not earlier not properly removed from DAG.

 

Error:

The following servers in the Windows Failover Cluster are not in Active Directory: Exch02. This is usually the result of an incomplete membership change (add or remove) of the database availability group.

Solution : Get-ClusterNode -Name “Exch02” | Remove-ClusterNode

Get-ClusterNode

Name             State
—-                    —–

Exch1               Up
Exch02             Down
Exch03             Up
Exch04             Up
Get-ClusterNode -Name “Exch02”

Get-ClusterNode -Name “Exch02” | Remove-ClusterNode

Standard