Join to domain script with GUI

Hello i need a little help with script. I’m a newborn in the world of PowerShell.

I have task Join to Domain new laptops. I now standarts steps in windows, but i want create scrept with one dilog window when i can input domain name and new computername (It would be ideal if it checked for duplicates in AD). End add buttons Restart and Cancle.

My code is simple:

Add-Computer -ComputerName localhost -DomainName test.corp -NewName Test-name -Credential test.corp\Admin01 -Restart

I’m sorry if this question has been asked before. Search on site tell me another solution for other questions about domain.

Also i want find sollution how i can create one application which include buttons for another scripts:

General Script

  • join to domain (Up)
  • install Printer (already created)
  • disable/enable Antiviruse (in project)

Welcome to the forum. :wave:t4:

Even though it is possible to do such things with PowerShell, it is not really made for that. Especially when you are …

… I’d recommend to become familiar with its basics first. The actual power and versatility comes from NOT to be bound to a limitting hard coded GUI.

Regardless of all that … This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

You may search more than just this site to find examples for tasks like yours. :wink: In the vast majority of the cases you’re not the very first one with a given tasks. So no need to re-invent the wheel again.

1 Like

Thhank you Olaf,
I understand, i dont ask writу for me code or full script. I ask tell me which command or module need me for creation this solution. In net i find PowerShell-Script-Menu-Gui, but i dont understand how it work. In Powershell ISE can’t get help for this module with Admin privelege too.

I`m sorry for my English. May be i not correct write here.

Unfortunately there is no single command or module built in to create graphical elements with PowerShell. :man_shrugging:t4:

How can we help you with that? We cannot understand it for you. Sorry. :man_shrugging:t4:

What module are you talking about? If you want to run administrative tasks you have to start the PowerShell console or your IDE elevated. I’d recommend to use VSCode instead of the PowerShell_ISE anyway.

1 Like

About PowerShell-Script-Menu-Gui - i solve this problem, i think i understood my next steps. Thank you for all )) Some times need just ask and think about steps))

Have a nice day))
I think this post i can close.

1 Like

Windows literally has a GUI for joining a computer, why not just use that?

I now about this:

Firstly need change Comp name and restart, then join to domain and again restart - it is 5 minuts if silent day, but if you have more other tasks or user every 5 minut ask you - you can forgot steps
But if need join faster 10 or more PC`s i think it is faster by script - no?

Now i create small internal solution for prepare pc
This solution include in self buttons:
1 Install WiFi profile + connection
2 Install network printer
3 other function - enable/disable

We small company and we up IT from zero.
Of cource in future we will make all in autoinstallation and autoconfiguration.
But now we have more task and small time

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.