Posted On March 31, 2019

PowerShell RandomPassword Function

kimconnect 0 comments
blog.KimConnect.com >> Codes , Windows >> PowerShell RandomPassword Function
function randomPassword{

   # return a reasonably randomized password that starts with "KimConnect:" plus 25 characters with some complexities

   $append="KimConnect:";

    $script:salt = ([char[]]([char]33..[char]95) + ([char[]]([char]97..[char]126)) + 0..8 | sort {Get-Random})[0..24] -join '';

    return "$append$salt";

    }

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Python Module: Datetime

Datetime Programs often include dates and time to perform interactive greetings, calculate age, stamping backups,…

PowerShell: Setting Windows Pagefile

# setPageFile.ps1 # Source: # Reposting here as such code seems to be open source…

PowerShell: Office 365 Bulk Licensing, Changing IDs, Enabling POP3

Connect to Office 365 # Office 365 Global Admin Credential$username="O365globalAdmin"$password=ConvertTo-securestring "PASSWORDHERE" -AsPlainText -Force$cred = New-Object…