Thursday, 22 December 2011
Cisco Switch/Router Basic Console Configuration
configure terminal
hostname Switch-1
interface range fastethernet0/1 - 24
speed auto
no shut
no ip domain-lookup
line con 0
exec-timeout 0 0
password cisco
privilege level 15
logging synchronous
login
line vty 0 4
password cisco
login
line vty 5 15
password cisco
login
!
end
********************************************************
SAMPLE OF CISCO SWITCH SHOW VER
********************************************************
Saturday, 17 December 2011
How to consolidate a snapshot in VMware ESX when there are virtual machine errors
THIS ARTICLE IS APPLICABLE FOR FOLLOWING SCENARIOS
- Virtual machines with snapshots or delta disks stop responding or fail during a storage migration.
- When powering on a virtual machine, you see this error message:
The parent virtual disk has been modified since the child was created. - A virtual machine unexpectedly powers off and you see this error when you attempt to power it back on:
A general system error occurred: internal error. - Virtual machine log contains the entry:
vcpu-0| Msg_Question: msg.hbacommon.outofspace reply=0vcpu-0| Msg_Question:vcpu-0| msg.hbacommon.outofspace There is no more space for the redo log of W2003Sbs1-000001.vmdk.
vcpu-0| You may be able to continue this session by freeing disk space onvcpu-0| the relevant partition, and clicking Retry. Otherwise,vcpu-0| click Abort to terminate this session. - You are unable to remove snapshots for virtual machines on one or more datastores.
- The base disk of the virtual machine has been modified after a virtual machine snapshot or delta disk has been created.
- You have run out of space on a datastore containing the snapshot or delta disk.
- The guest operating system suffered an exception or kernel panic when a virtual machine snapshot was taken.
- If 10GB of changes were completed on one snapshotted virtual machine, its delta disk file size will increase proportionally by 10GB.
- Creating another snapshot causes the existing snapshot delta disk to retain its current size, however the next delta disk will begin to store all forthcoming modifications and writes. The base disk is still left unmodified since inception of the first snapshot.
- If another 15GB of changes were performed by the guest operating system, a total of 25GB of snapshot delta has now been recorded over the respective virtual machine's two snapshot delta disk files.
- For versions prior to VMware ESX 4.0 Update-2, the task of consolidating all snapshots (Remove All Snapshots task) causes unique changes stored only in the second snapshot delta disk to be copied upwards through the snapshot chain and into the first snapshot, or its "parent."
- This effect is recursive for each preceding parent file. As a result, the first snapshot delta disk file will grow by up to 15GB, accommodating all new blocks. Any common changes stored in both snapshot levels does not require additional space, however.
- The end result is a datastore requiring 40GB, or 25GB + 15GB.
- Additional space is required if the virtual machine is running during a Remove All Snapshots task. The amount of space consumed is dependent the amount of snapshot delta information the virtual machine has to temporarily store while its consolidation process completes.
- If the same 10GB were changed in the second snapshot, and just 5GB of unique block changes occurred, then the first snapshot will increase by 5GB during the consolidation, not the complete 15GB.
- Opting to save virtual machine memory contents with each Create Snapshot task requires additional space from the VMFS datastore. The amount of space required is equivalent to the amount of memory assigned to the virtual machine. This requirement can apply multiple times over, if multiple snapshots including virtual machine memory contents are created.
** Golden IT Rule : take good backups before doing anything **
Monday, 14 March 2011
Set-MailboxCalendarSettings Code Snippet
Thursday, 10 March 2011
Converting Mail User to Mail Enabled User With Mail Forwarding to External EMail Address (Exchange 2007)
$pwd = Read-Host "Enter Password" -Assecurestring
New-Mailuser -Name "Greg Perth" -ExternalEmailAddress "Greg.Perth@hotmail.com" -OrganizationalUnit "Perth" -Password $pwd -UserPrincipalName "Greg.Perth@mycompanydomain.com.au" -SamAccountName "Greg.Perth"
$obj = Get-MailUser -id "Greg Perth"
Disable-MailUser -id "Greg Perth" -confirm:$false
$timer = [diagnostics.stopwatch]::startnew()
$erroractionpreference = "silentlycontinue"
$mailboxsuccess = $false
while (($timer.elapsed.totalseconds -lt 900) -and (!($mailboxsuccess)))
{
$error.clear()
New-MailContact -Name $obj.Name -ExternalEmailAddress $obj.ExternalEmailAddress -OrganizationalUnit "PerthContacts" -Verbose:$false
if($error.count -eq 0)
{
write-host "Mail Contact successfully created"
$mailboxsuccess = $true
}
else
{
write-host "." -nonewline
start-sleep -s 30
}
}
$timer.stop()
$erroractionpreference = "continue"
$secs = "{0:N2}" -f ($timer.elapsed.totalseconds)
write-host "Mail Contact Process ran for: $secs seconds."
Enable-Mailbox -id "Greg Perth" -Database "Mailbox Database" -Verbose:$false
Set-Mailbox -id "Greg Perth" -ForwardingAddress $obj.DistinguishedName -DeliverToMailboxAndForward:$true -Verbose:$false
write-host "*** *** **** "
write-host "Successfully Converted Mail enabled User to Mailbox User with external mail forwarding."
write-host "*** *** ****"
Converting Mail User to Mail Enabled User (Exchange 2007)
Disable-MailUser -id "MailUser Id"
Enable-Mailbox -id "MailUser Id" -Database "Mailbox Database"
NOTE: Executing the Disable-MailUser will remove all the Exchange attributes from AD for "MailUser Id"
Restart Exchange 2007 Services From Powershell
Cut-Paste the following code in Powershell to RESTART Exchange Server 2007 services on your Exchange Server.
Stop-Service MSExchangeAdTopology
Stop-Service MSExchangeAntiSpamUpdate
Stop-Service MSExchangeEdgeSync
Stop-Service MSExchangeFDS
Stop-Service MSExchangeIMAP4
Stop-Service MSExchangeIS
Stop-Service MSExchangeMailSubmission
Stop-Service MSExchangeMailboxAssistants
Stop-Service MSExchangeMonitoring
Stop-Service MSExchangePOP3
Stop-Service MSExchangeRepl
Stop-Service MSExchangeSearch
Stop-Service MSExchangeServiceHost
Stop-Service MSExchangeSA
Stop-Service MSExchangeTransport
Stop-Service MSExchangeTransportLogSearch
Stop-Service msftesql-Exchange -Force
Start-Service MSExchangeAdTopology
Start-Service MSExchangeAntiSpamUpdate
Start-Service MSExchangeEdgeSync
Start-Service MSExchangeFDS
Start-Service MSExchangeIMAP4
Start-Service MSExchangeIS
Start-Service MSExchangeMailSubmission
Start-Service MSExchangeMailboxAssistants
Start-Service MSExchangeMonitoring
Start-Service MSExchangePOP3
Start-Service MSExchangeRepl
Start-Service MSExchangeSearch
Start-Service MSExchangeServiceHost
Start-Service MSExchangeSA
Start-Service MSExchangeTransport
Start-Service MSExchangeTransportLogSearch
Start-Service msftesql-Exchange
After running the above code give it a 30 seconds for all the services to come up.
-------------------------------------------------------------------------------------------------
YOU CAN DO THIS WAY TOO !!
Restart-Service MSExchangeEdgeSync -Force
Restart-Service MSExchangeFDS -Force
Restart-Service MSExchangeIMAP4 -Force
Restart-Service MSExchangeIS -Force
Restart-Service MSExchangeMailSubmission -Force
Restart-Service MSExchangeMailboxAssistants -Force
Restart-Service MSExchangeMonitoring -Force
Restart-Service MSExchangePOP3 -Force
Restart-Service MSExchangeRepl -Force
Restart-Service MSExchangeSearch -Force
Restart-Service MSExchangeServiceHost -Force
Restart-Service MSExchangeSA -Force
Restart-Service MSExchangeTransport -Force
Restart-Service MSExchangeTransportLogSearch -Force
Restart-Service msftesql-Exchange -Force -Force
------------------------------------------------------------------------------------------
Wednesday, 9 March 2011
Automating IIS installation after Installation of Windows Operating System
IIS installation can be troublesome for Server Administartors but not anymore.
If you have just installed your Windows 2003 ENT or Windows 2008 OS than you can follow the steps.
You will need an answere file, similar to the one below and you can save the 2 sections below as a TXT file.
[Components] aspnet=on
complusnetwork=on
dtcnetwork=off
bitsserverextensionsisapi=off
bitsserverextensionsmanager=off
iis_common= on
iis_ftp=off
fp_extensions=off
iis_inetmer=on
iis_nntp=off
iis_smtp=off
iis_asp=on
iis_internetdataconnector=on
sakit_web=on
tswebclient=on
iis_serversideincludes=on
iis_webdav=off
iis_www=on
appsrv_console=on
inetprint=off
[InternetServer]
SvcManualStart=www
PathFTPRoot=
PathWWWRoot=c:\Inetpub\Wwwroot
ApplicationDependency=
ExtensionFile=
DisableWebServiceOnUpgrade=True
(SAVE THE HIGHLIGHTED SECTION AS A TXT FILE ON THE SERVER)
(CHANGE THE SETTINGS IN THE ABOVE SECTION AS PER YOUR REQUIREMENT)
Open the command prompt on the server and type the following command
Sysocmgr.exe /i:sysoc.inf /u:%PathToUnattendFile%
If you still did'nt get it than look at the link below