Hello,
I am trying to change the password of a Windows 10 local user using OCS. I am running an OCS NG Unix server 2.6 and OCS NG Windows Agent 2.4.0.0
I am encrypting the password using Powershell and I am trying to change the password using Microsoft.PowerShell.LocalAccounts module with Set-LocalUser command.
I know that I can change the password using net user username password but with this option, I have to send the password in clear text and is not a valid solution for me.
I have opened a cmd as SYSTEM account and I can change the password successfully but if I run the same script using OCS deploy it says
"The term 'Set-LocalUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
I have even tried to install/import the module using OCS deploy. The error that I get is:
'C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.LocalAccounts' was not loaded because no valid module file was found in any module directory.
At line:1 char:1
+ Import-Module -Name C:\Windows\System32\WindowsPowerShell\v1.0\Module ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (C:\Windows\Syst...l.LocalAccounts:String) [Import-Module], FileNot
FoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Did anyone encountered this issue or use another way to change the password in a secure way?