How to enable deduplication in Windows 8

Posted on Updated on

1. Download the package from the link and extract it in ‘C:\windows\system32’ folder

2. Run this command on elevated rights, this will add the package under ‘Programs and Features’ dism /online /add-package /packagepath:Microsoft-Windows-VdsInterop-Package~31bf3856ad364e35~amd64~~6.2.9200.16384.cab /packagepath:Microsoft-Windows-VdsInterop-Package~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cab /packagepath:Microsoft-Windows-FileServer-Package~31bf3856ad364e35~amd64~~6.2.9200.16384.cab /packagepath:Microsoft-Windows-FileServer-Package~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cab /packagepath:Microsoft-Windows-Dedup-Package~31bf3856ad364e35~amd64~~6.2.9200.16384.cab /packagepath:Microsoft-Windows-Dedup-Package~31bf3856ad364e35~amd64~en-US~6.2.9200.16384.cab dism /online /enable-feature /featurename:Dedup-Core /all

3. Next step is to enable Deduplication on a volume, by running an elevated Powershell Enable-DedupVolume <Drive Letter>

4. To return a list of volumes that have been enabled for data deduplication Get-dedupvolume | format-list

5. To start a dedup job Start-DedubJob -Volume <Drive Letter> -Type Optimization

6. You can query the progress of the job on the volume by using the ‘Get-DedupJob’ cmdlet

7. To check the status of deduplication, run the cmdlet ‘Update-DedupStatus <volume name>’

Powershell script to remove white-spaces on a CSV file and convert the time entry to 24-hour format

Posted on Updated on

#Here is a script to remove white-spaces on a CSV file and convert the time entry to 24-hour format.

$fileInput = <location and filename of the input file>

$fileOutput = <location and filename of the output file>

$delimeter = ‘,’

$header1 = ‘#Phone,Original Record,Client ID,Sub-Campaign,Device Attempted,Device Locale,Date Time,Last State,Last State Seconds,Call Seconds,Call Result,Best Contact’

# check if input file exist

if (!(test-path $fileinput)) {

write-host “File not found” exit

}

# check if output file already exist, delete file if true

if (test-path $fileoutput) {

Remove-Item $fileoutput

}

# import and build CSV in memory

#note single word IDs work better, I.E phone otherwise they need to be named with quotes

$header = “Phone”,”Original Record”,”Client ID”,”Sub-Campaign”,”Device Attempted”,”Device Locale”,”Date Time”,”Last State”,”Last State Seconds”,”Call Seconds”,”Call Result”,”Best Contact”

$csv = import-csv -path $fileInput -header $header

$csvTest = @();

# Display function for military time

# Input String

# Output String

function DisplayMilitaryDateTime( $InputDateString ){

[System.DateTime]$convertedDate = [System.DateTime]::Parse( $InputDateString );

#5/16/2014 13:00:02

return $convertedDate.ToString(“MM/dd/yyyy HH:mm:ss”);

}

Add-Content -Path $fileOutput -Value $header1

# all the clean and conversion of data would be here

foreach($line in $csv){

$outLine = “”;

# cleanup data and convert it

$outLine += $line.Phone.Trim(” “) + $delimeter ;

$outLine += $line.”Original Record”.Trim(” “)+ $delimeter;

$outLine += $line.”Client ID”.Trim(” “)+ $delimeter;

$outLine += $line.”Sub-Campaign”.Trim(” “)+ $delimeter;

$outLine += $line.”Device Attempted”.Trim(” “)+ $delimeter;

$outLine += $line.”Device Locale”.Trim(” “)+ $delimeter;

#note the function call

$outLine += DisplayMilitaryDateTime( $line.”Date Time”.Trim(” “) ) + $delimeter;

#this is added so another ‘,’ is added

$outLine += $delimeter; $outLine += $line.”Last State”.Trim(” “) + $delimeter;

$outLine += $line.”Last State Seconds”.Trim(” “) + $delimeter;

$outLine += $line.”Call Seconds”.Trim(” “) + $delimeter;

$outLine += $line.”Call Result”.Trim(” “) + $delimeter;

$outLine += $line.”Best Contact”.Trim(” “);

 

# manually build the output line and append it to the file

Add-Content -Path $fileOutput -Value $outLine }

 

#finally export it

# $csv | Export-Csv -Path $fileOutput -Delimiter ‘,’ -Encoding UTF8 -NoTypeInformation

 

#delete input file after successful conversion

Remove-Item $fileinput

How to test a SQL Connection String using notepad

Posted on Updated on

1. Open Notepad and create an empty file and save it with a .UDL extension. Example. Connect.UDL

2. Go to your desktop and double-click on the file you just created and the Data Link Properties box will popup.

3. Select the Provider tab and Find the provider that you want to connect with and click Next.

4. Now from the Connection tab, select or enter your source/ server name -> then enter information to log on to server -> and select the database on the server.

5. Click Test Connection and click OK to save the file.

 

NOTE:  If you get an error with the connection testing, please make sure that the SQL Server Browser is running.  You can check this by opening SQL Server Configuration Manager on the SQL server and go to the Services menu.