Jump to content
danialbulloch

Offline Domain Join

Recommended Posts

First of all, thanks @Gavsto and @DarrenWhite99 for helping me get the join file moved from the PDC to the joining computer.

With that out of the way, attached is my script to join a computer that is not in the network of the domain. If you run it on any computer in a client, it will find the primary DC of that client, create an offline domain join file, move it over to the workstation, and finally join that workstation to the domain. It only works on computers that are currently in the workgroup "WORKGROUP" as a safety feature to make sure it doesn't run on anything it should.

The computer does not need to be in the same network as the DC, but it can be, so this can be used for any instance where you want to join a computer to a domain. It does not allow you to log in with any domain credentials unless the computer can reach the DC. Offline caching of credentials, as far as I can tell, is not something that can be done.

One improvement that I am probably not going to do any time soon is running an MD5 has on the source and destination files to ensure the file copy went exactly right, but it is probably a good idea.

TNE - Offline Domain Join.xml

  • Like 1
  • Thanks 3

Share this post


Link to post
Share on other sites

No problem. Glad it is helping others. Between that and a computer naming script, I sped up my computer deployments by about 15 minutes per machine. A big savings on scale.

Share this post


Link to post
Share on other sites
On 8/22/2018 at 9:46 AM, danialbulloch said:

No problem. Glad it is helping others. Between that and a computer naming script, I sped up my computer deployments by about 15 minutes per machine. A big savings on scale.

I am also interested in this. Is it a script that allows you to enter the name of the computer? Or does it look up the last computer name used in AD Users and Computers and increment by 1?

Share this post


Link to post
Share on other sites
59 minutes ago, jasonw said:

I am also interested in this. Is it a script that allows you to enter the name of the computer? Or does it look up the last computer name used in AD Users and Computers and increment by 1?

Basically it just goes up by one. I have a client level EDF that is a computer counter. Every time the script is ran, it takes the counter up by 1. It uses that to number. All of our clients are assigned a 2-4 letter short code, so the name is like TEST-100. Very easy to take the client short code and put it together with the EDF to get the new name. However, there is a trick that I had to do. There is an issue if the script is ran on multiple computers for the same client at the same time, they will collide and end up giving the same name to the same client. To get around that, I check to see if that instance of the script is the oldest running copy for a given client, ensuring that it can't be stepped on, and once one finishes the next one will go. Attached is that piece of code. I'll probably make another post for my computer name script, but because it uses EDFs, it isn't completely self contained.

2018-08-23 13_38_34-Set Computer Name.png

Share this post


Link to post
Share on other sites

@spilgram Sorry I didn't reply, I don't think I saw your comment here. Open the computer screen and check the "Scripts" and "Commands" sub screens. In "Commands" be mindful of the "Execute script" commands, that's where the magic happens.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...