zeezam Posted May 13, 2010 Posted May 13, 2010 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.
MrJinje Posted May 13, 2010 Posted May 13, 2010 (edited) Try something like this.$cred = Get-Credentialpowershell.exe add-computer -domain domain01 -cred $cred Edited May 13, 2010 by MrJinje
zeezam Posted May 13, 2010 Author Posted May 13, 2010 Try something like this.$cred = Get-Credentialpowershell.exe add-computer -domain domain01 -cred $credok, what does the first line do?
MrJinje Posted May 13, 2010 Posted May 13, 2010 (edited) 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, 2010 by MrJinje
zeezam Posted May 14, 2010 Author Posted May 14, 2010 (edited) 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, 2010 by zeezam
MrJinje Posted May 14, 2010 Posted May 14, 2010 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
zeezam Posted May 17, 2010 Author Posted May 17, 2010 (edited) 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, 2010 by zeezam
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now