This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-SecurePass{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true)] | |
[System.Security.SecureString]$SecurePassword, | |
[Parameter(Mandatory=$false)] | |
[string]$FileName = "EncryptedPassword", | |
[Parameter(Mandatory=$false)] | |
[string]$KeyFilePath = ".\", | |
[Parameter(Mandatory=$false)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 4.0 | |
#Requires -modules ActiveDirectory | |
function Send-AlertsMessage { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$false)] | |
[String]$ToAddress, | |
[Parameter(Mandatory=$false)] | |
[String]$FromAddress = "_SERVICEACCOUNT@BLAH.COM", | |
[Parameter(Mandatory=$false)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$FolderLocation = @("FilePath1", "FilePath2", "FilePath3") | |
$AllFiles = @() | |
$FileList = @() | |
foreach($RootFolder in $FolderLocation) { | |
$AllFiles += Get-ChildItem -Path $RootFolder -File -Recurse | |
} | |
foreach($File in $AllFiles) { | |
$FileHash = Get-FileHash $File.PSPath | Select-Object Hash -ExpandProperty Hash | |
$FileInfo = [PSCustomObject]@{ | |
Folder = $File.DirectoryName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 4.0 | |
#Requires -modules ActiveDirectory | |
function Connect-Exchange { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true, | |
HelpMessage="User admin credentials")] | |
[System.Management.Automation.PSCredential]$Credential, | |
[Parameter(Mandatory=$false)] | |
$URI = "https://outlook.office365.com/powershell-liveid/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Format-DisplayList { | |
<# | |
.DESCRIPTION | |
Display an array larger than certain members into nice column(s) for | |
easy readability. Added the ability to either use a number system or dashes | |
to display the list. | |
#> | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
Using HP's warranty API (beta) to get warranty information on computer system. | |
To use this script, a valid HP developer API is required, and have to be enrolled CSS (https://developers.hp.com/css-enroll). | |
#> | |
function Get-AuthorizationToken { | |
<# | |
.DESCRIPTION | |
Using the APIKey and APISecret, this will retrieve a token that'll be required for every call made to the developer API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 4 | |
<# | |
.DESCRIPTION | |
This is to capture information use to get more accurate information for inventory. | |
.NOTES | |
Used as part of the login process, it'll try to get the following infomation in JSON: | |
{ | |
"Manufacturer": "Microsoft Corporation", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
This works with JSON files created by export_computerinfo.ps1 | |
#> | |
$LogLocation = "\\samepath\as\export-computerinfo\" | |
$JSONFiles = Get-ChildItem -Path $LogLocation -Filter "*.json" | |
$FileName = "AllComputerInfo.csv" | |
$ReceiveAssetInfo = New-Object "System.Management.Automation.PSDataCollection[psobject]" | |
if($JSONFiles) { | |
$RunspacePool = [runspacefactory]::CreateRunspacePool(1,16) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 4.0 | |
#Requires -modules ActiveDirectory | |
<# | |
.DESCRIPTION | |
This requires Exchange Web Service Managed API 2.2 tool which could be downloaded from | |
https://www.microsoft.com/en-us/download/details.aspx?id=42951. | |
.NOTES | |
Change the $From and $To to get a different date range information.This was created | |
to be ran manually, to get the raw data. The raw data should be imported into |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
The process of copying and replicating the file server migration. Because RoboCopy is used, any files that are open will not be copied. So it'll be a good idea before making the file server switch to stop the shares on the old file server, and manually run the differential sync to make sure that all files are copied over. | |
.EXAMPLE | |
It's highly recommended that the intial sync should be done manually with the following: | |
.\replicateserver.ps1 -InitialCopy -SourceDirectory "\\Fileserver\Users" -DestinationDirectory "C:\Something" -LogLocation "C:\FileServerMove\Log" -LogName "Testing" | |
To schedule the subsequent differential syncs, set up a schedule task with the following: |
OlderNewer