Powershell – Get the First and Last Day of the Month

You could do this in different ways with powershell. But the whole idea is to keep it simple

$CURRENTDATE=GET-DATE -Format "MM/dd/yyyy"
$FIRSTDAYOFMONTH=GET-DATE $CURRENTDATE -Day 1
$LASTDAYOFMONTH=GET-DATE $FIRSTDAYOFMONTH.AddMonths(1).AddSeconds(-1)

$FIRSTDAYOFMONTH
$LASTDAYOFMONTH

Have to type single/double quotes twice for them to appear

Quotes, Tilde and Caret Symbol appears only when clicked twice

If you are faced with the above error, it is most likely that you are using US International as your Keyboard Layout

Screen Shot from Window 8.1

  • Control Panel – Language

US_International

  • Click Options to change the Keyboard Input

us_international_input_method

  • Click Add an input method and select US / US English
  • Remove the US International entry and Save

Backup Exchange Server 2013 with Windows Server Backup

Files to be backed up on Exchange Server 2013

  • Database File (*.edb)
  • Transaction Log Files (*.log)
  • Checkpoint file (*.chk)

More details on these files can be found on this LINK

Install Windows Server Backup on your Windows Server 2012

  • From Server Manager – Select Add Roles and Features
  • Under Features, select Windows Server Backup as illustrated below

 

windowsserverbackup

  • Once Installed – Open the Windows Server Backup utility

windows_server_backup

  • Select Backup Schedule / Backup Once as per your requirement
  • Select destination type as per your setup

destination

  • Since you are aware which files are required to be backed up, you can choose the custom option to manually select the files you require to backup

backup_schedule

  • Select the backup type as per your current settings

vssbackup

  • If you are not using any other tools for backup of the Exchange; select VSS Full Backup to ensure the log files are purged after the backup is completed

Once the backup completes, click View Details to verify the backup is done properly

view_details_windows_server_backup

 

In addition to this run below command from Exchange Management Shell to verify the backup

Get-MailboxDatabase -Server Servername -Status | select name,last*backup

The Columns for Last Full Backup should show the updated date

Robocopy and the many ways to use it!

Powerful File Management with Robocopy

Robocopy is a utility developed my Microsoft to enable copying higher volumes of data (in GB’s and TB’s) from one location (on a server/workstation) to another (server/workstation). The normal copying may not do the job for us as they do keep getting interrupted with pop ups on whether or not to copy a certain file/files. With Robocopy, this issue can be overlooked at. When I first used robocopy, I wasn’t too sure about how the commands would be like. However the robocopy commands are simple and can be used on a simple command prompt or even on Windows Power Shell! I particularly found this website very helpful with the different attributes or options we could add to the robocopy command. The normal usage of robocopy is ROBOCOPY Source_folder Destination_folder [files_to_copy] [options] The various [options] that can be used along with the robocopy command are available in the link provided above. Now there may be many of them like me who wouldn’t want to type in a lot of commands and instead use a GUI. Well, this is possible too. Thanks to a few good souls at Microsoft this is now possible. These applications Robocopy GUI and RichCopy were developed in 2006 and 2009 respectively. One can download them and try to use them with whatever options he/she requires. For my case I used Robocopy GUI as I was quite comfortable with it because of it’s simple GUI. But beware! To install these applications on Windows OS’s like Windows 7, Windows 8 or 8.1, Windows Server 2008R2, 2012, 2012R2 one may need to install the older .NetFramework versions. I had encountered such an issue while installing Robocopy GUI on Windows Server 2012R2. So go on, try this utility and see how helpful it is. The transfer rate is properly controlled and there were no interruptions or pop ups waiting for the user to acknowledge.

Backup Remote Agent (Backup Exec 2014) installation failing due to “Microsoft VC++ Redistributables (x64) installation failed” error.

We happened to upgrade our Symantec Backup Exec 2010R3 to Symantec Backup Exec 2014 recently. Although the GUI was quite straight forward with the older one, the new one’s GUI looked quite confusing at the start. But after exploring a bit, it looked an animal that could be tamed. The first job that we ran failed. Although the backup was done, the remote agents had caused a failure of the job itself. When I tried pushing the agent updates from the main backup server, the upgrades failed. I then realized that I may have to do this manually.

From Symantec websites I had figured out how to do the installation manually. You may go to the link and look for the section “Local (manual) installation using the GUI method”. But this story didn’t end ever so happily! Upon doing the installation manually, it failed. It failed with an error “Microsoft VC++ Redistributables (x64) installation failed”. Just when I thought that the whole world crashed upon me, I figured out from another blog to bypass this.

While the link above suggests that we copy the RASW32 or RAWSX64 folder, it doesn’t say anywhere to copy the “VCRedist” folder too! This is the hidden trick. So to summarise, my steps where as follows:

  1. Copy the RAWS32 or RAWSX64 folder and the VCRedist folder together to a location on the remote server. It could also be the Desktop of the user.
  2. Run the setup as was described in the link that was posted above.
  3. The error should not appear after this. I didn’t face any error after this.

Please do bear in mind that the servers may require a restart if the installation is being done with the old remote agent still installed! Even if an old agent doesn’t reside and the installation is done, it is always recommended to restart the server after the installation.

Windows cannot be installed to this disk. This computer’s hardware may not support booting to this disk. Ensure the disk’s controller is enabled in the computers BIOS menu

Unable to Install Windows 7 to Disk

If you encountered above error when installing an Operating System on your PC; use below solution

  • Restart your system and get into BIOS
  • Change the Boot Mode/Priority from Legacy to AHCI or UEFI
  • Save the BIOS Settings
  • Retry the installation and it will work as intended