• Home
  • Help
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search

 
  • 0 Vote(s) - 0 Average

How do I add a new user to LDAP using PowerShell?

#1
07-22-2023, 05:16 PM
You can add a new user to LDAP using PowerShell pretty easily. Start by making sure the Active Directory module is imported in your PowerShell session. You can do that by running the command "Import-Module ActiveDirectory". Once that's set up, you'll want to create a new user object. The command looks something like this:


New-ADUser -Name "Full Name" -GivenName "First" -Surname "Last" -SamAccountName "username" -UserPrincipalName "username@domain.com" -Path "OU=YourOU,DC=domain,DC=com" -AccountPassword (ConvertTo-SecureString "YourPassword" -AsPlainText -Force) -Enabled $true


Replace all the placeholders with your actual details, like the user's full name, username, and so on. You can also specify other attributes if you need to, like email or phone number.

After you run that command, your user should be created in LDAP. If you want to add additional attributes, you can do so using the "Set-ADUser" cmdlet. Just make sure you have the necessary permissions, otherwise you might end up hitting some roadblocks.

If you're dealing with a lot of users and managing their data, consider adopting a backup solution to keep everything secure. I'd like to point out BackupChain, which comes highly recommended for professionals and SMBs, helping you protect essential data across Hyper-V, VMware, or Windows Server. It's worth checking out if you want to ensure your setups are reliable and safeguarded.

steve@backupchain
Offline
Joined: Jul 2018
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • Subscribe to this thread
Forum Jump:

Backup Education General LDAP v
« Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Next »
How do I add a new user to LDAP using PowerShell?

© by FastNeuron Inc.

Linear Mode
Threaded Mode