May 13, 201016 yr I tried to put some scripts in FirstLogonCommands that is used after autologon with built-in administrator local account but nothing happends with this codeline;powershell.exe add-computer -domain domain01 -cred domain01\administratorAny ideas?I want the credentials prompt to pop up so I can enter and reboot the computer.
May 13, 201016 yr Try something like this.$cred = Get-Credentialpowershell.exe add-computer -domain domain01 -cred $cred Edited May 13, 201016 yr by MrJinje
May 13, 201016 yr Author Try something like this.$cred = Get-Credentialpowershell.exe add-computer -domain domain01 -cred $credok, what does the first line do?
May 13, 201016 yr It is just a variable. They can be useful if you are doing this from a ps1 file, but obviously not from a first login perspective, that is my fault.Here is a single line version, added benefit it seems to pre-populate the username field.powershell.exe add-computer -domain domain01 -cred domain01\Administrator Get-Credential Edited May 13, 201016 yr by MrJinje
May 14, 201016 yr Author It is just a variable. They can be useful if you are doing this from a ps1 file, but obviously not from a first login perspective, that is my fault.Here is a single line version, added benefit it seems to pre-populate the username field.powershell.exe add-computer -domain domain01 -cred domain01\Administrator Get-CredentialNothing happends. Can't find anything related in setupact.log either.I'll try with another command and see if it uses the FirstLogonCommand... Edited May 14, 201016 yr by zeezam
May 14, 201016 yr what happens when you run the command on the machine manually. Is this the command failing or is the problem on the domain side. When you run it by hand, try adding the -passthru -verbose to the end to see why it fails.powershell.exe add-computer -domain domain01 -cred domain01\Administrator Get-Credential -passthru -verbose
May 17, 201016 yr Author what happens when you run the command on the machine manually. Is this the command failing or is the problem on the domain side. When you run it by hand, try adding the -passthru -verbose to the end to see why it fails.powershell.exe add-computer -domain domain01 -cred domain01\Administrator Get-Credential -passthru -verboseThe Credential prompt appear, then the cmd windows close and nothing happends.I don't reach to see the error message in the cmd window...With this line it's working manually; powershell.exe add-computer -domain domain01 -cred domain01\AdministratorI start to wondering if the command ever is run on the FirstLogonCommands.I have it under oobeSystem in the xml file and it's unattend for the image. The image is uploaded to WDS after I ran sysprep /oobe /generalize /shutdown /unattend:"xml file". Edited May 17, 201016 yr by zeezam
Create an account or sign in to comment