Pages

Search This Blog

Showing posts with label Command line. Show all posts
Showing posts with label Command line. Show all posts

Wednesday, February 20, 2013

Controlling the database path/location for Exchange 2013 database

As Exchange 2013 comes with the new management paradigm Exchange Administration Center ( EAC ) which is a web based management interface some of the basic functions were found to be missing. One of the missing functions is the ability to relocate ( move ) mailbox database(s) and log files via the console !

In order to overcome this there are some tips that will help you in minimizing the need of moving the databases of your Exchange 2013 servers , as below :

- Use the command line for installing the mailbox servers to control the name and the path of the initial server’s mailbox database by using /MdbName , /DbFilePath and /LogFolderPath switches :

Setup.exe /Mode:Install /IAcceptExchangeServerLicenseTerms /Roles:Mailbox /MdbName:MBDB-01 /DbFilePath:”D:\Exchange Databases/MBDB-01/MBDB-01.edb” /LogFolderPath:”L:\Exchange Logs
image

Once completed both database and logs will be at the assigned within the installation paths .


Wednesday, January 30, 2013

File Share Witness failed and resist deletion ( Microsoft Failover Cluster )

I was working on building an Exchange 2007 SCC lab for testing one of our customers scenarios prior applying to production . I built the cluster and all was going great till I want to change the file share witness folder name . I used the configure cluster quorum setting wizard and the new file share witness was created successfully .The problem is that there was another ( the old ) file share witness that mapped to a non existing folder . I tried to remove it from the failover cluster snap-in but there was no way to do it !

image

I tried also to use the Cluster.exe command line with the /delete switch but it also failed as the unneeded file share witness is a core resource .

Wednesday, September 19, 2012

Utilizing the power of Active Directory module for PowerShell to accomplish tasks fast and easy

I was working with a customer , who requested for an easy way to do the following two tasks :

  1. Identify all the installed operating system versions and their current service packs for all computers in his company’s Active Directory Domain.
  2. List all disabled computers accounts all over the domain and move them to a designed OU for review prior deletion

As his Active Directory is hosted by Windows Server 2008 R2 domain controllers I advised him to utilize the capabilities of Windows PowerShell with Active Directory module , as follow :

First of all , let’s list all available modules for Windows PowerShell , then import the one for Active Directory by executing the following commands at an elevated Windows PowerShell window :

Get-Module –ListAvailable

Import-Module ActiveDirectory

image

Wednesday, September 12, 2012

Windows Server roles and features duplication on multiple servers using PowerShell

In the process of servers preparation you may have multiple servers which will play the same role and thus require installation of the same Windows Server role(s) , role service(s) and feature(s) .

Most of admins do it the hardest way , by installing the role(s) , role service(s) and feature(s) names(s) for each server using Server Manager Sad smile.

An alternative way to be used is to install all required role(s) , role service(s) and feature(s) on a single server , export it to .XML file and then use the exported file to automate installation of the remaining servers .

Here is how to do :

  • Source Server Preparation : Install the required role(s) , role service(s) and feature(s) normally on one server using the traditional way ( Server Manager )
  • Once installation is completed , start an elevated Windows PowerShell Modules

image

Friday, September 7, 2012

How to find the current Exchange Server Schema Version

In a previous post I showed how to determine the current version of Schema version for Active Directory for this one I will show how to determine the Schema version for Exchange server.

In contrary to Active Directory , installing of a higher in service pack within the same edition can cause schema version change , as you can see below ( I added Forest ObjectVersion and Domain ObjectVersion as a bounce ) :

Exchange edition

Schema version

Forest objectVersion attribute of Organization container

Domain objectVersion attribute on Microsoft Exchange System Objects

Exchange 2000 RTM

4397

-

4406

Exchange 2000 SP3

4406

-

4406

Exchange 2003 RTM

6870

6903

6936

Exchange 2003 SP1

6870

6903

6936

Exchange 2003 SP2

6870

6903

6936

Exchange 2007 RTM

10628

10666

10628

Exchange 2007 SP1

11116

11221

11221

Exchange 2007 SP2

14622

11222

11221

Exchange 2007 SP3

14625

11222

11221

Exchange 2010 RTM

14622

12640

12639

Exchange 2010 SP1

14726

13214

13040

Exchange 2010 SP2

14732

14247

13040

Now , here are how to find your current Exchange Schema version ( for all , replace data in italic with yours )

Tuesday, September 4, 2012

How to find the current Active Directory Schema Version

The schema contains formal definitions of every object class that can be created in an Active Directory forest. The schema also contains formal definitions of every attribute that can or must exist in an Active Directory object.

During Domain Controllers upgrade , a mandatory step which is Schema extending must take place which changes ( increases ) the number of Schema version.

In this post I will show all the possible ways – according to my knowledge – by which you can identify your current Active Directory Schema version.

First of all , here is a list for Schema versions relative to Windows editions :

Windows Edition

Schema Version

Windows 2000 RTM with all Service packs

13

Windows Server 2003 RTM with all Service packs

30

Windows Server 2003 R2 RTM with all Service packs

31

Windows Server 2008 RTM with all Service packs

44

Windows Server 2008 R2 RTM with all Service packs

47

Windows Server 2012 RC

56

Now , here are how to find your current Active Directory Schema version ( for all , replace data in italic with yours )

  • Using GUI : by using either ADSIEdit / LDP.exe , navigate to :

      "CN=Schema,CN=Configuration,DC=itguydiaries,DC=net"

imageimage

Monday, March 19, 2012

Recover Active Directory Objects using Active Directory Recycle Bin

Recovering deleted objects was one of the hardest issues for Active Directory admins as it requires performing of an authoritative restore for Active Directory backup [ Authoritative restore includes performing of a non-authoritative restore followed by using of NTDSutil to mark certain Active Directory objects as authoritative objects so it can not be overwritten during post restore replication sync. ] 
Active Directory Recycle Bin helps minimize directory service downtime by enhancing your ability to preserve and restore accidentally deleted Active Directory objects without restoring Active Directory data from backups, restarting Active Directory Domain Services (AD DS), or rebooting domain controllers.
In this post I’ll show you how to raise functional level , enable Active Directory Recycle Bin and finally restore a deleted Active Directory object [ User object ] 

First : Set forest to Windows 2008 R2 mode :
This can be accomplished using  Active Directory Domain and Trusts snap-in or Active Directory module for PowerShell by using the following command :
Set-ADForestMode [-Identity] <ADForest> [-ForestMode] <ADForestMode>
 
In Active Directory module for PowerShell you can verify the result by executing Get-ADForest | FL Name,ForestMode cmdlet

For my lab environment :
  Set-ADForestMode -Identity itguydiaries.net -ForestMode Windows2008R2Forest

Saturday, March 17, 2012

Useful commands for Active Directory Groups management

With command line tools a lot of complex tasks can be accomplished easily and efficiently; I'll state below two of common tasks that admins may need to perform in Active Directory and explain how to perform those tasks in the easiest way.


Tasks :
  1. Copy group's membership from one user to another one
  2. Copy all members from one group to another group
To show you to perform these tasks ,I'll set two scenarios - one for each task - and demonstrate how to accomplish each of them . our scenarios are:
  1. TestUser1 is a domain user who is member of two groups [ TestGroup1 & TestGroup2 ] . We require that TestUser2 - a newly created domain user - to be a member of all Active Directory groups that TestUser1 is member in it.
  2. TestGroup3 includes the following members [ TestUser3 : TestUser7 ] ,those users are required to be added to another group named TestGroup4.
Here is a screen shoot indicating that all objects [ TestUsers & TestGroups ] are located at TestOU.