0

I have installed samba and winbind in rhel8.

I was trying to automate the domain join process as well. But when try it manually it is working as expected when we enter the password manually for "service-user-account" for domain join.

But I don't see any command to automate with the password. I have tried with one of the below command, but it is giving an error.

Command: net ads join -U $ad_user%$password

but I am getting below error. I have put the service account user and password in variable.

error: Failed to join domain: failed to lookup DC info for domain 'example.com' over rpc: The attempted logon is invalid. This is either due to a bad username or authentication information.

Kindly help me to automate this step. Appreciate your kind support!.

Thanks Uma

5
  • did you try ` export USER="${aduser}%${password}"`?
    – user492934
    Commented Sep 28, 2022 at 13:25
  • @crpb thanks for helping me. I have tried with this as well. net ads join -U $(ad_user)%$(password) one more thing that I noticed one of the team member has done in ansible. it's working. any suggestion in shell script? - name: domainjoin command command: net ads join -U {{admin}}%{{}password}}
    – Uma
    Commented Sep 28, 2022 at 14:26
  • I guess this is a typo: "$(ad_user)%$(password)"? {} not () or alt. net ads join -U "$ad_user"%"%$password". And you followed the Samba-Doc?
    – user492934
    Commented Sep 28, 2022 at 14:51
  • Thanks for helping me. below command worked for me. net ads join -U $ad_user%$domainpass
    – Uma
    Commented Sep 29, 2022 at 15:10
  • We can close this issue. Thanks!
    – Uma
    Commented Sep 29, 2022 at 15:11

1 Answer 1

0

I got the solution with below command:

net ads join -U $ad_user%$domainpass
1
  • What's the difference? It looks like you're just using a different variable name Commented Sep 29, 2022 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .