Skip to content

Instantly share code, notes, and snippets.

View SveinErik's full-sized avatar

Svein Erik Storkås SveinErik

View GitHub Profile
@SveinErik
SveinErik / GetTotalMailboxSizeForCompany.ps1
Last active May 9, 2018 07:58
Get all user mailbox sizes for a specific email address domain / Script to show the total size of mailboxes that belongs to a specific company in your environment
# Script to show the total size of mailboxes that belongs to a specific company in your environment
# Get all user mailbox sizes for a specific email address domain
# Based on the EmailAddress
# By, Svein Erik
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
CLS
Write-Host ("Collecting info, this will take several minutes..") -ForegroundColor Green
$users = Get-Mailbox -ResultSize Unlimited | Where {$_.EmailAddresses -like "*@yourdmain.com"} | Get-MailboxStatistics | select DisplayName,TotalItemSize #| FT DisplayName,TotalItemSize
@SveinErik
SveinErik / GetAndRemoveEmailAlias.ps1
Created December 1, 2017 10:11
Script to remove certain email aliases from users in Exchange. Apply your filters before you run it.
<#
Script to remove email-alias from users within a scope of filters
#>
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;
CLS
$company = "YourCompany" #Just used as the filename for the csv-export
$domainFilter = "*yourcompany.com" #Search only within those that have this domain in the email-address
@SveinErik
SveinErik / Citrix-ChangeApplicationPaths.ps1
Last active June 15, 2017 10:26
Change/Update CommandLineExecutable and WorkingDirectory on published apps in Citrix
#############################################################################################
# Change/Update Applicationpath (CommandLineExecutable) and WorkingDirectory on published apps
# Example \\11fil05\Program\Sys\Tieto\Ressursstyring\RS_Ajour.exe og \\11fil05\Program\Sys\Tieto\Ressursstyring\
# to \\11fil02\Program\Sys\Tieto\Ressursstyring\RS_Ajour.exe og \\11fil02\Program\Sys\Tieto\Ressursstyring\
#
# 15.16.2017 - SES
# Citrix doc: https://developer-docs.citrix.com/projects/delivery-controller-sdk/en/latest/Broker/Set-BrokerApplication/
#############################################################################################
@SveinErik
SveinErik / CryptoLocker-ScanAndRestore.ps1
Last active August 6, 2022 23:51
Powershell script to scan for encrypted files, and restore them from "previous version" in Windows. Uses QuickIO.NET to avoid PathTooLong
<#
A bit info first:
This script uses QuickIO.NET (https://quickio.net/)
The function Get-FilesQuickIO is made by "Frekac" (http://psfredrik.chiloma.com/2016/12/15/using-quickio-net-with-powershell/)
And the script itself is downloaded from here: https://gist.github.com/frekac/337b8d1b2abddffb2803f36d34d56b27#file-get-filesquickio-ps1
I downloaded "nuget Windows x86 Commandline" from here: https://dist.nuget.org/index.html
Then i used cmd to browse to my folder where nuget.exe is located, and i typed: nuget.exe install QuickIO.net
It's then downloaded in a subdir in the same dir as nuget.exe is located.