Hi
I'm new to PS, but not scripting in general and am trying to create a script to automate our Win7 build process.
For various reasons, the machine will be built off the domain, then join itself to an existing machine account at the end.
In order to get the right set of applications installed, the machine account is added to an AD group when created and this info will need to be pulled back to call the applications.
During the build, the machine gets logged on as a local user with admin rights which has no access to the domain.
Now we come to the issue I am having...
I can get the PS1 to call PS2 one and pull back the required parameters, but only while logged on with a domain account.
The PS1 is as follows with some options I've tried commented out:
There is a working command above this to set $strCred - I know this works as it has been copied from a working PS.
When I try either of the Invoke-Command lines, I just get the following error:
Invoke-Command : Parameter set cannot be resolved using the specified named parameters. At R:\PostBuild\PostBuild.ps1:10 char:15 + Invoke-Command <<<< -FilePath R:\PostBuild\OUInfo.ps1 + CategoryInfo : InvalidArgument: (:) [Invoke-Command], ParameterBindingException + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand
But the line not using Invoke-Command works while run as a network user but doesn't use the credentials provided and thus falls over when run as a local user.
Sorry if I've been a bit ambiguous here, I may not be explaining myself properly
Does anyone know of a way to do what I need to do?
Thanks in advance
Matt