Hi All,
I am working on a script to reconfigure services on a Windows machine using PowerShell.
The first script is used to create the credentials. Everything is successful BUT the password.
Can this be done using PowerShell?
Thanks.
##Set working directory
$curdir
=Split-Path-parent$MyInvocation.MyCommandDefinition cd
$curdir
##Configure Service
$User
='cast\localservice2'
$SecurePassword
=get-contentC:\scripts\encrypted.txt|ConvertTo-SecureString
$UserCred
=New-ObjectSystem.Management.Automation.PSCredential ($User,$SecurePassword)
.\Ntrights.exe
+rSeServiceLogonRight-u$User
sc.exe
config"WIMASvc"obj=$Userpassword=$SecurePassword
sc.exe
start WIMASvc