Powershell to find version of Transport.exe on all Exchange Transport servers

Powershell to find version of Transport.exe on all Exchange Hub Transport server

$TsServer = Get-TransportServer
foreach($server in $TsServer){
$name = $server.name
$storever = [System.Diagnostics.FileVersionInfo]::GetVersionInfo(“\\$name\c$\Program Files\Microsoft\Exchange Server\Bin\EdgeTransport.exe”).Fileversion
$res = $server.name  + ” = ” + $storever
$res
}

Powershell to Find Store.exe Version on All Exchange Mailbox Servers

Powershell to Find Store.exe Version on All Exchange Mailbox Servers. We need to make sure that Store.exe is constant on all the servers.  Below script helps you to get same

$MBXServer = Get-mailboxServer
foreach($server in $MBXServer){
$name = $server.name
$storever = [System.Diagnostics.FileVersionInfo]::GetVersionInfo(“\\$name\c$\program files\microsoft\exchange server\bin\store.exe”).Fileversion
$res = $server.name  + ” = ” + $storever
$res
}

VBScript to Add users Security Group to local computer if Computer object is under specific OU

VBScript to Add users Security Group to local computer if Computer object is under specific OU. For Security reason we always need to make sure that only specific security groups are administrators of specific computers. This will always be the business requirement. With below script you can obtain this. Include this script in in the GPO and Add in to user logon script.


DIM objNetwork
DIM computerName
DIM ou
set objNetwork = createobject(“Wscript.Network”)
computerName = objNetwork.ComputerName
ou = getOUByComputerName(computerName)

on error resume next
Select Case ou

Case “OU=Computers,DC=domain,DC=com”
set group = GetObject(“WinNT://”& computerName &”/Administrators”)
group.Add “WinNT://domain/Group”
err.clear

Case “OU=Computers1,DC=domain,DC=com”
set group = GetObject(“WinNT://”& computerName &”/Administrators”)
group.Add “WinNT://domain/Group1”
err.clear

End Select

function getOUByComputerName(byval computerName)
DIM namingContext, ldapFilter, ou
DIM cn, cmd, rs
DIM objRootDSE
set objRootDSE = getobject(“LDAP://RootDSE”)
namingContext = objRootDSE.Get(“defaultNamingContext”)
set objRootDSE = nothing
ldapFilter = “<LDAP://” & namingContext & _
“>;(&(objectCategory=Computer)(name=” & computerName & “))” & _
“;distinguishedName;subtree”
Set cn = createobject(“ADODB.Connection”)
set cmd = createobject(“ADODB.Command”)
cn.open “Provider=ADsDSOObject;”
cmd.activeconnection = cn
cmd.commandtext = ldapFilter
set rs = cmd.execute
if rs.eof <> true and rs.bof <> true then
ou = rs(0)
ou = mid(ou,instr(ou,”,”)+1,len(ou)-instr(ou,”,”))
getOUByComputerName = ou

end if
rs.close
cn.close

end function

You can always find the copy from the below link

http://powershell.com/cs/cfs-filesystemfile.ashx/__key/CommunityServer.Components.UserFiles/00.00.00.30.62/AddAdminfinal.txt

Exchange Database – Dirty Shutdown

As Exchange Administrator it would be bad day if you have exchagne database in Dirty Shutdown State and you dont have required log files to perform soft recovery. Below link has a steps on how to perform soft recovery if you have al the require log file.

https://smtpport25.wordpress.com/2009/07/13/disaster-recovery-of-exchange-2007-mailbox-server/

If you dont have the required log files then you have to follow below steps to recover the database

1. Run ESEUTIL /P database_filename.edb (from the BIN folder and repair the edb files)
2. Delete the log and chk files.
3. Run eseutil /d database_filename.edb (Defrag the Database)
4. Run isinteg (isinteg -s servername -fix -test alltests) from the bin folder.
5. Mount the stores

Eseutil and Isinteg would be really long time , depending on the size of the database. Microsoft always recommends to keep the database size less then 100 GB. If you are using CCR environment then it can grow more then 100 GB as you will be multipe copies of the log files for recovery purpose