Exchange Management Shell Commands (work in progress)

This is more a reference for myself:

I covered the basics of message tracking in:

Database size:

Get-MailboxDatabase -Status | Select Name,DatabaseSize

PublicFolderDatabase size:

Get-PublicFolderDatabase -Status | Select Name,DatabaseSize

To determine role assignments:


Create a recovery mailbox:

New-MailboxDatabase -Recovery -Name “Recovery DB Name” -Server EXCHANGESERVERNAME

To check mailbox stats:

Get-MailboxDatabase -Status | Format-List Mame,DatabaseSize,AvailableNewMailboxSpace

Delete a mailbox database. Once removed, you can delete the files from the file system.:

Remove-MailboxDatabase -Identity “Recovery DB Name”

The right way to create a recovery database:

New-MailboxDatabase -Recovery -Name “Recovery DB Name” -Server EXCHANGESERVERNAME -EdbFilePath Drive:\Directory\Filename.edb -LogFolderPath Drive:\Directory

Move a mailbox:
You can use the canonical name of the object with the mailbox ( DOMAIN.LOCAL/OU/OU/Name ) to move from EMS.

Note: You may need to enable inheritance. This can be dome from the ADUC. Access the Properties for the user and click on Security tab. If it is not visible, you need to enable your ADUC view for Advanced Features. Once on the Security tab, click Advanced, and then down in the bottom left click “Enable inheritance”. This is on a Windows 2012 R2 domain controller. It might a little different dialog on older versions of Windows server.

[PS] >’DOMAIN.LOCAL/TahityOU/SurfingOU/Cool Dude’ | New-MoveRequest -TargetDatabase ‘My Exchange Database’

DisplayName Status TotalMailboxSize TotalArchiveSize PercentCompl
———– —— —————- —————- ————
Cool Dude Queued 5 B (5 bytes) 0

Check the status of all move requests:

[PS] >Get-MoveRequest

Check Cool Dude’s move request:

[PS] >Get-MoveRequest -Identity ‘cooldude@tahiti.surfing’

Nice, but what do I do to get all those canonical names?
The following will give you all the canonical names for all objects in your domain. From a domain controller, fire up powershell:

PS > Get-AdUser -Properties CanonicalName -Filter ‘*’ | Select CanonicalName

I am sure there is a better way to do this, but this will give some output that will have the CanonicalName and Exchange mail server for an object. You can work with this output to come with a list that of objects that need to be moved.

PS > Get-AdUser -Properties CanonicalName,msExchHomeServerName -Filter ‘*’ | Select CanonicalName,msExchHomeServerName | Format-List

I have noticed that sometimes when I move a mailbox from one database to another and then I display mailbox statistics, I will have two different results for the same mailbox. To find these, you need you use Get-MailboxStatistics and filter for MailboxState of SoftDeleted:

PS > Get-MailboxStatistics -server servername | Select DisplayName,DisconnectReason,Database | findstr “SoftDeleted”

And then to remove the SoftDeleted version of the mailbox:

PS > Remove-StoreMailbox -Identity “mailboxidentity” -Database “mailboxdatabase” -MailboxState SoftDeleted

This will create a Send Connector for use in your LAN. In my case, it is a linux server. Create a Send Connector:

New-SendConnector -Name ‘Some Name’ -Usage ‘Internal’ -AddressSpaces ‘SMTP:hostORdomainname;1’ -IsScopedConnector $false -DNSRoutingEnabled $false -SmartHosts ‘[aaa.bbb.ccc.ddd]’ -SmartHostAuthMechanism ‘None’ -UseExternalDNSServersEnabled $false -SourceTransportServers ‘MY-EXCHG01’

Create a new mail contact:

New-MailContact -ExternalEmailAddress ‘SMTP:mycontact@email.address’ -Name ‘mycontact’ -Alias ‘mycontact’ -FirstName ‘My’ -Initials ‘MC’ -LastName ‘Contact’ -OrganizationalUnit ‘DOMAIN.LOCAL/OU/OU’

To check and make active components:

[PS] C:\> Get-ServerComponentState

Server Component State
—— ——— —–
VMEXCHG2013.greattechhelp.local ServerWideOffline Inactive
VMEXCHG2013.greattechhelp.local HubTransport Inactive
VMEXCHG2013.greattechhelp.local FrontendTransport Inactive
VMEXCHG2013.greattechhelp.local Monitoring Inactive
VMEXCHG2013.greattechhelp.local RecoveryActionsEnabled Inactive
VMEXCHG2013.greattechhelp.local AutoDiscoverProxy Inactive
VMEXCHG2013.greattechhelp.local ActiveSyncProxy Inactive
VMEXCHG2013.greattechhelp.local EcpProxy Inactive
VMEXCHG2013.greattechhelp.local EwsProxy Inactive
VMEXCHG2013.greattechhelp.local ImapProxy Inactive
VMEXCHG2013.greattechhelp.local OabProxy Inactive
VMEXCHG2013.greattechhelp.local OwaProxy Inactive
VMEXCHG2013.greattechhelp.local PopProxy Inactive
VMEXCHG2013.greattechhelp.local PushNotificationsProxy Inactive
VMEXCHG2013.greattechhelp.local RpsProxy Inactive
VMEXCHG2013.greattechhelp.local RwsProxy Inactive
VMEXCHG2013.greattechhelp.local RpcProxy Inactive
VMEXCHG2013.greattechhelp.local UMCallRouter Inactive
VMEXCHG2013.greattechhelp.local XropProxy Inactive
VMEXCHG2013.greattechhelp.local HttpProxyAvailabilityGroup Inactive
VMEXCHG2013.greattechhelp.local ForwardSyncDaemon Inactive
VMEXCHG2013.greattechhelp.local ProvisioningRps Inactive
VMEXCHG2013.greattechhelp.local MapiProxy Inactive
VMEXCHG2013.greattechhelp.local EdgeTransport Inactive
VMEXCHG2013.greattechhelp.local HighAvailability Inactive
VMEXCHG2013.greattechhelp.local SharedCache Inactive

To make all your configured components active:

[PS] C:\>Set-serverComponentState -Identity vmexchg2013 -Component ServerWideOffline -State Active -Requester Functional

Check again:

[PS] C:\> Get-ServerComponentState
Server Component State
—— ——— —–
VMEXCHG2013.greattechhelp.local ServerWideOffline Active
VMEXCHG2013.greattechhelp.local HubTransport Active
VMEXCHG2013.greattechhelp.local FrontendTransport Active
VMEXCHG2013.greattechhelp.local Monitoring Inactive
VMEXCHG2013.greattechhelp.local RecoveryActionsEnabled Inactive
VMEXCHG2013.greattechhelp.local AutoDiscoverProxy Active
VMEXCHG2013.greattechhelp.local ActiveSyncProxy Active
VMEXCHG2013.greattechhelp.local EcpProxy Active
VMEXCHG2013.greattechhelp.local EwsProxy Active
VMEXCHG2013.greattechhelp.local ImapProxy Active
VMEXCHG2013.greattechhelp.local OabProxy Active
VMEXCHG2013.greattechhelp.local OwaProxy Active
VMEXCHG2013.greattechhelp.local PopProxy Active
VMEXCHG2013.greattechhelp.local PushNotificationsProxy Active
VMEXCHG2013.greattechhelp.local RpsProxy Active
VMEXCHG2013.greattechhelp.local RwsProxy Active
VMEXCHG2013.greattechhelp.local RpcProxy Active
VMEXCHG2013.greattechhelp.local UMCallRouter Active
VMEXCHG2013.greattechhelp.local XropProxy Active
VMEXCHG2013.greattechhelp.local HttpProxyAvailabilityGroup Active
VMEXCHG2013.greattechhelp.local ForwardSyncDaemon Active
VMEXCHG2013.greattechhelp.local ProvisioningRps Active
VMEXCHG2013.greattechhelp.local MapiProxy Inactive
VMEXCHG2013.greattechhelp.local EdgeTransport Active
VMEXCHG2013.greattechhelp.local HighAvailability Active
VMEXCHG2013.greattechhelp.local SharedCache Active

Enter Product License Key:

Set-ExchangeServer -Identity ‘MY-EXCHG01’ -ProductKey ‘AAAAA-BBBBB-CCCCC-DDDDD-EEEEE’

List Services:

[PS] C:\>Get-Service

Status Name DisplayName
—— —- ———–
Stopped AeLookupSvc Application Experience
Stopped ALG Application Layer Gateway Service
Stopped AllUserInstallA… Windows All-User Install Agent
Running AppHostSvc Application Host Helper Service
Stopped AppIDSvc Application Identity
Stopped Appinfo Application Information
Stopped AppMgmt Application Management
Stopped aspnet_state ASP.NET State Service
Stopped AudioEndpointBu… Windows Audio Endpoint Builder
Stopped Audiosrv Windows Audio
Stopped AxInstSV ActiveX Installer (AxInstSV)
Running BackupExecAgent… Backup Exec Remote Agent for Windows
Running BackupExecAgent… Backup Exec Agent Browser
Running BackupExecDevic… Backup Exec Device & Media Service
Running BackupExecJobEn… Backup Exec Job Engine
Running BackupExecManag… Backup Exec Management Service
Running BackupExecRPCSe… Backup Exec Server
Running bedbg Backup Exec Error Recording Service

Find a service:

[PS] C:\>Get-Service | findstr Inform
Stopped Appinfo Application Information
Running MSExchangeIS Microsoft Exchange Information Store

Restart and service:
[PS] C:\>Restart-Service MSExchangeIS
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…
WARNING: Waiting for service ‘Microsoft Exchange Information Store (MSExchangeIS)’ to finish stopping…

Check and Modify Role Memberships:
First, the “Organization Management” Role is the most powerful role in Exchange 2010 and Exchange 2013.

To list the members of a role:

[PS] >Get-RoleGroupMember “Organization Management”
Creating a new session for implicit remoting of “Get-RoleGroupMember” command…

Name RecipientType
—- ————-
Administrator UserMailbox

To add somebody to a role:

[PS] >Get-RoleGroupMember “Organization Management”

Name RecipientType
—- ————-
Administrator UserMailbox
Jim Zimmerman UserMailbox

Here is list of Exchange roles in Exchange 2010. I believe most of these are in Exchange 2013 too:

Connector commands:
List Connectors:

[PS] C:\>Get-ReceiveConnector

Identity Bindings Enabled
——– ——– ——-
MYEXSERVER\Non-Exchange Relay Support {} True

[PS] C:\>Get-SendConnector

Identity AddressSpaces Enabled
——– ————- ——-
Production SMTP Connector {SMTP:*;1} True

To see all the settings for a single connector:

[PS] C:\>Get-ReceiveConnector “MYEXSERVER\Non-Exchange Relay Support” | Format-List

To change a setting for a connector:

[PS] C:\>Get-ReceiveConnector “MYEXSERVER\Non-Exchange Relay Support” -ProtocolLoggingLevel Verbose

A note on connector logging:
The connector logs are stored on the Transport Hub server in the ExchangeInstallPath\TransportRoles/Logs/ProtocolLog/SmtpReceive for the receive connectors, and ExchangeInstallPath\TransportRoles/Logs/ProtocolLog/SmtpSend for the send connectors.

Also, in a mixed version environment, the connector may have to be “upgraded” to support logging. I was not able to turn on the the logging for my old Exchange 2003 connectors. Upgrading basically consists of deleting and creating again.

To view basic information about a mailbox:

[PS] C:\>Get-Mailbox “mailboxname

To view detailed information about a mailbox:

[PS] C:\>Get-Mailbox “mailboxname” | Format-List

To filter that list:

[PS] C:\>Get-Mailbox “mailboxname” | Format-List properties

[PS] C:\>Get-Mailbox “mailboxname” | Select properties

To see mailbox usage, number of items, etc:

[PS] C:\>Get-MailboxStatistics “mailboxname

Which you can filter as well:

[PS] C:\>Get-MailboxStatistics “mailboxname” | Format-List properties

[PS] C:\>Get-MailboxStatistics “mailboxname” | Select properties

View mailboxes and sort them by size:

[PS] C:\>Get-MailboxStatistics | Select DisplayName,TotalItemSize,LastLoggedOnUserAccount,LastLogonTime | Sort-Object -Property TotalItemSize

This works too:

[PS] C:\>Get-MailboxStatistics -Server servername | Select DisplayName,ItemCount,TotalItemSize | Sort TotalItemSize

To view mailbox logon information:

[PS] C:\>Get-LogonStatistics ‘mailboxname’

To view who has access to a mailbox:

[PS] C:\>Get-MailboxPermission “mailboxname

Add mailbox permission:

[PS] C:\>Add-MailboxPermission -Identity ‘mailboxidentity‘ -User ‘domain\username‘ -AccessRights ‘FullAccess’

Move a mailbox:

[PS] C:\>’cntouseraccount’ | New-MoveRequest -TargetDatabase ‘databasename


[PS] C:\>’MY.DOMAIN/MYOU/my name’ | New-MoveRequest -TargetDatabase ‘MYEXCHANGEDB’

To check move request statuses:

[PS] C:\>Get-MoveRequest

For more detail, like how far a move has progressed:

[PS] C:\>Get-MoveRequestStatistics -IncludeReport

To set the bad item limit for a mailbox that has partially been transferred:

[PS] C:\>Set-MoveRequest -Identity “my name” -BadItemLimit numberofitems

To resume a failed mailbox move:

[PS] C:\>Resume-MoveRequest ‘my name’

To move a mailbox that has some corrupted items (in this case, one):

[PS] C:\>’MY.DOMAIN/MYOU/my name’ | New-MoveRequest -BadItemLimit 1 -TargetDatabase ‘MYEXCHANGEDB’

If you have a lot of issues:

[PS] C:\>’MY.DOMAIN/MYOU/my name’ | New-MoveRequest -BadItemLimit 100 -AcceptLargeDataLoss -TargetDatabase ‘MYEXCHANGEDB’

Note: these items will then not be migrated over the new location.

To count the number of items in some output use Measure-Object:

This more of a PowerShell tip than an EMS tip, but it is good to know when using EMS.

[PS] C:\>Get-Mailbox | Measure-Object

Count : 124
Average :
Sum :
Maximum :
Minimum :
Property :

Queue notes:

Check queues:

[PS] C:\>Get-Message -Server servername

Remove a message from a queue:

[PS] C:\>Remove-Message -Identity messageidentity

[PS] C:\>Write-Output Output something.

To count the number message received on a day:

[PS] C:\>Get-MessageTrackingLog -Start “mm/dd/yyyy 00:00″ -End “mm/dd/yyyy 23:59″ -EventID RECEIVE | Measure-Object

To find mailbox sizes and sort by size:

[PS] C:\>Get-MailboxStatistics -Server servername | Select DisplayName,TotalItemSize | Sort TotalItemSize

How to restore Outlook views

To restore your Outlook views to the default, you just need to start Outlook with a cleanviews switch. In Windows 7 and up, it is easiest to let search do the work for you. Just type in the command:

outlook.exe /cleanviews

There are quite a few other switches available for Outlook 2010 and Outlook 2013.

I have used the /safe switch many times in the past for older versions when I have trouble with Outlook crashing.

VMWare ESXi and HP DL380 Heap issue.

I was getting the following message when I would try to start up a VM on an HP DL380.

Heap globalCartel-1 already at its maximum size of 7869288. Cannot expand. Could not start VMX: msg.vmk.status.VMK_NO_MEMORY

The machine had plenty of memory and seemed to operating fine for currently running VMs. When I brought up the direct console on the machine, there was screen full of the following:

/bin/sh: can’t fork

I could not enter any commands other than “exit.” I could log in and out, and that is about it.

In VMWare KB article 2085618, it acknowledged the issue with the HP specific image and the HP AMS driver.

Updated the HP AMS driver per VMWare KB article 2085618.

To determine version running:

esxcli software vib list | grep ams

Old version:

# esxcli software vib list | grep ams
hp-ams 550.10.0.0-18.1198610 Hewlett-Packard PartnerSupported 2014-11-07

Download updated driver from HP:

Then, I used scp to copy the downloaded zip file to my ESXi 5.5 server. I copied it to a hp-ams-esxi5.5-bundle- directory I created. Directory: /vmfs/volumes/vmhost02-datastore1/Software/hp-ams-esxi5.5-bundle-10.0.1-2.

Login to the ESXi host using ssh.

# cd /vmfs/volumes/vmhost02-datastore1/Software/hp-ams-esxi5.5-bundle-10.0.1-2

Unzip the file:

# unzip
inflating: index.xml
inflating: vendor-index.xml
inflating: hp-esxi-fc-enablement-550.2.1.8-1198610.vib
inflating: hp-smx-limited-550.
inflating: char-hpilo-550.
inflating: char-hpcru-
inflating: hp-ams-550.10.0.1-07.1198610.vib

Files contained in the zip:

# ls -l
total 19456
-rw-r–r– 1 root root 13590 Apr 29 12:15 char-hpcru-
-rw-r–r– 1 root root 12676 Apr 29 12:15 char-hpilo-550.
-rw-r–r– 1 root root 1271770 Apr 29 12:15 hp-ams-550.10.0.1-07.1198610.vib
-rw-r–r– 1 root root 6829546 Apr 29 12:15
-rw-r–r– 1 root root 1213780 Apr 29 12:15 hp-esxi-fc-enablement-550.2.1.8-1198610.vib
-rw-r–r– 1 root root 4482274 Apr 29 12:15 hp-smx-limited-550.
-rw——- 1 root root 328 Apr 29 12:15 index.xml
-rw-r–r– 1 root root 8531 Apr 29 12:15
-rw——- 1 root root 238 Apr 29 12:15 vendor-index.xml

Shutdown or migrate all the guests on the ESXi server, and then put the server in maintenance mode:

# esxcli system maintenanceMode set –enable on

Update the software:

# esxcli software vib update -v /vmfs/volumes/542c3aae-03b91418-ff2a-a0d3c1f0cdf0/Software/hp-ams-esxi5.5-bundle-10.0.1-2/hp
Installation Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: Hewlett-Packard_bootbank_hp-ams_550.10.0.1-07.1198610
VIBs Removed: Hewlett-Packard_bootbank_hp-ams_550.10.0.0-18.1198610
VIBs Skipped:

At this point, you need to reboot the ESXi host.

New version:
# esxcli software vib list | grep ams
hp-ams 550.10.0.1-07.1198610 Hewlett-Packard PartnerSupported 2015-04-29

Take the server out of maintenance mode:

# esxcli system maintenanceMode set –enable off

Migrate or startup guests back to the server.

SQLite and fail2ban

OS: CentOS7

I wanted to see exactly how and where the fail2ban IP addresses were stored. Looking in the fail2ban.conf file, I found the following:

dbfile = /var/lib/fail2ban/fail2ban.sqlite3

So, I did a little research to try to find out how access the database.

To open or connect to the database:

# sqlite3 /var/lib/fail2ban/fail2ban.sqlite3

To list all the tables in the database:

sqlite> .tables
bans fail2banDb jails logs

To query a table:

sqlite> SELECT * FROM logs;

Another table:

sqlite> SELECT * FROM bans;

To disconnect from the database:

sqlite> .quit

CentOS – Convert PST to MBOX

To convert a PST file that was created by exporting email from Outlook in Windows, you can use libpst. It is in the CentOS 7 base repository.

# yum install libpst

Then, to convert a PST to MBOX:

# readpst my.pst

This will create an mbox file for each of the folders, including sub-folders if they were exported in Outlook.

GPG basic commands

Export your public key:
gpg –armor -o filename.asc –export localemailaddress

Generate key:
gpg –gen-key

Generate key with more options:
gpg –no-default-keyring –keyring $PWD/.gpg/jgz-keyring –secret-keyring $PWD/.gpg/jgz-secring –trustdb-name $PWD/.gpg/jgz-trustdb –no-random-seed-file –gen-key

Delete private keyring:
gpg –delete-secret-key user # Either email or Real Name in quotes

Delete pub key from keyring:
gpg –delete-key user # Either email or Real Name in quotes

Import public key:
gpg –import publickeyfile.asc

Decrypt a file:
gpg -o filename –decrypt filename.gpg

Encrypt a file:
gpg –output filename.gpg –encrypt –recipient recipeientemailaddress filename # recipientemailaddress is the email address used for a public previously imported.

Edit/trust key:
gpg –edit-key 12345678
gpg> trust

Check an existing key fingerprint:
gpg –fingerprint emailaddress

CentOS 7 change timezone.

To List all timezones:

# timedatectl list-timezones

To set to the new timezone:

# timedatectl set-timezone newtimezone

Sample output:

# timedatectl list-timezones | grep Angeles
# timedatectl set-timezone America/Los_Angeles
# date
Thu Mar 5 11:56:43 PST 2015
# ls -l /etc/localtime
lrwxrwxrwx. 1 root root 41 Mar 5 11:56 /etc/localtime -> ../usr/share/zoneinfo/America/Los_Angeles

To view your current timezone configuration:

# timedatectl status

More netsh firewall command options in Windows.

Here is some very good information from Microsoft for the netsh command in Windows:

I have just listed a few of the commands in both the new version of the command and the old.

Show all the current firewall rules:

netsh advfirewall firewall show rule name=all

To disable or enable all firewall profiles (Domain,Private or Public):

netsh firewall set opmode ENABLE


netsh firewall set opmode DISABLE


netsh advfirewall set allprofiles state on


netsh advfirewall set allprofiles state off

To reset the firewall back to the defaults:

netsh firewall reset


netsh advfirewall reset

To log firewall activity:

netsh firewall set logging “C:\FWLogs\FW.log” 4096 ENABLE ENABLE


netsh advfirewall set currentprofile logging filename “C:\FWLogs\FW.log”

To open or close access to a network port:

netsh firewall add portopening TCP 80 “Open Port 80”


netsh firewall delete portopening TCP 80 “Open Port 80”


netsh advfirewall firewall add rule name=”Open Port 80″ dir=in action=allow protocol=TCP localport=80


netsh advfirewall firewall delete rule name=”Open Port 80″ protocol=tcp localport=80

To enable a program:

netsh firewall add allowedprogram C:\myprograms\myprogram.exe “Allow My Program” ENABLE


netsh advfirewall firewall add rule name=”Allow My Program” dir=in action=allow program=”C:\myprograms\myprogram.exe”

Chroot SFTP only on CentOS 6.

CentOS: 6.6

When setting an SFTP server, you may want to restrict or jail the SFTP users to only one location without restricting all aspects of openssh. This is how I restricted SFTP without impacting all of openssh:

Create the group you will match to and therefore add users to to grant SFTP access:

# groupadd sftp

Create a user:

# useradd -G sftp -d /into -s /sbin/nologin testuser

Notice the home directory. This is the logical root location for the user. Also, note that the shell is nologin to prevent ssh access.

Set the password:

# passwd testuser

Make a backup copy of the sshd_config file and make the following changes to the existing file:

# cp -rp sshd_config sshd_config.orig
# vi sshd_config

# JGZ – Force to use openssh in-process sftp server
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp

# JGZ – Match to group to chroot
Match Group sftp
ChrootDirectory /sftpdir/%u
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp

Restart the service:

# service sshd restart

It is very important that the directory permissions are correct. Create directories and set permissions:

# mkdir /sftpdir
# chmod 755 /sftpdir
# ls -ld /sftpdir
drwxr-xr-x. 3 root root 4096 Feb 27 05:53 /sftpdir
# mkdir /sftpdir/testuser
# chmod 755 /sftpdir/testuser
# ls -ld /sftpdir/testuser/
drwxr-xr-x. 3 root root 4096 Feb 27 14:57 /sftpdir/testuser/
# mkdir /sftpdir/testuser/into
# chown testuser.sftp /sftpdir/testuser/into
# chmod 755 /sftpdir/testuser/into
# ls -ld /sftpdir/testuser/into
drwxr-xr-x. 2 testuser sftp 4096 Feb 27 15:07 /sftpdir/testuser/into/

It should be simple enough to create a script to create new users. Basically, this what you need:
# useradd -G sftp -d /intocbb -s /sbin/nologin testuser1
# mkdir -p /home/testuser1/intocbb
# chown testuser1.sftp intocbb/
# passwd testuser1

Nagios log date conversion

To convert the nagios date timestamp in the nagios.log to a standard time format, use:

perl -pe ‘s/(\d+)/localtime($1)/e’ /var/log/nagios3/nagios.log

Return top