Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Domain join in FirstLogonCommand

Featured Replies

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\administrator

Any ideas?

I want the credentials prompt to pop up so I can enter and reboot the computer.


Try something like this.

$cred = Get-Credential

powershell.exe add-computer -domain domain01 -cred $cred

Edited by MrJinje

  • Author

Try something like this.

$cred = Get-Credential

powershell.exe add-computer -domain domain01 -cred $cred

ok, what does the first line do?

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 by MrJinje

  • 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-Credential

Nothing happends. Can't find anything related in setupact.log either.

I'll try with another command and see if it uses the FirstLogonCommand...

Edited by zeezam

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

  • 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 -verbose

The 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\Administrator

I 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 by zeezam

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.