#Script : To get Credential as SECURE STRING and save in Local Drive
Read-Host "Enter the password" -AsSecureString | ConvertFrom-SecureString | Out-File C:\SecureData\SecureString.txt
#Script : To Execute PowerShell script with other credentials without prompts
$Uname = "DOMAIN\ADMIN"
$Password = Get-Content C:\SecureDate\securestring.txt | convertto-securestring
$Credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $Uname, $Password
Read-Host "Enter the password" -AsSecureString | ConvertFrom-SecureString | Out-File C:\SecureData\SecureString.txt
#Script : To Execute PowerShell script with other credentials without prompts
$Uname = "DOMAIN\ADMIN"
$Password = Get-Content C:\SecureDate\securestring.txt | convertto-securestring
$Credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $Uname, $Password
No comments:
Post a Comment