Skip to content

Instantly share code, notes, and snippets.

View gabrielrojas's full-sized avatar

Gabriel Rojas gabrielrojas

  • New York
View GitHub Profile
@gabrielrojas
gabrielrojas / Create User in Active Directory and Exchange
Created June 10, 2015 03:14
Create User in Active Directory and Exchange. Applies to Exchange 2010 and AD 2012 or higher
<#
.Synopsis
Creates new user in Active Directory based on Company Standards
.DESCRIPTION
Import module from Active Directory and Exchange withou the need to have the tools the installed on the computer running the commands
I will communicate with AD 2012 R2 and Exchange 2010
.EXAMPLE
New-HPDCUSER -Firstname John -LastName Doe -Password SUperSecretPassword
#>
function New-CompanyUser
@gabrielrojas
gabrielrojas / Compress-Archive PowerShell Version 5
Last active August 29, 2015 14:22
Compress-Archive PowerShell Version 5
<# These 3 commands test the speed that an archive folder is created using different compression values
#>
Measure-Command {Compress-Archive -Path 'C:\Users\Documents\Files\*' -DestinationPath 'C:\Users\Documents\FilesZIPFastest' -CompressionLevel Fastest}
Measure-Command {Compress-Archive -Path 'C:\Users\Documents\Files\*' -DestinationPath 'C:\Users\Documents\FilesZIPNoCompression' -CompressionLevel NoCompression}
Measure-Command {Compress-Archive -Path 'C:\Users\Documents\Files\*' -DestinationPath 'C:\Users\Documents\FilesZIPOptimal' -CompressionLevel Optimal}