Enter Username and Password using powershell

How do you enter the ADDS credentials using powershell.

Before I used

-Credential (Get-Credential)

I want to enter Username and Password using powershell:

-Credential $PSCredential

How do you enter username and password using the same script: $PSCredential?

This is what I have so far:

$Username = "Administrator" $SecurePassword = convertto-securestring "PaSsWorD$" -asplaintext -force $credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $Username, $SecurePassword

Install-ADDSForest `

...

-Credential $credentials

...





March 29th, 2015 6:04pm

Is it something like this you are looking for:

$secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)

Free Windows Admin Tool Kit Click here and download it now
March 30th, 2015 5:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics