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

PowerShell: Manage Remote Desktop Servers by Logging Off Idle Sessions That Have Certain Inactive Programs

# manageRdsSessions.ps1 # Sequence of workflow: # a. Gather active and disconnected sessions on all…

Windows Server Power Settings

powercfg /setactive SCHEME_MINpowercfg /hibernate offpowercfg -L

PowerShell: Virtual Machine Snapshots Report from VMM Servers

# vmSnapshotReport.ps1 # Requirements: # - Credentials to access VMM Servers with Administrator role #…