Author Archives: Steve Renard

About Steve Renard

Steve Renard is a French IT Consultant working in Switzerland. He is a 100% Powershell passionate always looking for automate tasks to save more time and to be more productive in his day-to-day work. He is working on a project to build a complete and centralized FAQ (link on twitter) to contribute to the Powershell community and writes some articles related to best practices and optimization techniques for Powershell.

Powershell Tip #131: Add certificates to Personal, Root and Intermediate stores

Tip: You can add certificates to Personal, Root and Intermediate stores (LocalMachine)

Personal

======

Root

======

Intermediate

======

MSDN

StoreLocation Enumeration
StoreName Enumeration


previous-button

Powershell Tip #130: Convert ticks <> datetime

Tip: You can convert tickets to datetime and vice versa.

Convert ticks to datetime

Convert datetime to ticks


previous-buttonnext-button

Powershell Tip #129: Get midnight time

Tip: You can get the midnight time :


previous-buttonnext-button

Powershell Tip #127: Wait for EMC Avamar Backup to be completed

Tip: You need to wait until the EMC Avamar Backup client finishes the backup.

avamar-backup

An easy way to do that is to check if the processes avtar and avvss are running.


previous-buttonnext-button

Powershell Tip #125: Identify the duplicates headers of a CSV file

Tip: You can identify the headers duplicated in a CSV file.

It can happen if someone save as CSV an Excel file and some duplicates were repeated multiple times by mistake.

excel-file-duplicates-headers

When trying to import the CSV, we can only see the first duplicate found but not all of them (SamAccountName and Department).

import-csv-duplicates-powershell

Here we can see the two duplicates headers :

import-csv-duplicates-powershell-found

 


previous-buttonnext-button

Powershell Tip #124: Extract the OU (Organizational Unit) from DN (Distinguished Name) in Active Directory

Tip: You can extract the OU (Organizational Unit) from DN (Distinguished Name) in Active Directory.

For example, someone sent you one report with DN only and you need to extract the OU.

extract-ou-from-dn-powershell


previous-buttonnext-button

Powershell Tip #123: Extract the CN (Common Name) from DN (Distinguished Name) in Active Directory

Tip: You can extract the CN (Common Name) from DN (Distinguished Name) in Active Directory.

For example, someone sent you one report with DN only and you need to extract the CN.

extract-the-cn-from-dn-powershell


previous-buttonnext-button