This file contains hidden or 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
| $username = "[email protected]" | |
| $password = "Password123!@#" | |
| $secureStringPwd = $password | ConvertTo-SecureString -AsPlainText -Force | |
| $creds = New-Object System.Management.Automation.PSCredential -ArgumentList $user, $secureStringPwd |
This file contains hidden or 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
| $secureStringText = $secureStringPwd | ConvertFrom-SecureString | |
| Set-Content "C:\temp\ExportedPassword.txt" $secureStringText |
This file contains hidden or 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
| $username = "[email protected]" | |
| $pwdTxt = Get-Content "C:\temp\ExportedPassword.txt" | |
| $securePwd = $pwdTxt | ConvertTo-SecureString | |
| $credObject = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $securePwd |
This file contains hidden or 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
| # Generate a random AES Encryption Key. | |
| $AESKey = New-Object Byte[] 32 | |
| [Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($AESKey) | |
| # Store the AESKey into a file. This file should be protected! (e.g. ACL on the file to allow only select people to read) | |
| Set-Content $AESKeyFilePath $AESKey # Any existing AES Key file will be overwritten | |
| $password = $passwordSecureString | ConvertFrom-SecureString -Key $AESKey | |
| Add-Content $credentialFilePath $password |
This file contains hidden or 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
| <# | |
| .SYNOPSIS | |
| The synopsis goes here. This can be one line, or many. | |
| This version of the template has inbuilt functions to capture credentials and store it securely for reuse | |
| Avoids the need to have plaintext passwords in the script | |
| .DESCRIPTION | |
| The description is usually a longer, more detailed explanation of what the script or function does. | |
| Take as many lines as you need. |
This file contains hidden or 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
| $username = "[email protected]" | |
| $AESKey = Get-Content $AESKeyFilePath | |
| $pwdTxt = Get-Content $SecurePwdFilePath | |
| $securePwd = $pwdTxt | ConvertTo-SecureString -Key $AESKey | |
| $credObject = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $securePwd |
This file contains hidden or 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
| # Modify this file accordingly for your specific requirement. | |
| # http://www.thegeekstuff.com | |
| # 1. Delete all existing rules | |
| iptables -F | |
| # 2. Set default chain policies | |
| iptables -P INPUT DROP | |
| iptables -P FORWARD DROP | |
| iptables -P OUTPUT DROP |
This file contains hidden or 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 Convert-PfxToPem { | |
| param( | |
| [Parameter( Mandatory=$true, | |
| Position=0, | |
| ValueFromPipeline=$true, | |
| ValueFromPipelineByPropertyName=$true, | |
| HelpMessage="pfx filepath")] | |
| [ValidateScript({Test-Path $_})] | |
| [Alias("PsPath")] | |
| [string[]]$pfx, |
This file contains hidden or 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
| # ============================================================================================== | |
| # ============================================================================================== | |
| # =============================== Admin-i-Nator V2 Update 2 ==================================== | |
| # ============= This version has been updated to reflect permission changes with new =========== | |
| # ============= Admin accounts; all account creation tools have been commented out ============= | |
| # ============================================================================================== | |
| # ============= Recent Changes: ================ | |
| # ============= 16 December 2015 - Added button to install updated flash ================ | |
| # ============= 16 December 2015 - Removed Office install option ================ | |
| # ============================================================================================== |
This file contains hidden or 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
| ########## | |
| # Tweaked Win10 Initial Setup Script | |
| # Primary Author: Disassembler <[email protected]> | |
| # Original Version: 1.4, 2016-01-16 | |
| # Tweaked based on personal preferences for @alirobe 2016-03-23 - v1.4.1 | |
| # NOTE: MAKE SURE YOU READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT + ADJUST COMMENTING AS APPROPRIATE | |
| # This script will reboot your machine when completed. | |
| ########## | |
| # Ask for elevated permissions if required |
NewerOlder