I’m attempting to script a LAPS installation which requires the creation of a local account. When I test the powershell script on my local machine everything works great. When I tried to run it through Automox I get an error.
Get-LocalGroupMember : The term 'Get-LocalGroupMember' 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.
At C:\ProgramData\amagent\execDir691746467\execcmd943937958.ps1:3 char:15
+ $isingorup = (Get-LocalGroupMember $group).Name -Contains $user
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-LocalGroupMember:String) )]
, CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
New-LocalUser : The term 'New-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.
At C:\ProgramData\amagent\execDir691746467\execcmd943937958.ps1:6 char:1
+ New-LocalUser "CTPAdmin" -Password $password -Description "Local Admi ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-LocalUser:String) )], Comma
ndNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Add-LocalGroupMember : The term 'Add-LocalGroupMember' 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.
At C:\ProgramData\amagent\execDir691746467\execcmd943937958.ps1:7 char:1
+ Add-LocalGroupMember -Group $group -Member "CTPAdmin"
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-LocalGroupMember:String) )]
, CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
COMMAND TIMED OUT.
When looking up the possible cause of this error I found that the Microsoft.Powershell.LocalAccounts module is only available with powershell x64.
Does Automox use x86 powershell and if so is a x64 powershell available?