Sunday, August 9, 2015

Move Ad Computer Accounts from csv File into Target OU.

In this example we will move selected computer accounts from csv file into target OU. You will need to prepare csv file similar the one below and name the first column “CN”  and save it to server where you will be running the script from.This script will be very handy if you need to move computers from different locations into selected target OU.

You will need to change few things within the script to make it work within your environment.

$TargetOU = 'OU=Computers,OU=VA,DC=TekPros,DC=com'  (Change this to make sure it suits your needs)

 

image

Here is the script

#################################################################
# This script will help to move bulk ad computer accounts into target OU
# Written 08/08/15 Casey, Dedeal
# Fell free to change use any part of this script
#
http://www.smtp25.blogspot.com/
#################################################################

#Importing AD Module
Write-Host " Importing AD Module..... "
import-module ActiveDirectory
Write-Host " Importing Move List..... "
# Reading list of computers from csv and loading into variable
$MoveList = Import-Csv -Path "C:\Temp\PC_Move_List.csv"
# defining Target Path
$TargetOU = 'OU=Computers,OU=VA,DC=TekPros,DC=com'
$countPC    = ($movelist).count
Write-Host " Starting import computers ..."

foreach ($Computer in $MoveList){   
    Write-Host " Moving Computer Accounts..."
    Get-ADComputer $Computer.CN | Move-ADObject -TargetPath $TargetOU
}

Write-Host " Completed Move List "

Write-Host " $countPC  Computers has been moved "

You can download the script from this link

https://gallery.technet.microsoft.com/scriptcenter/Move-AD-Computer-Object-4ed2c5f8

http://1drv.ms/1L07yMU

Oz Casey, Dedeal  ( MVP North America)
MCITP (EMA), MCITP (SA)
MCSE , M+, S+, MCDST
Security+, Project +, Server +

http://telnet25.wordpress.com/ (Blog)
http://smtp25.blogspot.com/ (Blog)

https://twitter.com/message_talk

Active Directory Moving Users to Another OU via CSV File.

In this task we will move AD users location from their current OU into different OU.

  • we will need to prepare CSV file contains all AD users ( names ) you wish to move into another OU ( Organizational Unit ) see the sample below. Name the first column as “name” and list all the account underneath.
  • Save this into a location on your server where you will be running the PS script from, for instance  C:\temp\Acc_MoveList.csv

image

image

This is the location where we will move all the accounts into

image

# Import AD Module
import-module ActiveDirectory

# Import CSV
$MoveList = Import-Csv -Path "C:\Temp\Acc_MoveList.csv"
# Specify target OU.This is where users will be moved.
$TargetOU =  "OU=SVC_Users,OU=VA,DC=TekPros,DC=com"
# Import the data from CSV file and assign it to variable
$Imported_csv = Import-Csv -Path "C:\temp\Acc_MoveList.csv"

$Imported_csv | ForEach-Object {
     # Retrieve DN of User.
     $UserDN  = (Get-ADUser -Identity $_.Name).distinguishedName
     Write-Host " Moving Accounts ..... "
     # Move user to target OU.
     Move-ADObject  -Identity $UserDN  -TargetPath $TargetOU
}
Write-Host " Completed move "
$total = ($MoveList).count
$total
Write-Host "Accounts have been moved succesfully..."

Few things you will need to change to run the PS,

  • $TargetOU =  "OU=SVC_Users,OU=VA,DC=TekPros,DC=com" ( you will need to change this to make sure it fits into your environment
  • $MoveList = Import-Csv -Path "C:\Temp\Acc_MoveList.csv" (you will need to change this to make sure it fits into your environment)

Once you make the changes you should be able to move the users listed on your CSV file with no issues.

image

Download the script and sample CSV from here

http://1drv.ms/1IXThhx

you can also download the script from  here

https://gallery.technet.microsoft.com/scriptcenter/Move-AD-users-into-target-4322d774

Oz Casey, Dedeal  ( MVP North America)
MCITP (EMA), MCITP (SA)
MCSE , M+, S+, MCDST
Security+, Project +, Server +

http://telnet25.wordpress.com/ (Blog)
http://smtp25.blogspot.com/ (Blog)

https://twitter.com/message_talk

Friday, July 24, 2015

Installing Exchange 2016 on Windows 2012 R2 Server

 

We will install Exchange 2016 on Windows 2012 R2 in a single labeled Forest/domain. Installing Exchange 2016 is very similar task compared  to Exchange 2013.  Follow the  basic steps outlined here to install your first Exchange 2016 server.

Make sure you have completed the prerequisite work outlined here after completing the prerequisite task, you can execute setup from install directory to run setup and start the install.

 

image

Follow the install wizard, it is pretty straight forward install.

clip_image001

clip_image002

clip_image003

clip_image004

clip_image005

clip_image006

clip_image007

clip_image008

clip_image009

clip_image010

image

Now we will open  EAC ( Exchange Admin Center ) and the Exchange PowerShell

image

image

you many want to PIN the exchange related shortcuts to start menu for easy access

 

image

here is  EAC and EMS

image

if you release the look is for the EAC is same as Exchange 2013.

image

I will rename the database to db1

 

image

image

Oz Casey, Dedeal  ( MVP North America)
MCITP (EMA), MCITP (SA)
MCSE , M+, S+, MCDST
Security+, Project +, Server +

http://telnet25.wordpress.com/ (Blog)
http://smtp25.blogspot.com/ (Blog)

https://twitter.com/message_talk

 

 

 

Installing Exchange 2016 on premises , prerequisite Task.

 

We will install Exchange 2016 into new Forest/Domain. In case you have missed E2016 preview  here is download link to try it out. Exchange 2016 is another major road map release for the greatest messaging application ever existed.

Installing Exchange 2016 Active Directory must meet following requirements

AD functional level;

  • Windows 2008 and the Schema Master ( FSMO ) running on Windows 2008 or later version
  • Windows 2012 R2 is required for all Exchange 2016 Server roles and management tools.

Active Directory Preparation;

NET Framework 4.5.2 on the computer that will be used to prepare Active Directory.

Install Remote Tools Administration Pack by running below PowerShell command

Install-WindowsFeature RSAT-ADDS

clip_image001

Mailbox Role;

Copy and paste the code below onto PowerShell command window.

Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation

clip_image002

clip_image003

Reboot the server by typing below PowerShell and pressing enter

Shutdown -r -f -t 5

For EDGE Role

Installing EDGE ROLE

Install-WindowsFeature ADLDS

Now install ;

clip_image004

clip_image005

clip_image006

clip_image007

Now install Unified Communications Managed API 4.0

clip_image008

clip_image009

Now we are ready to perform Exchange 2016 install into new forest/domain.

Oz Casey, Dedeal  ( MVP North America)
MCITP (EMA), MCITP (SA)
MCSE , M+, S+, MCDST
Security+, Project +, Server +

http://telnet25.wordpress.com/ (Blog)
http://smtp25.blogspot.com/ (Blog)

https://twitter.com/message_talk