Quantcast
Channel: Powershell – Marc Valk dot Net
Browsing latest articles
Browse All 14 View Live

PowerShell: moving my photo’s up one folder

My photo directory existed in the following structure:<Drive>:<YEAR PHOTO WAS TAKEN><DAY OF PHOTO> I didn’t want that anymore, I just wanted the following structure:...

View Article



PowerShell: Moving files into subfolder based on date

A script to move files from one directory to another and ordering them in subdirectory in the destination folder. The subdirectory name is bases on the date of the file, thus ordering all files with...

View Article

Changing an Office 365 User Principal Name with Powershell

It is very ease to change your login name in Office 365 if you have PowerShell for office 365 (x86 version, x64 Version) installed. First connect to Office 365 Connect-msolService Enter your...

View Article

PowerShell: Import Scheduled Task

Some powershell I needed to import some scheduled tasks (xml files). Just for my own reference $XMLTaskDir = "C:\Program Files (x86)\****\***\" $Tasks = Get-ChildItem -Path $XMLTaskDir -Filter *.xml...

View Article

Running PowerShell Script from Netlogon Share

To run a powershell script from a netlogon share, proceed as follows: create a batch file on the Netlogon Share call your PowerShell Script:powershell -executionpolicy bypass -file...

View Article


Powershell: Set default printer based on IP address

Simple – quick and dirty’ Powershell script to change your default printer based on the location where you are (i.e. @home or @work)$NetworkAdapter = Get-WmiObject -Class...

View Article

PowerShell: compare 2 directory’s

Comparing two directory’s and listing the differences$dir1 = “\\server1\c$\folder1″ $dir2 = “\\server2\c$\folder1″ $d1 = get-childitem -path $dir1 -recurse $d2 = get-childitem -path $dir2 -recurse...

View Article

Powershell: copy files based on date

To copy files from a certain date to a different folder you can use the following PowerShell command: get-childitem | where-object {$_.creationtime -ge "7/29/2014" -and $_creationtime -le "29/7/2014"}...

View Article


Image may be NSFW.
Clik here to view.

PowerShell: Copying Latest Files to multiple servers

Problem: I have a source folders which consisted of multiple directory’s (builds from TFS). I wanted to copy the latest folder (Based on LastWriteTime) to several servers. Answer: use-powershell (what...

View Article


Exporting AD users with email

To export all active directory users and their email addresses  from a certain OU (ie. finance) to a comma seperated file, use the following PowerShell command Get-ADUser -filter * -SearchBase...

View Article
Browsing latest articles
Browse All 14 View Live




Latest Images